create proc GetArticle ( @string varchar(100) ) as exec('select top 10 * from article where 1=1 '+@string+'') 没有错误的。
create proc GetArticle ( @string varchar(100), ) as exec('select top 10 * from article where 1=1 '+@string)
exec('select top 10 * from article where 1=1 ' + @string)
create proc GetArticle ( @string varchar(100), ) as exec('select top 10 * from article where 1=1 '+@string+'') ') create proc GetArticle ( @string varchar(100), ) as declare @str nvarchar(1000) set @str='' set @str=' select top 10 * from article where 1=1 ' + @string exec (@str) ')
create proc GetArticle ( @string varchar(100), ) as declare @str nvarchar(1000) set @str='' set @str=' select top 10 * from article where 1=1 ' + @string --这句意义是?? exec (@str)
create proc GetArticle ( @string varchar(100), ) as set nocount on declare @str nvarchar(1000) set @str='' set @str=' select top 10 * from article where 1=1 ' + @string --这句意义是?? exec (@str) set nocount off
create proc GetArticle ( @string varchar(100), ) as set nocount on declare @str nvarchar(1000) set @str='' set @str=' select top 10 * from article where 1=1 ' + @string --这句意义是?? print @str -- 先print出来看看,估计是你@string里面有问题, --exec (@str) set nocount off
create proc GetArticle@string varchar(100)as exec('select top 10 * from article where 1=1 and '+@string+'')这样写没有语法错误。
(
@string varchar(100)
)
as
exec('select top 10 * from article where 1=1 '+@string+'')
没有错误的。
create proc GetArticle
(
@string varchar(100),
)
as
exec('select top 10 * from article where 1=1 '+@string)
(
@string varchar(100),
)
as
exec('select top 10 * from article where 1=1 '+@string+'')
')
create proc GetArticle
(
@string varchar(100),
)
as
declare @str nvarchar(1000)
set @str=''
set @str=' select top 10 * from article where 1=1 ' + @string
exec (@str)
')
create proc GetArticle
(
@string varchar(100),
)
as
declare @str nvarchar(1000)
set @str=''
set @str=' select top 10 * from article where 1=1 ' + @string --这句意义是??
exec (@str)
(
@string varchar(100),
)
as
set nocount on
declare @str nvarchar(1000)
set @str=''
set @str=' select top 10 * from article where 1=1 ' + @string --这句意义是??
exec (@str)
set nocount off
(
@string varchar(100),
)
as
set nocount on
declare @str nvarchar(1000)
set @str=''
set @str=' select top 10 * from article where 1=1 ' + @string --这句意义是??
print @str -- 先print出来看看,估计是你@string里面有问题,
--exec (@str)
set nocount off
exec('select top 10 * from article where 1=1 and '+@string+'')这样写没有语法错误。