November 30, 2003 at 9:15 pm
Hi All
I want to produce 'select * from @table' results,@table assigns value at runtime based onuser parameters.
Is it possible to do so. I Have tried with
sp_executesql peococedure,but it is not
working.
Any Suggestions
Regards
Umashankar
UmaShankar
December 1, 2003 at 12:42 am
I hope that this is what you were asking for....
CREATE PROCEDURE usp_dynamic
@TableName varchar(128)
as
DECLARE @SQLstmnt nvarchar(1000)
SET @SQLstmnt = 'SELECT * FROM ' + @TableName
EXEC sp_executesql @SQLstmnt
GO
If it aint broke don't fix it!
Andy.
December 3, 2003 at 12:29 am
Thanks
UmaShankar
UmaShankar
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy