Posted by Erland Sommarskog on 05/10/07 22:23
M6C (roca.david@gmail.com) writes:
> I'm trying to import a Xml file in a table.
> It's working find, but when the data are inserted, my trigger on this
> table doesn't work ?
>...
> Vbs file:
> Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
> objBL.ConnectionString = "provider=SQLOLEDB.1;data
> source=*****;database=*****;uid=*****;pwd=*****"
> objBL.ErrorLogFile = "C:\Temp\error.xml"
> objBL.SchemaGen = True
> objBL.CheckConstraints = True
> objBL.KeepIdentity = False
> objBL.BulkLoad = true
> objBL.Execute "C:\Temp\9219142_MAPPING.xsd", "C:\Temp\9219142.xml"
> Set objBL = Nothing
By default triggers don't fire when you bulk load. At least not regular
bulk load. I don't know if XML bulk load is any different. Regular
bulk load has an option to fire triggers. You may want to explorer
whether XML bulk load offers this too.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|