Showing posts with label parse. Show all posts
Showing posts with label parse. Show all posts

Thursday, March 8, 2012

Assigning a particular flat file record to a string variable

Hey all!

Okay, can I assign line x of a flat file to a variable, parse that line, do my data transformations, and then move on to line x+1?

Any thoughts?

In other words, I'm looking at using a for loop to cycle through a flat file. I have the for loop set up, and the counter's iterating correctly. How do I point at a particular line in a flat file?

Thanks for any suggestions!

Jim Work
You could do this in the data flow using a script component to keep track of which row you are on....|||Phil, that sounds like a great plan. I am very, very, very new at this, though, and I could use a little more detail?

Going through a flat file line-by-line seems like it would be a very straightforward thing to me...
|||The data flow on its own operates on a row by row basis. That's what it's designed to do, and very fast, by the way.|||Oh, you're kidding me!

Thanks!!

assign variable to an XML query's result

Can I set output of an XML query to a variable (SQL Server 2000)? The
following query does not parse:
DECLARE @.Xml NTEXT
SET @.Xml = (SELECT D.*
FROM WSDMS..Documents D
WHERE D.ID = @.DocumentID
FOR XML AUTO)It's not possible for sql2k.
--
-oj
<bbla32@.op.pl> wrote in message
news:1172081331.938350.4510@.l53g2000cwa.googlegroups.com...
> Can I set output of an XML query to a variable (SQL Server 2000)? The
> following query does not parse:
> DECLARE @.Xml NTEXT
> SET @.Xml => (SELECT D.*
> FROM WSDMS..Documents D
> WHERE D.ID = @.DocumentID
> FOR XML AUTO)
>