Hi guys,
I have a VBScript file which is running on a server, pulling XML from a URL and creating an XML file. This file then needs to be imported into a database and stored in an XML field. It's about 30MB in size.
Now, I created a stored proc to do the importing and it works fine when I test it from Management Studio 2005 but when I try to call it from my .vbs script it doesn't error but it also doesn't do anything!
I have a feeling it's maybe a permission thing? I'm not 100% sure though. Any help you can give would be fantastic.
Here are the code snippets:
VBS File
--------------------------------
strSQL = "exec up_insert_xmlfile '" & defaultDir & "','" & strXMLFile & "'"
MsgBox strSQL
Set dataConn = CreateObject("ADODB.Connection")
dataConn.Open strConnect
Set rsUpdate = dataConn.execute(strSQL)
Set rsUpdate = Nothing
dataConn.Close
Set dataConn = Nothing
Stored Procedure:
--------------------------------
EXEC('INSERT INTO dbo.xmlData(feedTypeID, xml_feed)
SELECT 4, xmlData
FROM(
SELECT *
FROM OPENROWSET (BULK ''' + @filePath + @fileName + ''' , SINGLE_BLOB) AS XMLDATA
) AS FileImport (XMLDATA)
')
I have a VBScript file which is running on a server, pulling XML from a URL and creating an XML file. This file then needs to be imported into a database and stored in an XML field. It's about 30MB in size.
Now, I created a stored proc to do the importing and it works fine when I test it from Management Studio 2005 but when I try to call it from my .vbs script it doesn't error but it also doesn't do anything!
I have a feeling it's maybe a permission thing? I'm not 100% sure though. Any help you can give would be fantastic.
Here are the code snippets:
VBS File
--------------------------------
strSQL = "exec up_insert_xmlfile '" & defaultDir & "','" & strXMLFile & "'"
MsgBox strSQL
Set dataConn = CreateObject("ADODB.Connection")
dataConn.Open strConnect
Set rsUpdate = dataConn.execute(strSQL)
Set rsUpdate = Nothing
dataConn.Close
Set dataConn = Nothing
Stored Procedure:
--------------------------------
EXEC('INSERT INTO dbo.xmlData(feedTypeID, xml_feed)
SELECT 4, xmlData
FROM(
SELECT *
FROM OPENROWSET (BULK ''' + @filePath + @fileName + ''' , SINGLE_BLOB) AS XMLDATA
) AS FileImport (XMLDATA)
')