Problems with xml bulkload
  Home FAQ Contact Sign in
microsoft.public.sqlserver.xml only
 
Advanced search
POPULAR GROUPS

more...

microsoft.public.sqlserver.xml Profile…
 Up
Problems with xml bulkload         


Author: jojo123
Date: Jul 7, 2008 05:16

Hi

I have the vbscript below in my dts package and xml schema, where I specify
which sql table field the data would go into - whilst I don't get any errors
- there's no data going into the table - it's completely empty - any ideas?
I'm trying to load the data into a single table

VB Script :

Function Main()
Set objBulkLoad =
CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.3.0")
objBulkLoad.ConnectionString = "provider=SQLOLEDB;data
source=localhost;database=myproj; integrated security=SSPI"
objBulkLoad.ErrorLogFile = "c:\error.log"
objBulkLoad.Execute "c:\EAF1NL.xsd", "c:\EAF1NL.xml"
Set objBulkLoad = Nothing
Main = DTSTaskExecResult_Success
End Function

schema
----------

http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
Show full article (15.96Kb)
7 Comments
RE: Problems with xml bulkload         


Author: Bob
Date: Jul 7, 2008 07:45

Hard to tell from that. Have you been able to get the code to run just as
VBScript, outside DTS? I'd start there.

If it does run successfuly, you may need to look at what service account DTS
runs under and what permissions it has.

A _small_ amount of sample data and target table DDL might help too ... if
you're really stuck.

"jojo123" wrote:
> Hi
>
> I have the vbscript below in my dts package and xml schema, where I specify
> which sql table field the data would go into - whilst I don't get any errors
> - there's no data going into the...
Show full article (12.54Kb)
no comments
RE: Problems with xml bulkload         


Author: jojo123
Date: Jul 7, 2008 08:55

Thanks for the reply - I run the script outside the dts and it runs - no
errors but again no data goes into the table

sample data (xml) is below:



1.1
EAF1NL20080708.xml
20080708 14:07:59
1 ...
Show full article (14.33Kb)
no comments
RE: Problems with xml bulkload         


Author: Bob
Date: Jul 7, 2008 09:08

Hang on a sec. You do know you have to Call the function in VBScript to get
it to work? eg sample .vbs file:

Call Main()

Function Main()

MsgBox( "test" )

End Function

"jojo123" wrote:
> Thanks for the reply - I run the script outside the dts and it runs - no
> errors but again no data goes into the table
>
> sample data (xml) is below:
>
> ...
Show full article (12.14Kb)
no comments
RE: Problems with xml bulkload         


Author: jojo123
Date: Jul 7, 2008 09:18

Additional info - the db table it goes into

CREATE TABLE DailyFileRecords(
FN varchar(40),
DATE datetime,
FTYPE int,
IIN varchar(10),
CRN varchar(10),
LUHN varchar(10),
LICENSEE_FORENAME varchar(21),
LICENSEE_SURNAME varchar(21),...
Show full article (13.15Kb)
no comments
RE: Problems with xml bulkload         


Author: Bob
Date: Jul 7, 2008 19:21

OK,

finally got this to work by:
1) removing the xmlns attribute in the NL element. So I had:



instead of



2) Changed the date format in the DATE element to:

2008/07/08 14:07:59

Man that was painful!

"jojo123" wrote:
> Additional info - the db table it goes into
>
> CREATE TABLE DailyFileRecords(
> FN varchar(40),
> DATE datetime,
> FTYPE int,
> IIN varchar(10),
> CRN varchar(10),
> LUHN varchar(10...
Show full article (11.17Kb)
no comments
RE: Problems with xml bulkload         


Author: jojo123
Date: Jul 8, 2008 03:46

Thanks for that -

I've made the changes below - but I get an error data mapping to column
'IIN' was already found in the data. Map sure no two schema definitions map
to the same column? Abit baffled

Thanks

"Bob" wrote:
> OK,
>
> finally got this to work by:
> 1) removing the xmlns attribute in the NL element. So I had:
>
>
>
> instead of
>
>
>
> 2) Changed the date format in the DATE...
Show full article (11.07Kb)
no comments
RE: Problems with xml bulkload         


Author: jojo123
Date: Jul 8, 2008 04:51

If I try to upload data with one record and it works - if I try to add more
than one record I get the message below:

"jojo123" wrote:
> Thanks for that -
>
> I've made the changes below - but I get an error data mapping to column
> 'IIN' was already found in the data. Map sure no two schema definitions map
> to the same column? Abit...
Show full article (11.33Kb)
no comments