Sir/Madam
How to execute select and insert commands at same time in stored procedure.want to get selected value in data table.
With Regards,
Gomathi.P
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manikavelu VelayuthamPosted Sep 20, 2010, 3:45 AM
Gomathi PalaniswamyPosted Sep 20, 2010, 3:43 AM
With Regards,
Gomathi.P
Manikavelu VelayuthamPosted Sep 20, 2010, 3:35 AM
(@Input1 DataType
@Input2 DataType)
AS
Begin
SELECT * FROM Table1 WHERE columnName = @Input1
Insert INTO Table1 VALUES(@Input1, @Input2)
SELECT * FROM Table1 WHERE columnName = @Input2
End
Above stored procedure will execute the select statement first, insert statement second, and finally the select statement which will be returned as a datatable.