Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drop Temp Table
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
01429007
Message ID:
01429010
Vues:
40
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
>
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform