November 23, 2009 at 6:07 am
Hi,
How to ALTER the varchar data type column into varbinary data type.
For ex, i have a column (fldColA) which has varchar data type. Now i need to ALTER the column's (fldColA) data type as varbinary. How can i change by using script not by using GUI.
November 23, 2009 at 7:39 am
ALTER TABLE <Table Name>
ALTER COLUMN <Column Name> <New type information>
See Books Online for full details. Look under ALTER TABLE
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 23, 2009 at 8:59 am
GilaMonster (11/23/2009)
ALTER TABLE <Table Name>
ALTER COLUMN <Column Name> <New type information>
See Books Online for full details. Look under ALTER TABLE
Thanks for your reply.
I think i believe,it will through an error as Implicit Conversion not possible .....
November 23, 2009 at 9:08 am
If it does, then create a new column with the varbinary type. Update it from the varchar with convert, then drop the varchar column and rename the varbinary.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply