Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Dynamic Sql command with output variable
select * FROM pilots ----- DECLARE @sqlCommand nvarchar(1000) DECLARE @id int declare @counts int SET @id = '2' SET @sqlCommand = 'SELECT @cnt=COUNT(*) FROM pilots WHERE id = @id' EXECUTE sp_executesql @sqlCommand, N'@id int,@cnt int OUTPUT', @id = @id, @cnt=@counts OUTPUT select @counts as Counts
run
|
edit
|
history
|
help
0
table emp
№1
Usage of joins
Emp Table
CTE Recursive sample
Dynamic substring in SQL
BC3TOSQL
New
Query through an error in Sql Server
Workers information