"conversion failed when converting the nvarchar value to data type int"
--
主要是看到下面這個網址解掉的:
http://social.msdn.microsoft.com/Forums/en/transactsql/thread/45cc4cab-21c7-4062-b4d9-cb2c37dc922d
"There is an error at:
FETCH NEXT
FROM @testvalue INTO @testid
As It try to Assingn varchar value to INT variable.
You need to declare @test_id as VARCHAR, so it can get Varchar values."
看了之後回去找自己的宣告是不是有相同的問題
發現原本的宣告是 DECLARE @DATA_CNT AS INT
改成 DECLARE @DATA_CNT AS NVARCHAR(10)
就解決了~~(灑花
--
以下額外參考:
http://stackoverflow.com/questions/6034441/dynamic-sql-error-converting-nvarchar-to-int
沒有留言:
張貼留言