Wednesday, March 21, 2012

Image Date Types

Hi,
Can any one tell me how to change an existing
Image column in a table to binary type. I am looking at
the T-SQL .
Thanks and Regards,
SajeevCREATE TABLE Tmp_myImageTable ( imagefield binary(1000) )
GO
EXEC ('INSERT INTO Tmp_testimage (im)
SELECT CONVERT(binary(1000), imagefield) FROM myImageTable ')
GO
DROP TABLE myImageTable
GO
EXECUTE sp_rename N'Tmp_myImageTable', N'myImagetable', 'OBJECT'
GO
Nathan H.O.

No comments:

Post a Comment