Animartis
2008-04-09 15:59:18 UTC
Hello all,
I need a tad bit of assistance and am a newb so please take that into
consideration.
I am using ASP to query the folder contents on our Information Server
and want to write the filenames to a table, but only if they do not
exist. Here is the ASP page.
Set MyDirectory=Server.CreateObject("Scripting.FileSystemObject")
Set MyFiles=MyDirectory.GetFolder(Server.MapPath("\flashWork\instVids
\vids"))
Set oSQLConn = Server.CreateObject("ADODB.Connection")
oSQLConn.Open("Driver={SQL
Server};Server=xxxx;Database=xxx;Uid=xxx;Pwd=xxx")
For each filefound in MyFiles.files
sSQL = "sp_addVid '"
sSQL = sSQL + filefound.Name & "'"
'response.write sSQL & "<br>"
oSQLConn.Execute(sSQL)
Next
oSQLConn.close
Set oSQLConn = Nothing
The Stored Procedure is as follows:
CREATE PROCEDURE sp_addVid
(
@vidName varchar(50)
)
AS
BEGIN TRAN
INSERT tbl_vidNames(vidName)
select (@vidName)
where
not exists (select * from tbl_vidNames where vidName = @vidName)
COMMIT TRAN
GO
So here is the problem. This Stored Procedure works fine when i run
it singularly in Query Analyzer, but gives me a timeout error on the
asp page.
Any ideas would be greatly appreciated.
Thanks!
I need a tad bit of assistance and am a newb so please take that into
consideration.
I am using ASP to query the folder contents on our Information Server
and want to write the filenames to a table, but only if they do not
exist. Here is the ASP page.
Set MyDirectory=Server.CreateObject("Scripting.FileSystemObject")
Set MyFiles=MyDirectory.GetFolder(Server.MapPath("\flashWork\instVids
\vids"))
Set oSQLConn = Server.CreateObject("ADODB.Connection")
oSQLConn.Open("Driver={SQL
Server};Server=xxxx;Database=xxx;Uid=xxx;Pwd=xxx")
For each filefound in MyFiles.files
sSQL = "sp_addVid '"
sSQL = sSQL + filefound.Name & "'"
'response.write sSQL & "<br>"
oSQLConn.Execute(sSQL)
Next
oSQLConn.close
Set oSQLConn = Nothing
The Stored Procedure is as follows:
CREATE PROCEDURE sp_addVid
(
@vidName varchar(50)
)
AS
BEGIN TRAN
INSERT tbl_vidNames(vidName)
select (@vidName)
where
not exists (select * from tbl_vidNames where vidName = @vidName)
COMMIT TRAN
GO
So here is the problem. This Stored Procedure works fine when i run
it singularly in Query Analyzer, but gives me a timeout error on the
asp page.
Any ideas would be greatly appreciated.
Thanks!