Advertisement

05.10.2006 at 01:51PM PDT, ID: 21845843
[x]
Attachment Details

In a Stored Procedure, Select from a text or XML file

Asked by geekboysteves in MS SQL Server

Tags: select, from

I need to get a value from a plain, old text file into my stored procedure.  By "text" I mean a word, not like image or binary or blobs or text as in memo (msaccess term).

Like this:

Select aLineOfText as theColumnName
From 'C:\Temp\MyFile.txt'

This could be the contents of the file: "Hello World!"

So when you run it, you get:

TheColumnName
-------------------
Hello World!

1 row(s) affected.

Seems simple.  I must be missing something.

I thought OpenXML might do it, but it doesn't seem to read from files.  This is not part of a DTS package.

Thanks!

Start Free Trial
 
Loading Advertisement...
 
[+][-]05.10.2006 at 01:53PM PDT, ID: 16652768

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2006 at 07:06AM PDT, ID: 16658530

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.11.2006 at 08:15AM PDT, ID: 16659314

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2006 at 08:25AM PDT, ID: 16659412

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.11.2006 at 08:29AM PDT, ID: 16659452

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2006 at 08:40AM PDT, ID: 16659586

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.11.2006 at 10:16AM PDT, ID: 16660572

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2006 at 06:26AM PDT, ID: 16667384

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2006 at 06:28AM PDT, ID: 16667399

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: select, from
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.12.2006 at 11:29AM PDT, ID: 16669966

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32