446 questions
0
votes
1
answer
76
views
Azure DevOps SQL Task: Column names in each table must be unique. Column name 'currency' in table 'test' is specified more than once
I am trying to execute the following SQL script into the database. When I deploy it the first time, it succeeds without errors. When I deploy it the second time, it is giving the error.
I am not using ...
1
vote
1
answer
74
views
Getting Errors with Loop in Stored Procedure in Snowflake
I have a procedure in snowflake which creates backups of Databases by cloning them.
There is a problem with this procedure in that it also clones the masking policies and row policies from the ...
0
votes
1
answer
46
views
DBMS returning multiple # symbol as value when I enter a sql query [duplicate]
DBMS seems to show me values that are replaced with # symbol. Below would be my record and the records that i was planning to retrive data from. The picture attached would be output from DBMS.
ACCEPT ...
0
votes
0
answers
25
views
How can i query and move data in SQL to different tables?
I have a table in SQL which has millions of records and i want to move some of those records to different tables.
I want to keep only 3months worth of data from the current date
So any record that is ...
0
votes
1
answer
42
views
IN SQL how to retrieve XML column data based on element
I have the XML inside one of the table columns, here I need to find rows based on 'DESCRIPTION' which is present in the table.
Sample XML column value
<Activity>
<text value="ID:HELLO, ...
0
votes
0
answers
70
views
Exporting the data from DB by passing the data from input csv file and saving the results in csv file
$SQLServer = "Server Name"
$SQLDBName = "DB Name"
$csvData = Import-Csv -Path "D:\Sampath\SQL\DynamicSql\CustomerData.csv"
#SQL Query for periodic payments.
forEach ($...
0
votes
1
answer
363
views
How can I run SQL scripts which are there in Azure synapse analytics workspace using azure DevOps?
I tried few steps:
Connected to azure cloud using service connection ( based on service principal), SPN has contributor level access at scope subscription and rg
Authenticated to Azure synapse ...
0
votes
0
answers
45
views
Having problems with txn_date Between over a 24hour period broken up into two 12 hour chunks
I currently have a data pull that tracks data from 0730-1930 and 1930-0730. Data refreshes at the start of each time period. My problem is my script stops pulling a half hour early; it ends at 0700 ...
0
votes
1
answer
346
views
Update column in table using snowflake scripting SQL
I am trying to update price column in table sweatsuits.
Goal is to add up 100 to price column values, when color is 'red' or 'pink'. I have written below code and it throws me error saying:
invalid ...
0
votes
1
answer
303
views
How do you export Attached Documents from Database taken from Microsoft Dynamics CRM 2016?
I'm currently trying to export attached files from a sql Database taken from a Microsoft Dynamics CRM 2016 application. The attached files data are stored as BLOBs in a VARCHAR(MAX) datatype. Pictures ...
0
votes
1
answer
88
views
postgres bytea sql with parameter error on inserting and/or updating with one sql script c# .net
I have problems on inserting/updating a bytea stream into a postgres table.
insert and update is working fine if I try this seperately ..
Both together ... an error occurs ()..
Here the working ...
0
votes
2
answers
96
views
Get the records from SQL table which matches on the same date
How to find the all the records which are having multiple status for the same account Id (doesn't matter what status it's belong) on the same Date, doesn't matter about the time, but Date is important
...
0
votes
1
answer
46
views
Postgres/psql sql script: how to pass arguments as partial name
Postgres/psql 13
Hi all!
I have to create several roles with the same prefix:
create role XXX_admin...
create role XXX_owner...
create role XXX_user...
then I want to create a sql script that create ...
-1
votes
1
answer
213
views
How to extract all the table names from a Python script
I have python script which has many SQL queries. I want to
spark.sql("Select a,b from schema.table1 UNION ALL Select a,b from schema.table2 ")
I need to extract all the table names referred ...
0
votes
1
answer
2k
views
Snowflake dynamic SQL: Storing query results as variables between executions
In Snowflake, I'd like to use the numeric result of one dynamic sql query in a second dynamic sql query:
CREATE OR REPLACE PROCEDURE DB.SCHEMA.SP_DATA_COLUMN_VALUES(table_name varchar, column_name ...
0
votes
2
answers
144
views
Sql sort script based on one column that has odd or even value
I need help devising a sql script that will sort a bay item, based on the column value. If the level column value is even, then the bay ascends, but if the level column is odd, then bay descends. I ...
0
votes
0
answers
63
views
Create mdb table from C# and using OLE OBJECT field
I am creating an Access Database from C# code and using text files to hold the script that is used to create them.
One of the fields I need to create is a image field from my SQL knowledge. The way it ...
-2
votes
1
answer
113
views
How do I convert an SQL script into actual viewable data sets to include in my portfolio?
I am a complete newbie. Transitioning into data analytics. Currently at the stage of getting my hands dirty with portfolio projects to ensure I'm more marketable, hehe.
I completed one of these ...
0
votes
1
answer
110
views
Oracle SQL script - Package created with compilation errors
Can anyone tell me what about these two scripts is causing "created with compilation errors." warnings? We're using Oracle db 19c. Do the "COMMIT;" statements matter one way or the ...
0
votes
1
answer
40
views
Oracle sql script with parameters - difference between # and $
I have the following CREATE TABLE ${schema_name}.TABLE and CREATE TABLE #[schema_name].TABLE.
I have some migrations to do with Flyway and the ones with # do not work.
What is the difference between ...
0
votes
0
answers
95
views
Problem get Script from Database with .net Core 7
I want to get a script from my database, but it gives the following error:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
Microsoft.SqlServer.Management.Smo....
-1
votes
1
answer
89
views
for the below sqlplus query script, how to get DATE & TIME in DD-MMM-YY HH.MM.SS format for one column "evt_eventdate," only
for the below mysqlplus query script, how to get DATE & TIME in DD-MMM-YY HH.MM.SS format for one column "evt_eventdate," only
set echo off
SET SQLFORMAT CSV
SET FEEDBACK OFF
SET ...
0
votes
1
answer
861
views
SQL Injection Detected By Firewall For SQL Code Submitted As Text For Storage
I have a head-scratcher here. Over a year ago, I wrote a website feature/form where I could submit SQL Code that is not executed but stored in a table. This feature worked when I created it, as I was ...
0
votes
1
answer
473
views
Creating ISNUMBER function in Snowflake
ISNUMBER is not a in-built function in Snowflake.
I want to create ISNUMBER function in Snowflake as an user-defined function.
Below is the user-defined function of ISNUMBER in oracle:
CREATE OR ...
0
votes
0
answers
89
views
How to assign array to JSONB variable in postgres script
I want to adjust a JSONB column by adding a new array prop in an existing record, but I struggle with getting this updated record.
Something like this:
DO $$
DECLARE
mt table1%ROWTYPE;
arr TEXT[];...
0
votes
2
answers
506
views
How to set in SQL a Flag based on days range
Sample table (customer) have the following data,
RecID
createdDate
UserID
ROWNUMBER
toCount
1
10-25-2022
User01
1
true
2
10-14-2022
User01
2
true
3
01-25-2020
User01
3
true
4
10-19-2022
User02
1
...
1
vote
2
answers
2k
views
EF migration, reading and executing SQL from external file, quote problem
I wanted to use Entity Framework migrations in my .NET 6 application for creating and altering views. I found a relevant article covering this for stored procedures at https://dotnetthoughts.net/...
0
votes
1
answer
399
views
Migrating Data table values to Another Database Table using Script
I'm building a new system for a company.
They already have a system and the database is SQL Server.
Because of the issues I currently have in the existing system, I'm developing a new web-based ...
0
votes
0
answers
800
views
EF Core 6 code first: Add triggers to new database?
I need to add sql scripts to a new database created with code first approach. I couldn't find anything about that when googling for it. How is it done please?
Background:
I need to add triggers to the ...
0
votes
1
answer
443
views
sql query to show all rows where a group of a field has the same value for all rows in another field
I have a table where i have two columns in the below fashion
sale_id status
268 5
268 1
268 1
268 1
283 5
283 5
283 5
284 5
284 1
284 1
284 1
284 1
284 1
284 1
As you can see, we have sale_id and ...
1
vote
2
answers
356
views
It is a way to modify an SQL Insert Script with SED Command in order to insert word DATE before date value?
Modifying SQL Scripts with SED Command
I would like to explain my task. I have been asked to modify many files with one command without alter the data. The core is to properly insert DATE_B values, ...
0
votes
0
answers
172
views
How to increase SQL parser speed that using TSqlParser?
In my code, I have several SQL scripts that I want to parse using TSql130Parser in order to refactor them. But this process takes a long time - is there a way to increase the speed of this?
Also I ...
0
votes
1
answer
822
views
Trying to Run a SQL script file, Getting Syntax error : Incorrect syntax near '`'
I'm trying to execute a SQL script dump file which have multiple tables. I want to read data from this dump file and make a sqlite(offline) database.
I'm using following SMO procedures and code is ...
-2
votes
2
answers
252
views
How to execute the statements in .sql file contains Go, single line and multi line comments using C#?
I have a .Sql file containing a number of statements including
Go
--Single-line comments
/*
Multi-line comments
*/
How can I execute this file using c#?
Please suggest to me some ideas.
Thank You:)
1
vote
1
answer
463
views
.NET Core Create SQL scripts task failing in azure pipeline - Unable to retrieve project metadata error
I had a perfectly working pipeline for my API project where I followed the below tutorial.
https://dotnetthoughts.net/run-ef-core-migrations-in-azure-devops/
From this, I made a change to get a NuGet ...
1
vote
0
answers
4k
views
DBeaver CSV to Table import. How to do scripted without import Wizard?
I have a table I routinely want to drop, then re-import and add a
primary key constraint for.
The thing is I don't want to step thru the wizard each time.
How can I script this as a command so I don'...
0
votes
1
answer
2k
views
How to make SqlPackage exclude indexes?
We're using SqlPackage to generate scripts via the Script action. Does anyone know a way to get it to exclude indexes? Can't seem to find a way.
The SqlPackage reference gives several /p: properties ...
0
votes
1
answer
983
views
Querying Json array column and other current table column
I have a table that has three columns from which I need to retrieve the data. One of the columns OtherNames contain an array of Json Objects.
CREATE TABLE Persons (
NameID int,
CurrentName ...
1
vote
2
answers
834
views
SQL Query to fetch the customers registered in the DB without email address(CS can have phonenumber and email in the same field but duplicating)
I need help with writing this query please ,
in the Database - the customer is registered twice , one row with the email address in the VALUE field and the other row with phone number in the SAME ...
-1
votes
2
answers
412
views
Sorting DESC results in "Invalid column name" error
I have a table MOVIE with a column Desc which stands for description.
I tried to sort by this column:
SELECT
* ,
ROW_NUMBER() OVER (ORDER BY [Desc] ASC) AS RowData
FROM
(SELECT
...
1
vote
1
answer
806
views
How to run sql scripts in bigquery from apache airflow by ignoring the error in DB
we have one sql script and want to execute it in bigquery from apache airflow using BQ client.
we are generating sql script using python function. while running this script if there is any issue then ...
0
votes
1
answer
1k
views
Execute SQL file on Oracle database using C#
I have written SQL scripts in a script.sql file to create procedures. This script.sql file is located in the application path.
Now I've written a tool in C# that creates a database connection. I would ...
0
votes
0
answers
104
views
Command(s) to generate script for insert into table of one DB with selected records from other DB (data migration/update)
We have a system that includes a DB with tens of tables, some with evolving DATA and some with rather static Steering information.
The system is now running within a number of environments, one is the ...
0
votes
1
answer
101
views
declare table inserted values duplicated
I try to get two different table values to insert one declare table but the employee ID is duplicate,
DECLARE @WSotable TABLE
(
Employee int,
...
0
votes
0
answers
33
views
Is there a programmatic/system native way to replicate oracle roles across instances?
I'm working with 2 Oracle 19C instances:
Instance1 and Instance2
Users have certain roles and resulting privileges on tables in Instance1. I have a DB link from Instance1 to Instance2 and a schema in ...
2
votes
2
answers
1k
views
IBM i Access Client Solutions (ACS) Run SQL Scripts - print variable
is there an easy way to display/print a variable on the output of the IBM i ACS Run SQL Script screen?
For having a quick check when writing a script it would very helpful to be able to display the ...
0
votes
1
answer
152
views
Sql scripts for creation of same table in repository tests
I have several Spring data repositories which have some joins to the same table, lets say, Client table. So in order to not repeat the sql script for the creation of the Client table for each ...
0
votes
1
answer
285
views
SQL script within subquery (Big Query)?
Is there a way to have SQL scripts within a subquery ?
For example:
select col_1, col_2, count(*) from (
Declare max_radius INT64;
set max_radius = 250;
select * from my_table
where radius < ...
0
votes
0
answers
189
views
Is there a way to print out full Merge Script Output?
I use multiple Merge Scripts for CI/CD deployment a database.
Dacpac contains Post Deployment Script which is used in Azure Devops Deploy Azure DB Task.
This script is a concatenation of multiple ...
2
votes
1
answer
6k
views
\i psql permission denied
I am trying to run a .sql script that uses postgresql. I have installed postgresql, and created a database to run the script in however I continuously get permission denied error on the file. ...