USE Northwind
DECLARE @Count int
execute sp_executesql
N’select @Count = COUNT(*) from Northwind.dbo.Orders’,
N’@Count int OUT’, @Count OUT
SELECT @Count
DECLARE @Count int
execute sp_executesql
N’select @Count = COUNT(*) from Northwind.dbo.Orders’,
N’@Count int OUT’, @Count OUT
SELECT @Count