Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

output value of select scope_identity to page

Status
Not open for further replies.

melrse

Programmer
Dec 13, 2000
25
US
strInsert = "Insert INTO Family (entrydate,returneddate,Quest01,Quest02,) Values('2007',GetDate(),@Quest01,@Quest02); Select scope_Identity()"
I apologize for my ignorance but I can't seem to get the above value returned from select scope_identity to output back to user page.
Have googled, found lots of stuff, tried and still can't get it to work.
Appreciate any help.
Thanks,
 
You may need to run the statement as an "ExecuteNonQuery" or else create the statement as a stored procedure, with an output parameter.

Have you tried running the statement in the Query Analyzer? the semi colon shouldnt be there if that is an MS SQL database.

-The answer to your problem may not be the answer to your question.
 
You have an extra comma in your field list.

Insert INTO Family (entrydate,returneddate,Quest01,Quest02[!],[/!])

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
i think you have to use execute scalar to obtain the returned value. thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top