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:
Drop Temp Table
Miscellaneous
Thread ID:
01429007
Message ID:
01429007
Views:
122
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
Next
Reply
Map
View

Click here to load this message in the networking platform