Convert nvarchar to bigint in Sql server 2008 -


i want insert rows of table table, , want convert nvarchar field bigint, when use convert(bigint, col1) sql server shows error:

error converting data type nvarchar bigint

how can fix problem?

you try use isnumeric determine rows indeed numeric:

update dbo.yourtable set bigintcolumn = cast(nvarcharcolumn bigint) isnumeric(nvarcharcolumn) = 1 

that convert rows can converted - others need dealt manually.


Comments