sqlserver the name is not a valid identifier error in function

参考资料:https://stackoverflow.com/questions/22008859/the-name-is-not-a-valid-identifier-error-in-function

执行存储过程中sql字符串:

SET @Name = 'select UserName from [' + @dbName + '].dbo.Users where UserID=' + CONVERT(VARCHAR, @UserID)  
exec(@Name)

猜你喜欢

转载自www.cnblogs.com/dawenyang/p/11395966.html
今日推荐