Syntax To Insert Image Field

Syntax To Insert Image Field

Post by Brian Mora » Fri, 27 Jun 1997 04:00:00



From BOL...
You can use bcp to copy a file as image data into Microsoft SQL Server. For
example, to load the file TEST.DOC into a table named image run bcp as
follows:
bcp pubs..image in test.doc -Usa -P -Ssvr

Answer the prompts bcp presents as follows:
Enter the file storage type of field c1 [image]:
Enter the prefix length of field c1 [4]: 0
Enter length of field c1 [4096]: 5578
Enter the field terminator [none]:

In this example, 5578 is the length of the file. The file will be loaded
into column c1.

--
Brian Moran
Spectrum Technology Group NTP
MCSE, MCSD, MCT, SQL Server MVP
President: Capital Area SQL Server UG



Quote:> Would someone kindly post the correct syntax to insert an image field
> (image datatype) on MS SQL Server 6.5?  For example, suppose I have
> MyPic.jpg stored locally on the SQL Server, with a path of
> C:\Images\MyPic.jpg.  How would one insert that jpg file into an image
> field in an SQL Server table?

> Thanks in advance!

> Kelly

 
 
 

Syntax To Insert Image Field

Post by Kelly Row » Mon, 30 Jun 1997 04:00:00


Brian,

Is this the only way?  You cannot do it with a SQL Insert or Update
statement?

Kelly



Quote:> From BOL...
> You can use bcp to copy a file as image data into Microsoft SQL Server.
For
> example, to load the file TEST.DOC into a table named image run bcp as
> follows:
> bcp pubs..image in test.doc -Usa -P -Ssvr

> Answer the prompts bcp presents as follows:
> Enter the file storage type of field c1 [image]:
> Enter the prefix length of field c1 [4]: 0
> Enter length of field c1 [4096]: 5578
> Enter the field terminator [none]:

> In this example, 5578 is the length of the file. The file will be loaded
> into column c1.

> --
> Brian Moran
> Spectrum Technology Group NTP
> MCSE, MCSD, MCT, SQL Server MVP
> President: Capital Area SQL Server UG


 
 
 

1. Syntax To Insert Image Field

From BOL...
You can use bcp to copy a file as image data into Microsoft SQL Server. For
example, to load the file TEST.DOC into a table named image run bcp as
follows:
bcp pubs..image in test.doc -Usa -P -Ssvr

Answer the prompts bcp presents as follows:
Enter the file storage type of field c1 [image]:
Enter the prefix length of field c1 [4]: 0
Enter length of field c1 [4096]: 5578
Enter the field terminator [none]:

In this example, 5578 is the length of the file. The file will be loaded
into column c1.

--
Brian Moran
Spectrum Technology Group NTP
MCSE, MCSD, MCT, SQL Server MVP
President: Capital Area SQL Server UG



2. I can′t change network support a TCP/IP

3. Inserting images into Image Type Fields

4. Open Items (was: RE: [HACKERS] Beta going well)

5. insert images in a field "image"

6. Announcement: TESTING COMPUTER SOFTWARE (TCS2000) Conference

7. How to insert an image in image field

8. Interesting feature(?) in name scoping

9. images in image fields and field bloat

10. ODBC Access driver syntax error when inserting more than 5 fields

11. Syntax Error when adding a record using INSERT INTO (due to date field)

12. Inserting Word Document into Image field

13. Insert Word document into a image field