473,387 Members | 1,529 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Urgent Please help..

Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks

Jul 4 '06 #1
17 2258
Saps wrote on 04 jul 2006 in microsoft.public.inetserver.asp.general:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
"Urgent" only pisses off the helpful people in this NG.

What is an .sql file?
It seems not part of classic ASP, the NG's subject.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 4 '06 #2
Why does urgent have to piss someone cuz im really in need of help
here. anyways a .sql file is a sql script file which needs to be run
from a classic ASP page.

Evertjan. wrote:
Saps wrote on 04 jul 2006 in microsoft.public.inetserver.asp.general:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql

"Urgent" only pisses off the helpful people in this NG.

What is an .sql file?
It seems not part of classic ASP, the NG's subject.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 4 '06 #3

"Saps" <sa***********@yahoo.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks
What do the SQL files contain? SQL Server T-SQL?
Do they contain multiple batches? (I.e. do they use the GO key word)
Are you familiar with ADO?

Jul 4 '06 #4
Saps wrote on 04 jul 2006 in microsoft.public.inetserver.asp.general:
Evertjan. wrote:
>Saps wrote on 04 jul 2006 in microsoft.public.inetserver.asp.general:
Hi all. Can anyone help me here. I have loads of .sql files and i
need a way to call these from my asp page so the user can run them
from the browser. Meaning i have a page with a list of all scripts.
each when clicked i am able to run the script. so HOW and what do i
do to call and run the .sql

"Urgent" only pisses off the helpful people in this NG.

What is an .sql file?
It seems not part of classic ASP, the NG's subject.
[please do not toppost on usenet, the same pisses off applies]
Why does urgent have to piss someone
It does not have to, off.
It is just the way it is.
People will answer in their own good time.
cuz im really in need of help here.
Evenso. This applies to most OQ's here.
A meaningful subjectfield text would help more. [field changed]
anyways a .sql file is a sql script file which needs to be run
from a classic ASP page.
Whose "need"?

It seems native classic ASP does not support it, based on the minute
info you give about the content of such files.

So another executing engine needs to be introduced,
and perhaps the type of database it is intended to run on.

Can you give info about that, Saps?
What DB and what DB-engine are you running?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 4 '06 #5
Anthony Jones wrote on 04 jul 2006 in
microsoft.public.inetserver.asp.general:
Are you familiar with ADO?
I met him in the theatre the other day.

Much ADO about nothing, he said.

It was like Jmail talking about the do's and don'ts of CDO and CDONT.

;-)

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 4 '06 #6
The SQL file contains multiple select statements created using notepad,
that would obviously return some information. Yes I am familiar with
ADO. Currently if there are 3 sets of SQL statements, they are nt
separated by any GO. Altho i can impose them a format if required to
run from ASP.
Where i work, we have a set of users who develop these clean up
scripts(sql select statements) and upload them in a particular folder.
The target users who access this site are meant to execute these SQL
statements so they get the rows of data that the script returns. I know
its much simpler if the creators just give me the statements and i use
them ASP but its a matter of making it dynamic, they create and upload,
the users sees it and runs it.
thx for bearing with me and help will greatly b appreciated.
Anthony Jones wrote:
"Saps" <sa***********@yahoo.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks

What do the SQL files contain? SQL Server T-SQL?
Do they contain multiple batches? (I.e. do they use the GO key word)
Are you familiar with ADO?
Jul 4 '06 #7
CJM

"Saps" <sa***********@yahoo.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks
There is no native way that I know of, but I don't see why you can't just
read the T-SQL from the files and execute it via ADO.

It sounds a bit messy to me though, and we have no context in which to
answer. What do the scripts do? Who creates them? Who uses the application
(security may be an issue). What kind of SQL is being used?

More importantly, what are you trying to achieve? Why do you want users to
be about to run SQL scripts from ASP?

CJM
Jul 4 '06 #8
Saps wrote:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks
Sapa,

I've never used something like that, but considering that the sql
command in ASP is an ordinary string, I believe taht you may do what
you wnat by FSO.
Try to read the sql file and put its contents on a string and them
execute the command object.

Jul 4 '06 #9
"Evertjan." wrote ...
>Are you familiar with ADO?

I met him in the theatre the other day.

Much ADO about nothing, he said.

It was like Jmail talking about the do's and don'ts of CDO and CDONT.

;-)
For one so keen on the "rules" your post was kind OT wasn't it ;o)

