Viewing 15 posts - 796 through 810 (of 895 total)
Jeff Moden (4/5/2010)
nilesh k (4/5/2010)
Delete + Insert is as per the business logic so that can not be changed.
This is such a terrible idea that I have to ask. ...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
April 5, 2010 at 11:10 pm
Then i would suggest you to create a unique column and then proceed. A system generated IDENTITY column should be fine unless it breaks your existing code or procedures.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
April 5, 2010 at 1:22 am
nilesh k (4/5/2010)
Delete + Insert is as per the business logic so that can not be changed.Any alternative than storing values in separate table before delete?
One more idea would be...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
April 5, 2010 at 12:45 am
🙂 Glad i could help you. Happy coding.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
April 5, 2010 at 12:35 am
Inside an INSERT trigger, you will not have any data in the deleted table. Only the inserted will have data.
Why are you preferring delete + insert method over the update...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
April 5, 2010 at 12:10 am
From your post it seems PostID is the primary key in table1 and foreign key in table2. If it is so you should join on PostID column.
Your code should look...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
April 4, 2010 at 11:37 pm
This seems to a basic INNER JOIN query. Look for INNER JOIN in Google or Books Online. Try some code on your own and if you have any further difficulties,...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
April 4, 2010 at 11:14 pm
You can do this by a simple join
UPDATET2
SETBatchid = T1.Batchid
FROMtable2 T2
INNER JOIN table1 T1
ON T2.document = T1.batchname
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
April 2, 2010 at 11:16 pm
Go through the below link where a similar issue was discussed
http://www.sqlservercentral.com/Forums/Topic890414-338-1.aspx
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 30, 2010 at 6:50 am
vidya_pande (3/29/2010)
If number of rows afftected(in update or...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 29, 2010 at 4:23 am
I meant all the records that are inserted. You can have a statement that inserts 10 records or deletes 10 records at one go. Even in that case you would...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 29, 2010 at 4:02 am
From the above code you would get either one mail or no mail at all. You will have to use a cursor or a While loop to loop through all...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 29, 2010 at 3:29 am
You cannot use an IDENTITY column for this. You will have to use a Computed Column.
DECLARE @tblTable TABLE
(
Col1 TINYINT IDENTITY(1,1) NOT NULL,
Col2...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 27, 2010 at 2:43 am
It would help if you can give us some sample data and the table structure. It would be difficult to help you with the given information.
From whatever i understood, I...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 27, 2010 at 1:04 am
Thats what i was looking for. But sadly i don't have SQL Server 2008. I can use your other methods till then. Thanks once again Paul.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 26, 2010 at 4:02 am
Viewing 15 posts - 796 through 810 (of 895 total)