Convert nvarchar to bigint in Sql server 2008

≡放荡痞女 提交于 2019-12-01 02:54:47

You could try to use ISNUMERIC to determine those rows that are indeed numeric:

UPDATE dbo.YourTable
SET BigIntColumn = CAST(NVarcharColumn AS BIGINT)
WHERE ISNUMERIC(NVarcharColumn) = 1

That would convert those rows that can be converted - the others need to be dealt with manually.

You should convert bigint to nvarchar not vice versa cast(Other_Column_name as nvarchar) not cast (Column_Name as bigint)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!