Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-11-28
4
Medium Priority
?
217 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 750 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

618 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