Jun 17, 2002 #1 jonsey Programmer Jun 17, 2002 3 US Is it possible to create a parameter that allows a user to enter a table name which will be part of the select statement? thanks
Is it possible to create a parameter that allows a user to enter a table name which will be part of the select statement? thanks
Jun 17, 2002 #2 sunila7 Technical User Apr 11, 2001 1,087 US Hi, u could try something like this... CREATE PROCEDURE new1 AS Declare @tablename Varchar(40) Begin Declare @Sel as varchar(200) set @Sel = 'Select * from ' + @tablename + ' Where field1 =''abcd''' exec (@sel) End Sunil GO Upvote 0 Downvote
Hi, u could try something like this... CREATE PROCEDURE new1 AS Declare @tablename Varchar(40) Begin Declare @Sel as varchar(200) set @Sel = 'Select * from ' + @tablename + ' Where field1 =''abcd''' exec (@sel) End Sunil GO
Jun 17, 2002 Thread starter #3 jonsey Programmer Jun 17, 2002 3 US i will try thank you Upvote 0 Downvote