And yes, I do appreciate the irony of my reply, and most likely
yours.....here we go! :o)

Regards

Rob
Jul 4 '06 #10
Saps wrote:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks
You would probably be better off if you encapsulated the T-SQL in those
script files into stored procedures which can easily be executed from an ASP
file via ADO.

CREATE PROCEDURE RunMySQL1 AS
<copy and paste your sql script file contents here>

Run the above script on your server, grant the appropriate permissions to
the users that need to run it, and, in your ASP page:

dim cn, proc
proc = request.form("selectedscript")
set cn=createobject("adodb.connection")
cn.open <your connection string>
'http://www.aspfaq.com/show.asp?id=2126
select case proc
case "1": cn.RunMySQL1
...
case else:
end select
cn.close: set cn=nothing

What is your perceived advantage in using script files instead of stored
procedures?

If you are stuck with script files, you have several options:
1. As stated by MFedatto, you can use FSO to read the sql from the file
(http://www.aspfaq.com/show.asp?id=2039) and execute it using an ADO
connection object. With this approach, you need to take care to strip out
non-T-SQL words like "GO"

2. Depending on your version of SQL Server, you can install either isql or
osql (look them up in SQL Books Online ... BOL) on your web server and use
wscript.shell to run the script files using the appropriate tool for your
sql server.

3. Again, depending on your version of SQL Server, install either SQL-DMO or
SMO (if using SQL 2005) and use them to run your script files (look them up
in BOL)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 4 '06 #11

"Saps" <sa***********@yahoo.comwrote in message
news:11*********************@v61g2000cwv.googlegro ups.com...
The SQL file contains multiple select statements created using notepad,
that would obviously return some information. Yes I am familiar with
ADO. Currently if there are 3 sets of SQL statements, they are nt
separated by any GO. Altho i can impose them a format if required to
run from ASP.
Not having GO is a good thing.

As others have pointed out you could simply load the text of the file via
Scripting.FileSystemObject and execute the script via ADO.

You would have to impose that GO is not used since it's used to delimit
batches to be executed which is a facility not offered by ADO.
Where i work, we have a set of users who develop these clean up
scripts(sql select statements) and upload them in a particular folder.
The target users who access this site are meant to execute these SQL
statements so they get the rows of data that the script returns. I know
its much simpler if the creators just give me the statements and i use
them ASP but its a matter of making it dynamic, they create and upload,
the users sees it and runs it.
thx for bearing with me and help will greatly b appreciated.
Anthony Jones wrote:
"Saps" <sa***********@yahoo.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks
>
What do the SQL files contain? SQL Server T-SQL?
Do they contain multiple batches? (I.e. do they use the GO key word)
Are you familiar with ADO?

Jul 4 '06 #12
I think the more relevent issue is that your Subject should mention
something about the question your asking.
This helps keep the newgroup posts clean and easier to look through.

"Urgent Please help.."

Is an annoying and useless Subject title. At least to me it is.

Your also going to get a lot less people reading a post with a subject like
that.

"Saps" <sa***********@yahoo.comwrote in message
news:11**********************@a14g2000cwb.googlegr oups.com...
Why does urgent have to piss someone cuz im really in need of help
here. anyways a .sql file is a sql script file which needs to be run
from a classic ASP page.

Evertjan. wrote:
>Saps wrote on 04 jul 2006 in microsoft.public.inetserver.asp.general:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql

"Urgent" only pisses off the helpful people in this NG.

What is an .sql file?
It seems not part of classic ASP, the NG's subject.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 4 '06 #13
Kyle Peterson wrote:
I think the more relevent issue is that your Subject should mention
something about the question your asking.
This helps keep the newgroup posts clean and easier to look through.

"Urgent Please help.."

Is an annoying and useless Subject title. At least to me it is.

Your also going to get a lot less people reading a post with a
subject like that.

You know, I would typically agree with that statement, but ...
compare the number of responses in this thread to the number of responses
the original thread (subject: "Execute .sql scripts from ASP") received ...
;-)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 4 '06 #14
I never saw that anywhere.
original thread (subject: "Execute .sql scripts from ASP")

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Kyle Peterson wrote:
>I think the more relevent issue is that your Subject should mention
something about the question your asking.
This helps keep the newgroup posts clean and easier to look through.

"Urgent Please help.."

Is an annoying and useless Subject title. At least to me it is.

Your also going to get a lot less people reading a post with a
subject like that.


