Solved

Initialize a variable from a flat file record

Posted on 2007-03-23
5
179 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
  • 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

In this article I will describe the Backup & Restore 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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now