Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Images in sql server

Author  Topic 

saurav gautam
Starting Member

15 Posts

Posted - 2011-03-18 : 08:40:42
I made a program in vb.net that has sqlserver database in its back end. I have successfilly tested it over the internet as well. Now i want to store the images of the user in the same database creating a new table and retreive and show that image in network computers..is the storage of image files possible in sql server???? If yes then please tell me some methods

saurav123

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2011-03-18 : 10:45:50
Yes it is possible, but not recommended. Image files are large, unless you are talking icon files or something tiny. In the past I have created a table with columns to hold the path to the image, not the image itself.

So a table might look like:

tblImages
intImageID int IDENTITY(1,1),
txtImageName varchar(100),
txtImagePath varchar(500)

txtImageName would be "ProfilePic.jpg" or whatever the file name is and txtImagePath would be "/Images/Profiles" or wherever your images are stored on the webserver.

Hey, it compiles.
Go to Top of Page

saurav gautam
Starting Member

15 Posts

Posted - 2011-03-18 : 11:29:44
Thank You
I shall sure try your instructions.
Is it possible to give the path of an image over a local area network and show it on the image box???


quote:
Originally posted by ajthepoolman

Yes it is possible, but not recommended. Image files are large, unless you are talking icon files or something tiny. In the past I have created a table with columns to hold the path to the image, not the image itself.

So a table might look like:

tblImages
intImageID int IDENTITY(1,1),
txtImageName varchar(100),
txtImagePath varchar(500)

txtImageName would be "ProfilePic.jpg" or whatever the file name is and txtImagePath would be "/Images/Profiles" or wherever your images are stored on the webserver.

Hey, it compiles.



saurav123
Go to Top of Page

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2011-03-18 : 12:08:57
Should be. You might have to tweak security settings to grant permission but yes you should be able to pull down an image from another machine.

Hey, it compiles.
Go to Top of Page

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2011-03-19 : 10:41:31
if you are storing the image path into the database then what would happen if you change your machine or some one would delete the image...
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-03-19 : 14:45:30
If you are using SQL 2008, you should consider filestream storage. I have only read about it, not tried it myself - but this is an article by Paul Randal where, among other things, he compares filestream storage against other approaches:[url]http://msdn.microsoft.com/en-us/library/cc949109(v=sql.100).aspx[/url]
Go to Top of Page
   

- Advertisement -