Inserting a Binary file in SQL Server 2000
I want to store a native binary file into the DB having the column datatype as 'image', in SQL Server 2000, through SQL Query.
I have found the solution for the case of 2005, thet is using the OPENROWSET and BULK. The solution as follows.
CREATE TABLE [dbo].[temp](
[name] [nchar](10) NULL,
[blob] [image] NULL
)
INSERT INTO TEMP(ID,NAME, BDATA)
SELECT 3, 'jmaniac',* 开发者_如何学JAVA
FROM OPENROWSET(BULK 'D:\J.JPG',SINGLE_BLOB) RA
P.S: Alias is must in the end.
Can you please help me out in constructing the SQL or TSQL Query for performing that operation?
Thanks a Bunch in Advance :)
It would have been helpful if you posted the full solution you found for SQL Server 2005.
You won't be able to use OPENROWSET
for SQL 2000.
Details on how to import a File in to a Image column can be found here
精彩评论