Create initial data sqlscripts with binary data, sqlserver 2005
with a TFS 2008 Teambuildtype we create a ClickOnce Setup for a review version of our application. Within this Teambuildtype we create an initial database with some data to start directly with tests.
Now i need to put some binary data in our sql script insert files (Wordfiles).
How can i create a initial script with the binary data ? I can't put the binary string into a script or?
Thanks a lot
Edit: Found 开发者_开发问答a solution with OpenRowset
INSERT INTO TestTable (Doc) SELECT * FROM OPENROWSET(BULK N'C:\File.jpg', SINGLE_BLOB) as ImageToInsert
Looks like you already found a solution that works for you that just bumped this question but you can put binary data in a script.
Just use 0x....
to denote a binary data literal.
INSERT INTO TestTable(Doc)
VALUES (0x474946383961500...)
精彩评论