Groups | Blog | Home
all groups > sql server reporting services > november 2005 >

sql server reporting services : can the talbe name be a parameter of a query line?


Spirit
11/5/2005 5:29:04 AM
the tables are created by month, and the table names are like
wt01,wt02............
and the structure of tables are all the same,
can the talbe name be a parameter of a query line?
like select * from @TableName ?
if not, how to make it possible to query different tables by parameter?
Wayne Snyder
11/7/2005 3:41:02 AM
declare @tbl sysname
exec ('select * from ' + @tbl)

OR

="Select * from " & Parameters!Tablename.Value

either should work

--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC

I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.


[quoted text, click to view]
Spirit
11/15/2005 6:34:34 PM
but when I execute the code in the query Analysis,it reports 170 error
and there is some error near from...
Spirit
11/15/2005 8:50:57 PM
thank you for your help
it is ok now
AddThis Social Bookmark Button