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 |
anupalavila
Yak Posting Veteran
56 Posts |
Posted - 2011-01-25 : 04:30:04
|
HiMay I know why it shows error--- Incorrect syntax near the keyword 'select'--- while creating the stored procedurecreate procedure sp_test@maxId bigintasBeginset @maxId = select Isnull(max("productId"),0) from InventoryProductMasterinsert into tbltest(Id,val) values (@maxId,'hai')EndThanks and Regards Anu Palavila |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-01-25 : 04:33:29
|
set @maxId = ( select Isnull(max("productId"),0) from InventoryProductMaster) N 56°04'39.26"E 12°55'05.63" |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-01-25 : 04:34:00
|
The real quesion is why you are not using IDENTITY column in InventoryProductMaster table. N 56°04'39.26"E 12°55'05.63" |
 |
|
anupalavila
Yak Posting Veteran
56 Posts |
Posted - 2011-01-25 : 04:39:25
|
sorry I dont want to pass the @maxId value, I am looking to correct the below SPcreate procedure sp_testasBegin@maxId bigintset @maxId = (select Isnull(max("productId"),0) from InventoryProductMaster)insert into tbltest(Id,val) values (@maxId,'hai')EndThanks and Regards Anu Palavila |
 |
|
|
|
|