sqlserver拼接动态sql语句
@Sql VARCHAR(200)='SELECT * FROM dbo.user WITH(NOLOCK) WHERE 1=1 ' @Sql=@Sql+' AND UserName='''+@UserId+''''
EXECUTE(@Sql)
@Sql VARCHAR(200)='SELECT * FROM dbo.user WITH(NOLOCK) WHERE 1=1 ' @Sql=@Sql+' AND UserName='''+@UserId+''''
EXECUTE(@Sql)