Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
lengochao
Starting Member
1 Post |
Posted - 2005-03-12 : 00:19:31
|
| I'm facing a problem that makes me so sadI want create a storedprocedure that access all fields of the table i supply name of the table like that Create Procedure select_Table(@Table_Name text) As Select * From @Table_NameBut it doesn't work and i think that only work when you supply a specific name of the table like that "Person" Create Procedure select_Table As Select * From PersonIf what i think is corect ,i really have to create a lot storedprocedure that access all fields of many tableI you have some experiences about that,please show me.Thanks alot |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-03-12 : 00:56:16
|
| [code]CREATE PROCEDURE select_Table @Table_Name sysname ASDECLARE @strSQL varchar(8000)SELECT @strSQL = 'SELECT * FROM ' + @Table_NameEXEC (@strSQL)[/code]But I doubt this approach is a good idea ...Kristen |
 |
|
|
|
|
|