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 |
|
johnmce@oceanfree.net
Starting Member
2 Posts |
Posted - 2005-11-05 : 07:42:36
|
| Hi Guys, A newbie here who is trying to create a stored procedure which will add extra records to a table so I can practice tuning it. Get the following error with the code below. gives me the following:error 170: line 4:incorrect syntax near '=' . Must declare the variable '@high value' Any ideas? thanks JohnCREATE PROC addtoorder@mycount intASdeclare @highvalue = mycount+1000while @mycount<@highvaluebegininsert into orders (orderID, CustomerID, orderdate) values (@mycount, 'VINET', getdate())insert into [order details] values (@mycount, 11, 14, 2, 0)set @mycount =@mycount+1endreturngo |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-05 : 07:52:26
|
| Instead ofdeclare @highvalue = mycount+1000Try thisdeclare @highvalue intset @highvalue = mycount+1000MadhivananFailing to plan is Planning to fail |
 |
|
|
johnmce@oceanfree.net
Starting Member
2 Posts |
Posted - 2005-11-05 : 09:30:48
|
| Thank you problem solved. Much appreciated. |
 |
|
|
|
|
|