Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Running .sql scripts from ASP


Message #1 by "Louise Greally" <lgreally@c...> on Mon, 10 Sep 2001 14:47:55 +0100
Hi



Can someone tell me how to run a .sql script from an ASP page if

possible, or direct me to some good sites about running .sql scripts

from ASP and VB??



Thanks

Message #2 by David Cameron <dcameron@i...> on Tue, 11 Sep 2001 09:27:36 +1000

One suggestion (probably not the most efficient), open the file (using file

system object) and read the text in as a string. Execute the string.



Any reason why this isn't included in a stored proc.



regards

David Cameron

nOw.b2b

dcameron@i...



-----Original Message-----

From: Louise Greally [mailto:lgreally@c...]

Sent: Monday, 10 September 2001 11:48 PM

To: ASP Databases

Subject: [asp_databases] Running .sql scripts from ASP





Hi



Can someone tell me how to run a .sql script from an ASP page if

possible, or direct me to some good sites about running .sql scripts

from ASP and VB??



Thanks



 

Message #3 by "Louise Greally" <lgreally@c...> on Tue, 11 Sep 2001 09:13:23 +0100
Thanks for the suggesstion, its a possibility alright.

The reason it cant be included as a stored procedure, is that its a type

of installation/ maintenance program to run on our clients machines to

set up our database on their SQL Server, we were hoping to create the

sql scripts our end, and simply execute them on their server to set up

their db.



Finding ways to run .sql scripts is something Im having difficulty with.





-----Original Message-----

From: David Cameron [mailto:dcameron@i...]

Sent: 11 September 2001 00:28

To: ASP Databases

Subject: [asp_databases] RE: Running .sql scripts from ASP







One suggestion (probably not the most efficient), open the file (using

file

system object) and read the text in as a string. Execute the string.



Any reason why this isn't included in a stored proc.



regards

David Cameron

nOw.b2b

dcameron@i...



-----Original Message-----

From: Louise Greally [mailto:lgreally@c...]

Sent: Monday, 10 September 2001 11:48 PM

To: ASP Databases

Subject: [asp_databases] Running .sql scripts from ASP





Hi



Can someone tell me how to run a .sql script from an ASP page if

possible, or direct me to some good sites about running .sql scripts

from ASP and VB??



Thanks

Message #4 by "Grooten, Paul" <Paul.Grooten@m...> on Wed, 12 Sep 2001 09:05:23 +0200
Hello Louise,



You could create a stored procedure which accepts a string as a parameter.

In this proc you would use the 'exec' statement to run the sql statement you

put in the parameter. The only thing you have to do in the calling programm

is to assemble the SQL-statement you want to run. You can put this statement

in a .asp file which you can develop remote. Please note that you loose the

execution speed when using a stored procedure with an exec statement because

it can not be analyzed during the compilation of the sp. You should also

make some precautions concerning security. Only one person should have the

exec-rights to the sp, preventing possible abuse.



Kind regards,



Paul



-----Original Message-----

From: Louise Greally [mailto:lgreally@c...]

Sent: dinsdag 11 september 2001 10:13

Subject: RE: Running .sql scripts from ASP





Thanks for the suggesstion, its a possibility alright.

The reason it cant be included as a stored procedure, is that its a type

of installation/ maintenance program to run on our clients machines to

set up our database on their SQL Server, we were hoping to create the

sql scripts our end, and simply execute them on their server to set up

their db.



Finding ways to run .sql scripts is something Im having difficulty with.





-----Original Message-----

From: David Cameron [mailto:dcameron@i...]

Sent: 11 September 2001 00:28

To: ASP Databases

Subject: [asp_databases] RE: Running .sql scripts from ASP







One suggestion (probably not the most efficient), open the file (using

file

system object) and read the text in as a string. Execute the string.



Any reason why this isn't included in a stored proc.



regards

David Cameron

nOw.b2b

dcameron@i...



-----Original Message-----

From: Louise Greally [mailto:lgreally@c...]

Sent: Monday, 10 September 2001 11:48 PM

To: ASP Databases

Subject: [asp_databases] Running .sql scripts from ASP





Hi



Can someone tell me how to run a .sql script from an ASP page if

possible, or direct me to some good sites about running .sql scripts

from ASP and VB??



Thanks


  Return to Index