- SQL code
CREATE TABLE [dbo].[TT]( [autoid] [int] IDENTITY(1,1) NOT NULL, [photo] [varbinary](max) NULL);CREATE PROC InsertBigFiles@path nvarchar(50)ASINSERT TT(photo) SELECT photo FROM OPENROWSET(BULK @path,SINGLE_BLOB) AS TT(photo);[email protected]--换成下面的就没有问题,为什么呢 INSERT TT(photo) SELECT photo FROM OPENROWSET(BULK 'c:\r.mpeg',SINGLE_BLOB) AS TT(photo);
------解决方案--------------------
试试
- SQL code
CREATE TABLE [dbo].[TT]( [autoid] [int] IDENTITY(1,1) NOT NULL, [photo] [varbinary](max) NULL);goCREATE PROC InsertBigFiles@path nvarchar(50)AS exec ('INSERT TT(photo) SELECT photo FROM OPENROWSET(BULK [email protected]+',SINGLE_BLOB) AS TT(photo)');go
------解决方案--------------------
- SQL code
CREATE TABLE [dbo].[TT]( [autoid] [int] IDENTITY(1,1) NOT NULL, [photo] [varbinary](max) NULL);goCREATE PROC InsertBigFiles@path nvarchar(50)AS exec ('INSERT TT(photo) SELECT photo FROM OPENROWSET(BULK [email protected]+''',SINGLE_BLOB) AS TT(photo)');go