Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 converting varchar column to varbinary

Author  Topic 

ujjaval
Posting Yak Master

108 Posts

Posted - 2007-05-06 : 20:14:50
Hi

I want to convert a nvarchar column to varbinary. But it does not allow me saying that implicit conversion is not allowed from nvarchar to varbinary. How should I go for this?

Thanks,
Ujjaval

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-05-06 : 22:15:31
Tried with convert function?
Go to Top of Page

ujjaval
Posting Yak Master

108 Posts

Posted - 2007-05-06 : 22:18:20
can i use convert function in alter table statement? how?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-05-06 : 22:32:10
No, should use 'alter table ... alter column ...' to change column data type. It's different from converting data.
Go to Top of Page

jshepler
Yak Posting Veteran

60 Posts

Posted - 2007-05-07 : 22:28:22
How about adding a new column of type varbinary and allow NULLs, updating the table to set the new column = convert old column, remove old column, rename new column to be old column.


/jeff
Go to Top of Page
   

- Advertisement -