Skip to main content

All Questions

1 vote
1 answer
335 views

Azure SQL - Select Into - Update if exists, else create

I am using Azure SQL for an Application DB, and am trying to create (and subsequently kep updated) some lightweight tables from the more complete tables the Application uses. Main reason for this is ...
Popavich's user avatar
2 votes
1 answer
424 views

Insert data from Table A to Table B, then Update Table A with Table B ID

I currently have two tables like the following: Table A TableAId TableAPrivateField CommonField1 CommonField2 CommonField.. TableBGeneratedId 1 datadatadata datadatadata2 datadatadata3 d... NULL 2 ...
Fabio Valt's user avatar
0 votes
1 answer
704 views

Copy first row values to all rows and update two columns value from another table

We have a table where the first row will be updated with UI input through API, we have to replicate the same data for different dates from another table. How do we do it in SQL (working on SQL Server ...
Chaitra Murthy's user avatar
0 votes
0 answers
803 views

How to do an UPSERT in Python for MSSQL [duplicate]

I have the following problem. I am getting some data from an api in form of a json. I want to load this json data into an existing table. I get the data in following format: { "abcd": &...
fnavw's user avatar
  • 1
0 votes
1 answer
143 views

SQL to update rows to remove words with less than N characters

I have a TAGS column in my Products table in SQL Server. In my web project I split them with space, for example: "web web_design website website_design" => 1.web 2. web_design 3. ...
Mertez's user avatar
  • 1,101
0 votes
1 answer
148 views

Update SQL table using selection from another table

I want to update the values of a SQL table based on the value from another table where the two tables have a common ID. When I run my script it says it work. But when I check the table that should ...
tcoady's user avatar
  • 13
0 votes
1 answer
514 views

SQL: Insert Into Table 1 From Table 2 then Update Table 2 - Performance Increase

I am working to increase the speed and performance for a database process that I have inherited. The basic steps, prior to this process, is a utility uploads about a million or more records into an ...
Chris Donnelly's user avatar
0 votes
0 answers
295 views

Update records in SQL Server database table after crystal report is exported

I am developing a WinForms application using C# and SQL Server 2015. I want to update the records of a table once the crystal report is generated and exported as pdf file. Details: The user form ...
siraj ahmed's user avatar
-2 votes
1 answer
363 views

SQL UPDATE on with data from same table

I have a next situation with a table, Need to update rows from rows in same table, as you see here: TABLE ID SN FID 1 12345 1 2 1122 2 3 12345-RG NULL 4 1122-RG NULL I need to UPDATE row 3 from ...
user3128539's user avatar
0 votes
1 answer
775 views

Best strategy for Massive Insert/Update using jdbc in mssqlserver

Good Day, I posted this question previously but it seems I am not clear enough so I will try to be as detailed as possible here about my situation. I need to implement a solution to do a daily ...
rread's user avatar
  • 153
1 vote
3 answers
2k views

Update Query in SQL using Joins

I am using SQL UPDATE statement with a JOIN clause. Whenever I update the table, same data is being updated for all the rows. Below is the SQL query which is used to update the table update table3 set ...
Karthick88it's user avatar
-1 votes
2 answers
184 views

trying to run this code but i keep getting an error saying "incorrect syntax near keyword 'where'" please assist

If _id <> String.Empty Then cn.Open() cm = New SqlCommand("update tblBill_Items set description = @description,qty = @qty,unitprice=@unitiprice,discount=@discount ...
Masto Liquid-Mind Ntuboy's user avatar
1 vote
1 answer
861 views

How can I prevent inserting duplicate data into a SQL Server table where value is multiple

I have a declared some of data that need to be inserted into SQL, what should I do to check the data in SQL to prevent same data inserted into table? 123(AA) is already uploaded and 123(BB) is a new ...
romil 's user avatar
  • 21
-2 votes
1 answer
375 views

C# stored procedure insert or update with DataTable problem?

I want to add or update with the code below. I get the following error. How should I edit this code? Must declare the scalar variable "@UyeID". Incorrect syntax near the keyword 'ELSE'. My ...
user3811744's user avatar
0 votes
1 answer
88 views

Update or Insert using Select statement

I'm trying to write a query in SQL Server that does the following: perform a data aggregation query for one table and then pass the results to another table. If a row with that date already exists, ...
FelipeFonsecabh's user avatar

15 30 50 per page
1
2 3 4 5
8