sqlserver拼接动态sql语句

@Sql VARCHAR(200)='SELECT * FROM dbo.user WITH(NOLOCK) WHERE 1=1 '
@Sql=@Sql+' AND UserName='''+@UserId+''''
EXECUTE(@Sql)

 

posted @ 2021-11-18 14:16  masha2017  阅读(858)  评论(0编辑  收藏  举报