all groups > sql server programming > march 2005 >
You're in the

sql server programming

group:

sp_executedsql and @@NETSLEVEL


RE: sp_executedsql and @@NETSLEVEL Alejandro Mesa
3/23/2005 12:51:11 PM
sql server programming:
It seems that sp_executesql call another procedure to execute the batch, so
'select @@nestlevel' is being executed by the second one.

Example:

exec('select @@nestlevel')
execute sp_executesql N'select @@nestlevel'
go

AMB

[quoted text, click to view]
sp_executedsql and @@NETSLEVEL Jean-Nicolas BERGER
3/23/2005 9:17:56 PM
Could someone explain me the second answer of this query :

select @@nestlevel
go
sp_executesql N'select @@nestlevel'
go


-----------
0


-----------
2


I expected 0 and 1 ...

Thx.
JN.

AddThis Social Bookmark Button