众多select
/1
select * from tab_students
go
/2
exec ('select * from tab_students') -执行sql语句
go
/3
exec proc_text -执行不带差数的存储过程
go
/4
exec sp_executesql N'select * from tab_students'
go
/5
declare @var1 varchar(500)
set @var1='select * from tab_students'
exec(@var1)
go
/6
declare @var2 nvarchar(500)
set @var2='select * from tab_students'
exec(@var2)
go
/7
//@var3 为 nchar/nvarchar 类型。
declare @var3 nchar(500)
set @var3='select * from tab_students'
exec sp_executesql @var3
go
/8
declare @var3 nvarchar(500)
set @var3='select * from tab_students'
exec sp_executesql @var3
go
select * from tab_students
go
/2
exec ('select * from tab_students') -执行sql语句
go
/3
exec proc_text -执行不带差数的存储过程
go
/4
exec sp_executesql N'select * from tab_students'
go
/5
declare @var1 varchar(500)
set @var1='select * from tab_students'
exec(@var1)
go
/6
declare @var2 nvarchar(500)
set @var2='select * from tab_students'
exec(@var2)
go
/7
//@var3 为 nchar/nvarchar 类型。
declare @var3 nchar(500)
set @var3='select * from tab_students'
exec sp_executesql @var3
go
/8
declare @var3 nvarchar(500)
set @var3='select * from tab_students'
exec sp_executesql @var3
go
作者:青羽