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 |
|
CoffeeAddict
Yak Posting Veteran
94 Posts |
Posted - 2009-12-07 : 10:49:59
|
| DECLARE @OrderItemID int DECLARE @CustomerID int@OrderItemID = 9243578@CustomerID = 1299539what the heck is wrong with this...it's saying that the syntax is not right. |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-12-07 : 10:55:52
|
You need to SET it..ot SELECT the value...like DECLARE @OrderItemID int DECLARE @CustomerID intSET @OrderItemID = 9243578SET @CustomerID = 1299539SELECT @OrderItemID,@CustomerID |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-12-07 : 10:57:55
|
You've posted in T-SQL (2008) so this is also possible:DECLARE @OrderItemID int = 9243578 No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
CoffeeAddict
Yak Posting Veteran
94 Posts |
Posted - 2009-12-07 : 11:06:32
|
quote: Originally posted by vijayisonly You need to SET it..ot SELECT the value...like DECLARE @OrderItemID int DECLARE @CustomerID intSET @OrderItemID = 9243578SET @CustomerID = 1299539SELECT @OrderItemID,@CustomerID
Doh, thanks! |
 |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-12-07 : 12:01:15
|
np..it happens |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-12-08 : 01:50:10
|
quote: Originally posted by CoffeeAddict DECLARE @OrderItemID int DECLARE @CustomerID int@OrderItemID = 9243578@CustomerID = 1299539what the heck is wrong with this...it's saying that the syntax is not right.
Become SqlAddict MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|