DECLARE @SQLString
nvarchar(500);
DECLARE
@ParmDefinition nvarchar(500);
DECLARE
@CountSQLQuery varchar(30);
SET @SQLString =
N'SELECT @result = COUNT(*) FROM INFORMATION_SCHEMA.TABLES';
SET @ParmDefinition
= N'@result varchar(30) OUTPUT';
EXECUTE
sp_executesql @SQLString, @ParmDefinition, @result=@CountSQLQuery OUTPUT;
SELECT
CAST(@CountSQLQuery as int);
Nessun commento:
Posta un commento