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 |
|
under2811
Constraint Violating Yak Guru
366 Posts |
Posted - 2010-05-10 : 01:10:25
|
| Hi,declare @i intset @i = 4if (SELECT count(1) FROM a WHERE id = 3) = 3 thenexitinsert into avalues (@i)error: Msg 156, Level 15, State 1, Line 5Incorrect syntax near the keyword 'then'.please suggestT.I.A |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-05-10 : 01:15:32
|
| If doesn't have "then"http://msdn.microsoft.com/en-us/library/aa933214(SQL.80).aspxSenthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-05-10 : 01:16:34
|
 KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
under2811
Constraint Violating Yak Guru
366 Posts |
Posted - 2010-05-10 : 01:18:15
|
| hi,i have multiple insert into temp table statement below this loopso i dont want to execute these so i want to exit the whole SP if it gets above condition value.T.I.A |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-05-10 : 01:21:01
|
[code]if (SELECT count(1) FROM a WHERE id = 3) <> 3 BEGIN < the multiple insert into temp table statement >END[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|