You know, I would typically agree with that statement, but ...
compare the number of responses in this thread to the number of responses
the original thread (subject: "Execute .sql scripts from ASP") received
... ;-)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 5 '06 #15
but I just found it
"Kyle Peterson" <ky*****@hotmail.comwrote in message
news:eZ**************@TK2MSFTNGP03.phx.gbl...
>I never saw that anywhere.
original thread (subject: "Execute .sql scripts from ASP")

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>Kyle Peterson wrote:
>>I think the more relevent issue is that your Subject should mention
something about the question your asking.
This helps keep the newgroup posts clean and easier to look through.

"Urgent Please help.."

Is an annoying and useless Subject title. At least to me it is.

Your also going to get a lot less people reading a post with a
subject like that.


You know, I would typically agree with that statement, but ...
compare the number of responses in this thread to the number of responses
the original thread (subject: "Execute .sql scripts from ASP") received
... ;-)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jul 5 '06 #16
Yes Bob. i had posted this question when i was in most need of help.
and when i open to chk if anyone replied..NOONE did. i had to put it
this way for people to atleast open it and chk if they can help. but
anyways i have really appreciated the help i gt. yes like u guys
mentioned, i can read each line of the script store it in a string and
execute it. im going to have to try doing that. Can i get a sample code
of how to do that tho. Please.
And hey guys sorry for all the botherations u'll had answering this
thread but it has helped me ALOT. thx.

Bob Barrows [MVP] wrote:
Kyle Peterson wrote:
I think the more relevent issue is that your Subject should mention
something about the question your asking.
This helps keep the newgroup posts clean and easier to look through.

"Urgent Please help.."

Is an annoying and useless Subject title. At least to me it is.

Your also going to get a lot less people reading a post with a
subject like that.


You know, I would typically agree with that statement, but ...
compare the number of responses in this thread to the number of responses
the original thread (subject: "Execute .sql scripts from ASP") received ...
;-)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 5 '06 #17
Saps wrote:
Yes Bob. i had posted this question when i was in most need of help.
and when i open to chk if anyone replied..NOONE did. i had to put it
this way
No, you didn't. You could (should) have replied to the original post.
for people to atleast open it and chk if they can help.
but
anyways i have really appreciated the help i gt. yes like u guys
mentioned, i can read each line of the script store it in a string and
execute it. im going to have to try doing that.
Why do you have to use .sql files? You have yet to answer this question.
SQL files are not really a good mechanism for implementing application
logic. They are really meant for maintenance tasks that are infrequently
performed.
Can i get a sample
code of how to do that tho. Please.
Unless someone has a lot of time on his hands (or is intrigued by the
problem), nobody is going to write it for you. Look at the link I
provided (http://www.aspfaq.com/show.asp?id=2039), do some reading in
the other articles on that site, and try doing it yourself. If you get
stuck, come back and show us where you are stuck.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 5 '06 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: js | last post by:
Hi all, I currently encounter a problem and it is urgent to me. After calling the MsgBox.Show(), the message box is shown with non-modal mode, what is the possible reason??? This only happen...
3
by: Liu Ju | last post by:
Dear members: I want to use the multithread in my program which is developed in Visual C++ platform (version 6). I created a controlling function: UINT CCOMM1Dlg::WritingThreadFunc(LPVOID...
2
by: learner | last post by:
Hi, In a page, i have many links. I have some functions in a global file which is included in all linked pages. I want to have a reference to a window which is to be opened on clicking one link...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
2
by: Dimitri | last post by:
PLEASE HELP,I HAVE A DATABSE WITH MULTIPLE RECORDS AS OUTLINED BELOW EMP NO LEVEL NEXTINCREASE WAGETYPE UNIT 1000 1 0 1000 1000 1 0 1002 ...
0
by: Christopher | last post by:
Urgent Help Needed: The EPVH-1.1 Visual Hull Library. Dear All, I am a student doing research in computer vision. The EPVH-1.1 Visual Hull Library will really help a lot in my research. I...
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
4
by: ashasivan | last post by:
Hi, Please help me as soon as possible for the following problem. It is very very urgent. I have an XML file as follows: <?xml version="1.0" standalone="yes"?> <Employee> <em...
1
by: psantosh12 | last post by:
Hello Frnds Please need help to resolve error.......... it is very very urgent........ The error is Runtime Error Description: An application error occurred on the server. The current custom...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.