Showing posts with label utility. Show all posts
Showing posts with label utility. Show all posts

Tuesday, February 21, 2012

running sql file

hi does sql server has any utility to run sql file from OS
level...Hi,
You can use the OSQL or ISQL utilities from command prompt to execute a SQL
file from command prompt.
Sample:
OSQL -Sserver_name -Usa -Ppassword -ic:\test.sql -oc:\output.log
(From command prompt execute OSQL/? to get all the options available)
Thanks
Hari
MCDBA
<anonymous@.discussions.microsoft.com> wrote in message
news:f96d01c43e32$21fafbc0$a001280a@.phx.gbl...
> hi does sql server has any utility to run sql file from OS
> level...|||If you have the sql client utilities installed then look into using osql
command line utility for the same.
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
<anonymous@.discussions.microsoft.com> wrote in message
news:f96d01c43e32$21fafbc0$a001280a@.phx.gbl...
> hi does sql server has any utility to run sql file from OS
> level...|||Thanks..Is it possible to run a script from stored
procedure?
>--Original Message--
>Hi,
>You can use the OSQL or ISQL utilities from command
prompt to execute a SQL
>file from command prompt.
>Sample:
>OSQL -Sserver_name -Usa -Ppassword -ic:\test.sql -
oc:\output.log
>(From command prompt execute OSQL/? to get all the
options available)
>Thanks
>Hari
>MCDBA
><anonymous@.discussions.microsoft.com> wrote in message
>news:f96d01c43e32$21fafbc0$a001280a@.phx.gbl...
OS[vbcol=seagreen]
>
>.
>|||Hi,
Yes, it is possible to do using xp_cmdshell.
Sample:-
alter proc test_proc
as
begin
exec master..xp_cmdshell
'osql -Usa -Ppassword -Sserver_name -ic:\hari.sql -oc:\hari.log'
end
Thanks
Hari
MCDBA
<anonymous@.discussions.microsoft.com> wrote in message
news:f99701c43e39$eed68270$a001280a@.phx.gbl...[vbcol=seagreen]
> Thanks..Is it possible to run a script from stored
> procedure?
> prompt to execute a SQL
> oc:\output.log
> options available)
> OS

running sql file

hi does sql server has any utility to run sql file from OS
level...
Hi,
You can use the OSQL or ISQL utilities from command prompt to execute a SQL
file from command prompt.
Sample:
OSQL -Sserver_name -Usa -Ppassword -ic:\test.sql -oc:\output.log
(From command prompt execute OSQL/? to get all the options available)
Thanks
Hari
MCDBA
<anonymous@.discussions.microsoft.com> wrote in message
news:f96d01c43e32$21fafbc0$a001280a@.phx.gbl...
> hi does sql server has any utility to run sql file from OS
> level...
|||If you have the sql client utilities installed then look into using osql
command line utility for the same.
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
<anonymous@.discussions.microsoft.com> wrote in message
news:f96d01c43e32$21fafbc0$a001280a@.phx.gbl...
> hi does sql server has any utility to run sql file from OS
> level...
|||Thanks..Is it possible to run a script from stored
procedure?
>--Original Message--
>Hi,
>You can use the OSQL or ISQL utilities from command
prompt to execute a SQL
>file from command prompt.
>Sample:
>OSQL -Sserver_name -Usa -Ppassword -ic:\test.sql -
oc:\output.log
>(From command prompt execute OSQL/? to get all the
options available)[vbcol=seagreen]
>Thanks
>Hari
>MCDBA
><anonymous@.discussions.microsoft.com> wrote in message
>news:f96d01c43e32$21fafbc0$a001280a@.phx.gbl...
OS
>
>.
>
|||Hi,
Yes, it is possible to do using xp_cmdshell.
Sample:-
alter proc test_proc
as
begin
exec master..xp_cmdshell
'osql -Usa -Ppassword -Sserver_name -ic:\hari.sql -oc:\hari.log'
end
Thanks
Hari
MCDBA
<anonymous@.discussions.microsoft.com> wrote in message
news:f99701c43e39$eed68270$a001280a@.phx.gbl...[vbcol=seagreen]
> Thanks..Is it possible to run a script from stored
> procedure?
> prompt to execute a SQL
> oc:\output.log
> options available)
> OS

