?
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
?
216 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

771 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