Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Indra_G
Starting Member
13 Posts |
Posted - 2011-11-10 : 06:04:53
|
I usually use MS Access database for my VB.NET program. If I want to update a data in a table (A) that is linked to another table (B), with the condition of table B, I usually use this kind of query:Update tblA, tblB Set tblA.Date1 = Null, tblA.Date2 = Null Where tblA.Numb = tblB.NoF And tblB.Numb = 'B-0010' However, when I tried it with SQL Server 2005, I got incorrect syntax error. How am I supposed to do this in T-SQL?Thank you so much... |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-10 : 06:26:04
|
in sql server it should be likeUpdate aSet a.Date1 = Null, a.Date2 = Null from tblA ajoin tblB bon a.Numb = b.NoF And b.Numb = 'B-0010' ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Indra_G
Starting Member
13 Posts |
Posted - 2011-11-10 : 23:54:08
|
| OK, that works well! Thank you so much... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-11 : 03:05:39
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|