running sql file

hi does sql server has any utility to run sql file from OS
level...Hi,
You can use the OSQL or ISQL utilities from command prompt to execute a SQL
file from command prompt.
Sample:
OSQL -Sserver_name -Usa -Ppassword -ic:\test.sql -oc:\output.log
(From command prompt execute OSQL/? to get all the options available)
Thanks
Hari
MCDBA
<anonymous@.discussions.microsoft.com> wrote in message
news:f96d01c43e32$21fafbc0$a001280a@.phx.gbl...
> hi does sql server has any utility to run sql file from OS
> level...|||If you have the sql client utilities installed then look into using osql
command line utility for the same.
--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
<anonymous@.discussions.microsoft.com> wrote in message
news:f96d01c43e32$21fafbc0$a001280a@.phx.gbl...
> hi does sql server has any utility to run sql file from OS
> level...|||Thanks..Is it possible to run a script from stored
procedure?
>--Original Message--
>Hi,
>You can use the OSQL or ISQL utilities from command
prompt to execute a SQL
>file from command prompt.
>Sample:
>OSQL -Sserver_name -Usa -Ppassword -ic:\test.sql -
oc:\output.log
>(From command prompt execute OSQL/? to get all the
options available)
>Thanks
>Hari
>MCDBA
><anonymous@.discussions.microsoft.com> wrote in message
>news:f96d01c43e32$21fafbc0$a001280a@.phx.gbl...
>> hi does sql server has any utility to run sql file from
OS
>> level...
>
>.
>|||Hi,
Yes, it is possible to do using xp_cmdshell.
Sample:-
alter proc test_proc
as
begin
exec master..xp_cmdshell
'osql -Usa -Ppassword -Sserver_name -ic:\hari.sql -oc:\hari.log'
end
Thanks
Hari
MCDBA
<anonymous@.discussions.microsoft.com> wrote in message
news:f99701c43e39$eed68270$a001280a@.phx.gbl...
> Thanks..Is it possible to run a script from stored
> procedure?
> >--Original Message--
> >Hi,
> >
> >You can use the OSQL or ISQL utilities from command
> prompt to execute a SQL
> >file from command prompt.
> >
> >Sample:
> >
> >OSQL -Sserver_name -Usa -Ppassword -ic:\test.sql -
> oc:\output.log
> >
> >(From command prompt execute OSQL/? to get all the
> options available)
> >
> >Thanks
> >Hari
> >MCDBA
> >
> ><anonymous@.discussions.microsoft.com> wrote in message
> >news:f96d01c43e32$21fafbc0$a001280a@.phx.gbl...
> >> hi does sql server has any utility to run sql file from
> OS
> >> level...
> >
> >
> >.
> >

Running Some script files

Hello, I have some script FILES (.SQL FILES) on a folder, and I want to run them using command line, or a kind of utility or tool.

Sorry for the example but I used to do @.c:\myFile.sql in Oracle, that's exactly what I need for SQL SERVER 2000

Thank you so much !!

You can use ISQL or OSQL in this case, refer to the SQL books online and following links for further information:

http://www.databasejournal.com/features/mssql/article.php/10894_3313201_2

http://www.idevelopment.info/data/MSSQL/DBA_tips/Database_Administration/DBA_1.shtml

|||

Satya SKJ wrote:

You can use ISQL or OSQL in this case, refer to the SQL books online and following links for further information:

http://www.databasejournal.com/features/mssql/article.php/10894_3313201_2

http://www.idevelopment.info/data/MSSQL/DBA_tips/Database_Administration/DBA_1.shtml

Your Answer was so useful,

Thanks a lot !!!