December 21, 2008 at 11:01 pm
Hi All,
I have to execute multiple Sql Files. To do this, I created a FOR EACH loop container to get file names from a folder and then passed them in a variable to an Execute SQL Task....I am getting an error
Executing the query "D:\WFX_BASE_DB_5.1.1\Stored Procedures\XspAutoCloseOrder.sql" failed with the following error: "Incorrect syntax near 'D:'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
[\code]
Regards,
[font="Verdana"]Sqlfrenzy[/font]
December 22, 2008 at 4:18 pm
Um.... I don't know much about IIS, but I'm pretty sure that you're going to have to make a trip to OSQL via a command shell call.
The best thing to do would be to turn all those loose scripts into stored procedures and then use your execute SQL task thingy.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 22, 2008 at 9:55 pm
Jeff Moden (12/22/2008)
Um.... I don't know much about IIS, but I'm pretty sure that you're going to have to make a trip to OSQL via a command shell call.The best thing to do would be to turn all those loose scripts into stored procedures and then use your execute SQL task thingy.
Those scripts are stored procedures to deployed on client server. Currently I am using a for loop in dos prompt to iterate thru a folder and execute all sql files...but It doesn't executes the scripts in the order they are kept in folder...though the need is to execute them in order ....
Regards,
[font="Verdana"]Sqlfrenzy[/font]
December 22, 2008 at 11:32 pm
Maybe you could create a single file containing all the SQL first:
If Exist All_Files.sql Del All_Files.sql
Copy *.sql All_Files.sql /y
and then just execute All_Files.sql to save iterating round - not sure about the order in which the files will be appended though.
Phil
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
December 23, 2008 at 6:02 pm
Ahmad Osama (12/22/2008)
Jeff Moden (12/22/2008)
Um.... I don't know much about IIS, but I'm pretty sure that you're going to have to make a trip to OSQL via a command shell call.The best thing to do would be to turn all those loose scripts into stored procedures and then use your execute SQL task thingy.
Those scripts are stored procedures to deployed on client server. Currently I am using a for loop in dos prompt to iterate thru a folder and execute all sql files...but It doesn't executes the scripts in the order they are kept in folder...though the need is to execute them in order ....
And, what order might that be? Order by name, date, extension, 8.3 name, or ???
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 7:06 pm
And, what order might that be? Order by name, date, extension, 8.3 name, or ???
haha, I was wondering the same and was hoping to draw out the answer gently, whereas you went straight for the throat 🙂
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
December 23, 2008 at 9:54 pm
Jeff Moden (12/23/2008)
Ahmad Osama (12/22/2008)
Jeff Moden (12/22/2008)
Um.... I don't know much about IIS, but I'm pretty sure that you're going to have to make a trip to OSQL via a command shell call.The best thing to do would be to turn all those loose scripts into stored procedures and then use your execute SQL task thingy.
Those scripts are stored procedures to deployed on client server. Currently I am using a for loop in dos prompt to iterate thru a folder and execute all sql files...but It doesn't executes the scripts in the order they are kept in folder...though the need is to execute them in order ....
And, what order might that be? Order by name, date, extension, 8.3 name, or ???
order by date....
Regards,
[font="Verdana"]Sqlfrenzy[/font]
December 24, 2008 at 12:46 am
Can you post the DOS command you're using... might be able to tweek it for ya.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 24, 2008 at 12:47 am
Phil Parkin (12/23/2008)
And, what order might that be? Order by name, date, extension, 8.3 name, or ???
haha, I was wondering the same and was hoping to draw out the answer gently, whereas you went straight for the throat 🙂
BWAA-HAAA! It's because I don't have time to "monkey" around. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply