众多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
posted @ 2006-11-07 14:35  青羽  阅读(450)  评论(1编辑  收藏  举报