Solved

How do I get a path and file name into a MS SQL Server DB field?

Posted on 2007-11-28
4
211 Views
Last Modified: 2008-07-28
I want to add the path and file name of PDF files to a SQL DB record.  The file will be available for viewing when the record is looked up.  I don't need the file itself in the database, just the path to the file and the filename.  I just need some sample scripts on how to get the path and file name and apply that info into the database field called PathFile.  The database name, if it matters, is Donors.

How do I get path and file name into a MS SQL Server DB field?

If you can't tell I am a complete novice at this.  Keep it basic if you can.

Thanks in advance for you assistance.
0
Comment
Question by:lasthope
4 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 20370857
It should be the front end code, which need to send the file path to the DB
0
 
LVL 17

Expert Comment

by:pssandhu
ID: 20371040
What are you using? Are you using an application? When and where do you need to pick the file path from? We need some detail background on all the tools that you are working with and need to know where to start from and where to end.

P.
0
 
LVL 18

Accepted Solution

by:
Yveau earned 250 total points
ID: 20372494
Just a varchar() field will do to store it. Make sure it is long enough for the longest path you expect to be in there.
As Aneesh said, you should feed it to the database from the client app. There is a way to look into the filesystem from SQL Server (xp_cmdshell) but that is really not advised due to security risks ! ... and then again if you start looking on the SQL Server filesystem, you should already know the path ... and the .pdf is probably not stored on the SQL Server ...

Hope this helps ...
0
 

Author Comment

by:lasthope
ID: 20377977
Great questions.  Sorry about leaving everyone quessing too much right now.  I'll get some more information and get back to you.

Thanks!
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now