I need to download some data to MSSQL table. So:
INSERT INTO [Project].[dbo].[table1]
([version],
[date],
[xsd])
VALUES ('3.3.3.3',
'20140520',
(SELECT *
FROM OPENROWSET(BULK N'D:\File.XSD', single_clob) AS XSD))
go
As result at table inserts some file. it looks like: 0xDEFFFBF6C8F1...........46
So, now i copy this value to my script:
if exists (select Version from Table1 where Version ='3.3.3.3') update Table1 set [Xsd]=0xDEFFFBF6C8F1........... where Version ='3.3.3.3'
else insert into Table1 ([Version],[Xsd]) values ('3.3.3.3',0xDEFFFBF6C8F1...........
When it execute- i get value like that: 0x0DeFFF....4 .
I copy value to script correctly.. but cannot understand why last character disappears and i get zero at value.
Please, help me with that problem.
P.S. CREATE TABLE .... [Xsd] [image] NULL
P.P.S - so, i found some new things:
When i count lenght of downloaded string(from file)- it counts over 99k symbols. Then i copy and past it on script at Microsoft Management Studio - (if exists ...) - so, i get 32k symbols.
I dont know, that happens...