Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 A simpler question...

Author  Topic 

Galius_Persnickety
Starting Member

10 Posts

Posted - 2009-02-12 : 18:13:35
The Q I asked earlier is needlessly complex, so here's a simple version:
I'm using SQLXMLBulkLoad from a VBS to import an XML file into SQL 2005, which works just fine.
What I want to do is write the name of the XML file to the first column of each record. Can this be done in the Schema file I pass to SQLXMLBulkLoad, or do I need a separate subroutine for the extra column?

Gabe

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-13 : 02:32:46
No. Just do an update after the upload/insert.
All records having filename column value set to NULL are the ones recently imported.

UPDATE MyTable
SET FileName = 'werlkwerwelrwer'
WHERE FileName IS NULL



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

Galius_Persnickety
Starting Member

10 Posts

Posted - 2009-02-13 : 12:06:22
That makes sense.

I can verify there's no NULLs before import for safety's sake.

Thanks a million!

Gabe
Go to Top of Page
   

- Advertisement -