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 |
|
kaus
Posting Yak Master
179 Posts |
Posted - 2002-07-30 : 12:47:11
|
| I've got a stored procedure:CREATE PROCEDURE sp_spell_check--@strManName as varchar(6),@strMonth_ID as varchar(5),@strMan_ID as varchar(5)AS-- ACCOMPLISHMENTSIF EXISTS( SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'spell_check' AND table_schema = 'GM') BEGIN drop table [spell_check] END ... etcIs there any way I can use a variable for the table name without dynamic sql or exec(sql)?? I have a lot of other stuff to do with this table later in the procedure and it would be a huge dynamic sqlAny ideas greatly appreciatedThanksPete |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-07-30 : 13:03:34
|
The only other way would be ...declare @tablename varchar(256)set @tablename = 'not_spell_check'if @tablename = 'spell_check' drop table spell_check Jay White{0} |
 |
|
|
kaus
Posting Yak Master
179 Posts |
Posted - 2002-07-30 : 13:47:52
|
| Thanks - I think I found another way around the problemPete |
 |
|
|
|
|
|