Professional Web Applications Themes

How to store Images in SQL Table - Microsoft SQL / MS SQL Server

Define a column as image and just send the data to the image to this column as normal, usually as a byte array. See also the thread 'Why should I not stored images in SQL?' and search this ng for other messages as this is a fairly common question. -- Michael Culley "Ahmed Jewahar" <ajewaharsa.dhl.com> wrote in message news:uY13B2kPDHA.2700tk2msftngp13.phx.gbl... > > Hi, > > Could you please let me know as how can I store IMAGES (.gif, .bmp or > XLS) files into a SQL table. I have some scanned images of our > employees which I need to store ...

  1. #1

    Default Re: How to store Images in SQL Table

    Define a column as image and just send the data to the image to this column
    as normal, usually as a byte array.

    See also the thread 'Why should I not stored images in SQL?' and search this
    ng for other messages as this is a fairly common question.

    --
    Michael Culley


    "Ahmed Jewahar" <ajewaharsa.dhl.com> wrote in message
    news:uY13B2kPDHA.2700tk2msftngp13.phx.gbl...
    >
    > Hi,
    >
    > Could you please let me know as how can I store IMAGES (.gif, .bmp or
    > XLS) files into a SQL table. I have some scanned images of our
    > employees which I need to store in table. How can I achieve ?
    >
    > Appreciate all of your helps.
    >
    > Many thanks in advance..
    >
    > Best regards,
    >
    > Ahmed
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Michael Culley Guest

  2. #2

    Default Re: How to store Images in SQL Table

    Thanks for your help..

    Could you please show me sample code to see how to apply "insert"
    statement to update images into a table !

    Regards,

    Ahmed



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Ahmed Jewahar Guest

  3. #3

    Default Re: How to store Images in SQL Table

    Dinesh,

    Thanks for your update.

    But, how can I do the following using T-SQL from Query yser. Below
    examples is from DOS prompt..isnt't it?

    --now insert the real image using textcopy
    c:\>textcopy /S <servername> /D <databasename> /T picturetable /C piccol
    /W
    "WHERE picid = 1" /F c:\images\glag.jpg /U sa /P /I

    appreciate your help..

    Rgds- Ahmed





    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Ahmed Jewahar Guest

  4. #4

    Default Re: How to store Images in SQL Table

    Ahmed,

    You can use master..xp_cmdshell .A untested sample..

    CREATE PROCEDURE spStoreImagesAS

    DECLARE str varchar(4096)

    SELECT str = 'textcopy /S <servername> /D <databasename> /T picturetable /C
    piccol
    /W "WHERE picid = 1" /F c:\images\glag.jpg /U sa /P /I'

    EXEC master..xp_cmdshell str



    --
    Dinesh.
    SQL Server FAQ at
    [url]http://www.tkdinesh.com[/url]

    "Ahmed Jewahar" <ajewaharsa.dhl.com> wrote in message
    news:epNNmQ%23PDHA.1216TK2MSFTNGP11.phx.gbl...
    > Dinesh,
    >
    > Thanks for your update.
    >
    > But, how can I do the following using T-SQL from Query yser. Below
    > examples is from DOS prompt..isnt't it?
    >
    > --now insert the real image using textcopy
    > c:\>textcopy /S <servername> /D <databasename> /T picturetable /C piccol
    > /W
    > "WHERE picid = 1" /F c:\images\glag.jpg /U sa /P /I
    >
    > appreciate your help..
    >
    > Rgds- Ahmed
    >
    >
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Dinesh.T.K Guest

  5. #5

    Default Re: How to store Images in SQL Table

    Michael,

    The language is SQL !. Is there any other lanaguage that can be used in
    SQL Server for doing database updates.

    Ahmed



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Ahmed Jewahar Guest

  6. #6

    Default Re: How to store Images in SQL Table

    Yes, many languages connect to sql server, power builder, delphi, vb. Surely
    your not just using sql on it's own and surely you knew what I meant and are
    just being obtuse. :-)

    --
    Michael Culley


    "Ahmed Jewahar" <ajewaharsa.dhl.com> wrote in message
    news:#EEKycFQDHA.2700tk2msftngp13.phx.gbl...
    > Michael,
    >
    > The language is SQL !. Is there any other lanaguage that can be used in
    > SQL Server for doing database updates.
    >
    > Ahmed
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Michael Culley Guest

Similar Threads

  1. store/retrieve images to server
    By Suren_kancherla in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: April 11th, 07:02 AM
  2. Showing Images in Table
    By InkFasT! in forum Coldfusion - Getting Started
    Replies: 3
    Last Post: June 23rd, 05:20 PM
  3. Efficiently store an internal lookup table?
    By GaryDJ in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 20th, 11:27 PM
  4. How do I store values in table cells
    By Larry Woods in forum ASP
    Replies: 3
    Last Post: September 20th, 06:25 PM
  5. How to create table by store procedure in Oracle9i
    By SouthVN in forum Oracle Server
    Replies: 2
    Last Post: July 8th, 12:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139