Solved

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

Posted on 2007-11-28
4
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

726 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