Showing posts with label cmd. Show all posts
Showing posts with label cmd. Show all posts

Tuesday, February 14, 2012

Command Prompt problems when installing MSDE

Hi,
I cannot seem to create a server instance when installing the MSDE.
step 1. I launch my cmd. It pops up with (C:\Documents and Settings\Billy
I type setup instancename="netsdk" sapwd="sa"
I immediately get a status message saying go to the control planel and
install and configure systems components. I am stuck here. If anyone can shed
some light with this problem I would appreciate it.
I am installing the MSDE onto my laptop(XP OS). I went to my control
panel->administrative tools->Local Security Policy-> but I don't what to look
for?
I am lost.
hi Billy,
Billy wrote:
> Hi,
> I cannot seem to create a server instance when installing the MSDE.
> step 1. I launch my cmd. It pops up with (C:\Documents and
> Settings\Billy
> I type setup instancename="netsdk" sapwd="sa"
> I immediately get a status message saying go to the control planel and
> install and configure systems components. I am stuck here. If anyone
> can shed some light with this problem I would appreciate it.
>
when opening the command prompt window, please navigate to the folder
containing the MSDE setup.exe boostrap installer, typically C:\MSDErelA\ or
C:\sql2kspX\MSDE\ (where X stands for the service pack level)...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Andrea,
Forgive for not knowing, but how I do navigate to the root directory?
I tried the following commands you posted early,but cannot get to specified
location. The downloaded folder is under the C:\ dir. However, when my cmd is
invoked I cannot get to it from C:\Documents and Settings. One more time,
please. I even tried to copying the folder to the documents folder and still
no go.
Thanks
"Andrea Montanari" wrote:

> hi Billy,
> Billy wrote:
> when opening the command prompt window, please navigate to the folder
> containing the MSDE setup.exe boostrap installer, typically C:\MSDErelA\ or
> C:\sql2kspX\MSDE\ (where X stands for the service pack level)...
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
>
|||Andrea,
Recopied it to the Billy folder and create an instance to the server,
automatically starting installing. Error on my end. Thanks for the help.
"Billy" wrote:
[vbcol=seagreen]
> Andrea,
> Forgive for not knowing, but how I do navigate to the root directory?
> I tried the following commands you posted early,but cannot get to specified
> location. The downloaded folder is under the C:\ dir. However, when my cmd is
> invoked I cannot get to it from C:\Documents and Settings. One more time,
> please. I even tried to copying the folder to the documents folder and still
> no go.
> Thanks
> "Andrea Montanari" wrote:
|||Billy wrote:
> Andrea,
> Recopied it to the Billy folder and create an instance to the server,
> automatically starting installing. Error on my end. Thanks for the
> help.
?
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

Sunday, February 12, 2012

Command Line connect to SQL Server Database

I am trying to connect to the SQL Server database from the command line or from a cmd script on Windows - Is there a way to do this?

I am new to SQL Server and I am trying to create a script that can check to see if the database is up and then send me a message if it is down.Yes, you can connect to the SQL Server from the command line by means of the BCP utility for example.

Here is a list of the various CMD utilities for SQL 2000. Haven't tried them for SQL 2005 but i suppose they either work or there is something simmilar around.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/coprompt/cp_intro_3nsj.asp

As to inform you on the status of the SQL Server, you could create a Job in the SQL Server Agent to check for a simple query such as "SELECT @.@.SERVERNAME" and send an e-mail when it fails.
You can also set the SQL Server Agent service to auto-restart and create another Job to start every time the SQL Server Agent starts and tell the job to send an e-mail, so you can check for problems with the SQL Server Agent.

Hope this helps.
Good luck,
Alan.|||

osql.exe is command line client which allows you to establish a connection to SQL Server.

Please try
osql -E
for trusted connection, or
osql -U<login id> -P<password> -S<instance name>

you can skip -S parameter if you have installed a default instance.

In addition, use
osql -U<login id> -P<password> -S<instance name> -i<tsql script file name>
to run your scripts.

HTH.

MCW

|||Thanks for pointing me to the CMD utilities.|||Thanks this was very helpfull I was able to login from the cmd prompt.