Insert the Binary Image in Sqlserver 2005

  • Hai to all;

    I need to insert the binary images in sqlserver 2005 the images are stored in local harddisk;

    the tbl name like studentphotos;

    How to insert the data throw by sqlquery pls any one go help me;

    Thanks;

    Faijurrahuman.A

  • what have you tried so far? because this is your first post and your example has the word "student" in it, we want to make sure you learn the concepts, rather than get us to show you how to do a homework assignment.

    you would learn nothing and hurt yourself when you are asked/quizzed on the subject again.

    I'll give you a hint, and real world advice:

    the hint is this is possible from TSQL, one image at a time, using a technique involving OPENROWSET; you can run into problems security wwise if the images are not on the SQL server's local harddrives.

    if you really need to do this to a lot of images, TSQL is the wrong tool; you can do all the images in a directory with a programming language much easier; a connection, a streamobject and you could upload them all much more efficiently in say .NET.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Although you mention SQL Server 2005, since you're posting this in the SQL Server 2008 forum, you might want to consider looking at using the FileStream data type and then you can store the file on the file system where it belongs and simply maintain a pointer to it but with an integrity check in the database.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply