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 |
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-09-17 : 00:05:03
|
| Will this work with the goto function.does it take the execution to the location we specifyIF EXISTS(select emp_id from tbl_emp_details where emp_id=@emp_id)begin set @adv=-1 set @ert =-3 GOTO location99endelsebegin ......... ..........endlocation99print 'Test' |
|
|
hgorijal
Constraint Violating Yak Guru
277 Posts |
Posted - 2004-09-17 : 00:20:20
|
| Isn't that what GOTO is for!!! The label "location99" should be followed by a colon(:).Hemanth GorijalaBI Architect / DBA... |
 |
|
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-09-17 : 00:24:21
|
| that means location99: print 'Test' should work right...correct me if Iam wrong...this goto will take the execution to that particular block...so this should be completely out of the if else condition |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-09-17 : 01:32:23
|
| That's right.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-09-17 : 05:15:39
|
NOOOOOO..... not the goto statement.... life.... must ..... not... be .... miserable..again!!!! Go with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|