OPENROWSET(BULK 'C:\ER.vdx',SINGLE_BLOB) : OPENROWSET « Data Types « SQL Server / T-SQL Tutorial






18> CREATE TABLE dbo.VisioDocs
19> (
20>   id  INT NOT NULL,
21>   doc XML NOT NULL
22> );
23> GO
1>
2> INSERT INTO dbo.VisioDocs (id, doc)
3>   SELECT 1, *
4>   FROM OPENROWSET(BULK 'C:\ORM.vdx',
5>     SINGLE_BLOB) AS x;
6>  INSERT INTO dbo.VisioDocs (id, doc)
7>   SELECT 2, *
8>   FROM OPENROWSET(BULK 'C:\ER.vdx',
9>     SINGLE_BLOB) AS x;
10>  INSERT INTO dbo.VisioDocs (id, doc)
11>   SELECT 3, *
12>   FROM OPENROWSET(BULK 'C:\UML.vdx',
13>     SINGLE_BLOB) AS x;
14>  INSERT INTO dbo.VisioDocs (id, doc)
15>   SELECT 4, *
16>   FROM OPENROWSET(BULK 'C:\ER.vdx',
17>     SINGLE_BLOB) AS x;
18> GO
Msg 4860, Level 16, State 1, Server J\SQLEXPRESS, Line 2
Cannot bulk load. The file "C:\ORM.vdx" does not exist.
1>
2> SELECT id, doc FROM dbo.VisioDocs;
3> GO
id          doc

----------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------
1>
2>
3> drop table VisioDocs;
4> GO
1>








5.18.OPENROWSET
5.18.1.Inserting or Updating an Image File Using OPENROWSET and BULK
5.18.2.OPENROWSET(BULK 'C:\ER.vdx',SINGLE_BLOB)