Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drop Temp Table
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
01429007
Message ID:
01429011
Views:
36
Thanks. My memory isn't what it used to be I guess.


>This was the long thread on this topic Function To Test For Table Doesn't Work Thread #1328338
>
>>Why doesn't this work for temp tables?
>>
>>
>>USE rbp_test
>>GO
>>
>>--DROP PROCEDURE sp_DropTable
>>
>>GO
>>
>>CREATE PROCEDURE sp_DropTable
>>	@TableName		VARCHAR(50)
>>AS
>>
>>
>>	IF EXISTS 
>>		(SELECT 1 
>>			FROM INFORMATION_SCHEMA.TABLES 
>>			WHERE TABLE_TYPE='BASE TABLE' AND 
>>				  TABLE_NAME = @TableName) 
>>		
>>		BEGIN
>>		
>>			DECLARE @Command VARCHAR(100)
>>			SET @Command = 'DROP TABLE ' + @TableName
>>		
>>			EXECUTE (@Command);
>>		END
>>
>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Reply
Map
View

Click here to load this message in the networking platform