Solved

Initialize a variable from a flat file record

Posted on 2007-03-23
5
223 Views
Last Modified: 2010-03-19
I wonder what ways are available to read a flat file and initialize a variable without using BULK INSERT or any DB Table in the process?
0
Comment
Question by:phermi
[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
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:ripahoratiu
ID: 18791711
1. xp_sscanf
2. xp_cmdshell
0
 

Author Comment

by:phermi
ID: 18792098
thanks ripahoratiu.

We were having some permissions issues to execute the cmdshell from the web application and we discarded it.

Thanks for your reply.
0
 

Author Comment

by:phermi
ID: 18792124
ripahoratiu.

What I need is to OPEN the file, read its only 1 record and initialize a variable with the record contents.

thanks again
0
 
LVL 9

Accepted Solution

by:
ripahoratiu earned 500 total points
ID: 18792152
... ummm I think that xp_sscanf is wrong.
But you can do a little .exe where you can open the file read the record and pass it through (write it to console). Than you can use xp_cmdshell

Check this out
http://msdn2.microsoft.com/en-us/library/ms175046.aspx

0
 

Author Comment

by:phermi
ID: 18792249
thanks again ... I think we are going to stick with the BULK INSERT tinto a # table. As I said, we got permissions issues using cmdshell and being a web app, all users and even simultaneous one, must have access to the file contents.


thanks
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

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…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

734 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