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 |
|
m.p
Starting Member
2 Posts |
Posted - 2010-10-03 : 08:48:10
|
hello,I wrote the following stored procedure, in which I use a local variable 'syncParam': declare @syncParam bit select isSync into syncParam from MyTable where id=@id if (@syncParam='True')... else ... return @syncParam When I executed this stored procedure at the first time it works, but after that I get the following error: "there is already an object named 'syncParam' in the database".What did I miss? Should I delete this object at the beginning of the stored procedure?Thanks in advance. |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2010-10-03 : 09:27:54
|
| With that syntax you now have a permanent table named [syncParam] in your database.You want: select @synParam = isSync from myTable where id = @idBe One with the OptimizerTG |
 |
|
|
m.p
Starting Member
2 Posts |
Posted - 2010-10-03 : 09:53:54
|
| Thanks you very much! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-10-04 : 09:36:38
|
| if its bit your if condition should beif @syncParam=1....------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-10-05 : 06:14:51
|
quote: Originally posted by m.p hello,I wrote the following stored procedure, in which I use a local variable 'syncParam': declare @syncParam bit select isSync into syncParam from MyTable where id=@id if (@syncParam='True')... else ... return @syncParam When I executed this stored procedure at the first time it works, but after that I get the following error: "there is already an object named 'syncParam' in the database".What did I miss? Should I delete this object at the beginning of the stored procedure?Thanks in advance.
Have you worked on ORACLE before? MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|