Showing posts with label sever. Show all posts
Showing posts with label sever. Show all posts

Friday, March 30, 2012

How can i connect to sql sever 2005 express from the command prompt.

Iam trying to connect to local copy of sql sever express from the command prompt with this command(sqlcmd) but i get the error below. What should i do to overcome the error. Basically what i want to do is to try out some commandline backup utilities and i deadly want to know how to do a backup from the command prompt. Help is greatly appreciated.

HResult 0x2, level 16, state 1

Named pipes provider: could not open a connection to sql sever [2]

sqlcmd: Error: Microsft sql native client: An error has occurred while estarblishing a connection to the sever. When connecting to sql sever 2005, this failure may be caused by the fact that under the default settings SQL sever does not allow remote connections..

Sqlcmd: Error: Microsoft sql native client: Login time out expired.

Assuming you have the server name correct I would check in the control panel --> administrative tools --> Services and make sure that sql express is running|||I got it right. Looks like it was a typing mistake. But i have one question here, backingup a database from the command prompt to me looks tiresome. What is likely to go wrong if i just copied my projects folder from the production sever to a nother machine where i want the backup to be insteady of going through all these good but confusing steps. I i just copied the folder to a nother location or computer, are the end results not the same with if i had follwed all these database backup procedures. Dont laugh at me, iam still new to this stuff.|||

Hi,

This might be caused since SQL Server 2005 does not allow remote connection under default configuration. Please enable this according to the following KB article.

http://support.microsoft.com/kb/914277/en-us

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!

Wednesday, March 28, 2012

How can I change the default Save-As/Save directory

I am new to sql sever management studio express, but a long time query analyzer user. This is a very basic question.

I want to change the default directory in sql server management studio express so that when I go to save a query, it is already pointed to the correct one. Where do I change that?

Thanks,

Nanci

Goto [Tools], [Options], [Query Results]

There you will be able to change the default query results storage location.

|||

I have changed that setting, but it only works for the results of the query, not saving the query itself. Any other suggestions?

Nanci

sql

Friday, March 23, 2012

How can i back-up my database in production environment.

I developed an asp.net application in visual web developer 2005 express edition and SQL sever 2005 express with Advanced services. The application has been deployed and iam wondering what tools are availabel to for backing up my data. Are there any tools i can use to back-up my database. Iam not talking of third party tools but tools a vailable in sql sever 2005 express with advanced services or visual web developer express.

OR can write a vb.net Sub procedure that i run and have my database backed up. If so where can i start or what other options may i explorer.

Hi Dear,

you can backup your datbase by usingMicrosoft SQL Server Management Studio and also by ur VB.NET application

i will try to explain you both ways.

1:By using Microsoft SQL Server Management Studio

Open Management Studio and Right Click On Your Database and go to the Tasks->Backup menu item, Backup Database Dialogbox will be open.

Click Add button in Destination Panel, and choose the Destination File. and simply press OK ( This is the simplest way, but you can customize your backup by choosing different options available on Backup Database Dialog)

2. By VB.NET Application

execute following TSQL statement in your SQL Server

USE

master

EXEC

sp_addumpdevice'disk','MyDataBaseBackup','c:\YourDatabaseBackupDirectory\MyDBBackup.dat'

' and then use following code in your application

' VB.NET Code

Dim conAsNew SqlConnection("ConnectionString")Dim comAsNew SqlCommand("BACKUP DATABASE YourDataBaseName TO MyDataBaseBackup")

com.Connection = con

com.Connection.Open()

com.ExecuteNonQuery()

com.Connection.Close()

Thanks

Regards,

Muhammad Akhtar Shiekh

|||

Oh thanks very much Akhtar,

I want to take on and understand thoroughly the second option(vb.net option) as its looks to be more flexible though a bit complicated. Looks like i have to start with stored procedures, isn't. Please would you point me to a tutorial from microsoft to get me started with the core basics of backingup a database using this approach.

Thanks very much.

|||Check out the BACKUP statement in Books On Line. You might want to schedule it as a job and include it in your weekly maintenance window (if you dont already have one, time to create one) rather than create a VB application for it.|||

The problem all starts with version of sql sever one is using. some of the documentation do not apply to the express version of sql sever so you find your self wasting valuable time reading an article that you later find out does not apply to the product version your running. Iam running sql sever 2005 express edition with advanced sevices in my case.

sql

Sunday, February 19, 2012

Hosting website on SQL Sever.

I am planning to develop a website which will use SQL
Server as it's database.
My question are:
(1) Do I need to BUY Server in this scenario because I
have to test my website on my local webserver. Ultimately
the site would be uploaded to third-party's hosting
server. Should I buy Developer Edition or Evaluation
Edition or MSDE would work.
(2) I would be required to update my SQL Server database
at least once in a week. How would I copy my database to
hosting server database. If it were Access, I would have
just copy the access database file to the hosting server.
What steps are required to be taken to copy SQL Server
Database sitting in our SQL Server to hosting server?
(3) What are the recommened hosting server websites which
support SQL Server.
(4) Let's say I plan to buy SQL Server and host the
website on our webserver,then which Edition of SQL Server
should I buy ... and how would the licening thing work in
this situation? For how may users/licences I have to buy
this SQL Server?
*1.)
MSDE would work but you won't have enterprise tools.
however if you are developing in .NET then there are some DB tools there.
There is also a freebie IDE for MSDE.
Hosting sites such as www.discountasp.net offer SQL Server for like $25 per
month--1 database
as far as for testing as a developer, I am sure that you have the right to
use it to develop...for sure if you an MSDN subscriber and maybe just as
vb.net pro owner--not sure.
2.) On discountasp.net I can just connect to my database in enterprise
tools...other hosts are probably the same.
if you are using dialup internet connection, then be aware that you will
probably need to modify the database in Query Analyzer using DDL and SQL
statements as using EM tools is too slow...this isn't too bad though.
3.) I have been real happy with discountasp.net... there are others.
4.) Will be expensive if just for hosting on the internet... If you are to
use it in house and on internet...maybe worth it--else you might want to
just host it for $25per month. Average SQL Server, last time I checked
(it's been a while) was $5000 for the server and a decent number of CALS.
And then I know years ago you had to purchase an internet connection license
and it used to be about $1500 per processor for you server. So you can see
it gets expensive...
for more prices I suggest you visit Microsoft's website and read.
HTH,
Shane
<anonymous@.discussions.microsoft.com> wrote in message
news:0e0d01c47b47$f171fb90$a301280a@.phx.gbl...
> I am planning to develop a website which will use SQL
> Server as it's database.
> My question are:
> (1) Do I need to BUY Server in this scenario because I
> have to test my website on my local webserver. Ultimately
> the site would be uploaded to third-party's hosting
> server. Should I buy Developer Edition or Evaluation
> Edition or MSDE would work.
> (2) I would be required to update my SQL Server database
> at least once in a week. How would I copy my database to
> hosting server database. If it were Access, I would have
> just copy the access database file to the hosting server.
> What steps are required to be taken to copy SQL Server
> Database sitting in our SQL Server to hosting server?
> (3) What are the recommened hosting server websites which
> support SQL Server.
> (4) Let's say I plan to buy SQL Server and host the
> website on our webserver,then which Edition of SQL Server
> should I buy ... and how would the licening thing work in
> this situation? For how may users/licences I have to buy
> this SQL Server?
> *|||Regarding buying SQL if your internet guy is hosting it... The answer is
NO... The internet company would have purchased SQL Server that you are
using on the hosted web site...
You would be responsible for your test server, and MSDE is appropriate and
intended just for that purpose...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
<anonymous@.discussions.microsoft.com> wrote in message
news:0e0d01c47b47$f171fb90$a301280a@.phx.gbl...
> I am planning to develop a website which will use SQL
> Server as it's database.
> My question are:
> (1) Do I need to BUY Server in this scenario because I
> have to test my website on my local webserver. Ultimately
> the site would be uploaded to third-party's hosting
> server. Should I buy Developer Edition or Evaluation
> Edition or MSDE would work.
> (2) I would be required to update my SQL Server database
> at least once in a week. How would I copy my database to
> hosting server database. If it were Access, I would have
> just copy the access database file to the hosting server.
> What steps are required to be taken to copy SQL Server
> Database sitting in our SQL Server to hosting server?
> (3) What are the recommened hosting server websites which
> support SQL Server.
> (4) Let's say I plan to buy SQL Server and host the
> website on our webserver,then which Edition of SQL Server
> should I buy ... and how would the licening thing work in
> this situation? For how may users/licences I have to buy
> this SQL Server?
> *

Hosting website on SQL Sever.

I am planning to develop a website which will use SQL
Server as it's database.
My question are:
(1) Do I need to BUY Server in this scenario because I
have to test my website on my local webserver. Ultimately
the site would be uploaded to third-party's hosting
server. Should I buy Developer Edition or Evaluation
Edition or MSDE would work.
(2) I would be required to update my SQL Server database
at least once in a week. How would I copy my database to
hosting server database. If it were Access, I would have
just copy the access database file to the hosting server.
What steps are required to be taken to copy SQL Server
Database sitting in our SQL Server to hosting server?
(3) What are the recommened hosting server websites which
support SQL Server.
(4) Let's say I plan to buy SQL Server and host the
website on our webserver,then which Edition of SQL Server
should I buy ... and how would the licening thing work in
this situation? For how may users/licences I have to buy
this SQL Server?
*1.)
MSDE would work but you won't have enterprise tools.
however if you are developing in .NET then there are some DB tools there.
There is also a freebie IDE for MSDE.
Hosting sites such as www.discountasp.net offer SQL Server for like $25 per
month--1 database
as far as for testing as a developer, I am sure that you have the right to
use it to develop...for sure if you an MSDN subscriber and maybe just as
vb.net pro owner--not sure.
2.) On discountasp.net I can just connect to my database in enterprise
tools...other hosts are probably the same.
if you are using dialup internet connection, then be aware that you will
probably need to modify the database in Query Analyzer using DDL and SQL
statements as using EM tools is too slow...this isn't too bad though.
3.) I have been real happy with discountasp.net... there are others.
4.) Will be expensive if just for hosting on the internet... If you are to
use it in house and on internet...maybe worth it--else you might want to
just host it for $25per month. Average SQL Server, last time I checked
(it's been a while) was $5000 for the server and a decent number of CALS.
And then I know years ago you had to purchase an internet connection license
and it used to be about $1500 per processor for you server. So you can see
it gets expensive...
for more prices I suggest you visit Microsoft's website and read.
HTH,
Shane
<anonymous@.discussions.microsoft.com> wrote in message
news:0e0d01c47b47$f171fb90$a301280a@.phx.gbl...
> I am planning to develop a website which will use SQL
> Server as it's database.
> My question are:
> (1) Do I need to BUY Server in this scenario because I
> have to test my website on my local webserver. Ultimately
> the site would be uploaded to third-party's hosting
> server. Should I buy Developer Edition or Evaluation
> Edition or MSDE would work.
> (2) I would be required to update my SQL Server database
> at least once in a week. How would I copy my database to
> hosting server database. If it were Access, I would have
> just copy the access database file to the hosting server.
> What steps are required to be taken to copy SQL Server
> Database sitting in our SQL Server to hosting server?
> (3) What are the recommened hosting server websites which
> support SQL Server.
> (4) Let's say I plan to buy SQL Server and host the
> website on our webserver,then which Edition of SQL Server
> should I buy ... and how would the licening thing work in
> this situation? For how may users/licences I have to buy
> this SQL Server?
> *|||Regarding buying SQL if your internet guy is hosting it... The answer is
NO... The internet company would have purchased SQL Server that you are
using on the hosted web site...
You would be responsible for your test server, and MSDE is appropriate and
intended just for that purpose...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
<anonymous@.discussions.microsoft.com> wrote in message
news:0e0d01c47b47$f171fb90$a301280a@.phx.gbl...
> I am planning to develop a website which will use SQL
> Server as it's database.
> My question are:
> (1) Do I need to BUY Server in this scenario because I
> have to test my website on my local webserver. Ultimately
> the site would be uploaded to third-party's hosting
> server. Should I buy Developer Edition or Evaluation
> Edition or MSDE would work.
> (2) I would be required to update my SQL Server database
> at least once in a week. How would I copy my database to
> hosting server database. If it were Access, I would have
> just copy the access database file to the hosting server.
> What steps are required to be taken to copy SQL Server
> Database sitting in our SQL Server to hosting server?
> (3) What are the recommened hosting server websites which
> support SQL Server.
> (4) Let's say I plan to buy SQL Server and host the
> website on our webserver,then which Edition of SQL Server
> should I buy ... and how would the licening thing work in
> this situation? For how may users/licences I have to buy
> this SQL Server?
> *

Hosting website on SQL Sever.

I am planning to develop a website which will use SQL
Server as it's database.
My question are:
(1) Do I need to BUY Server in this scenario because I
have to test my website on my local webserver. Ultimately
the site would be uploaded to third-party's hosting
server. Should I buy Developer Edition or Evaluation
Edition or MSDE would work.
(2) I would be required to update my SQL Server database
at least once in a week. How would I copy my database to
hosting server database. If it were Access, I would have
just copy the access database file to the hosting server.
What steps are required to be taken to copy SQL Server
Database sitting in our SQL Server to hosting server?
(3) What are the recommened hosting server websites which
support SQL Server.
(4) Let's say I plan to buy SQL Server and host the
website on our webserver,then which Edition of SQL Server
should I buy ... and how would the licening thing work in
this situation? For how may users/licences I have to buy
this SQL Server?
*
1.)
MSDE would work but you won't have enterprise tools.
however if you are developing in .NET then there are some DB tools there.
There is also a freebie IDE for MSDE.
Hosting sites such as www.discountasp.net offer SQL Server for like $25 per
month--1 database
as far as for testing as a developer, I am sure that you have the right to
use it to develop...for sure if you an MSDN subscriber and maybe just as
vb.net pro owner--not sure.
2.) On discountasp.net I can just connect to my database in enterprise
tools...other hosts are probably the same.
if you are using dialup internet connection, then be aware that you will
probably need to modify the database in Query Analyzer using DDL and SQL
statements as using EM tools is too slow...this isn't too bad though.
3.) I have been real happy with discountasp.net... there are others.
4.) Will be expensive if just for hosting on the internet... If you are to
use it in house and on internet...maybe worth it--else you might want to
just host it for $25per month. Average SQL Server, last time I checked
(it's been a while) was $5000 for the server and a decent number of CALS.
And then I know years ago you had to purchase an internet connection license
and it used to be about $1500 per processor for you server. So you can see
it gets expensive...
for more prices I suggest you visit Microsoft's website and read.
HTH,
Shane
<anonymous@.discussions.microsoft.com> wrote in message
news:0e0d01c47b47$f171fb90$a301280a@.phx.gbl...
> I am planning to develop a website which will use SQL
> Server as it's database.
> My question are:
> (1) Do I need to BUY Server in this scenario because I
> have to test my website on my local webserver. Ultimately
> the site would be uploaded to third-party's hosting
> server. Should I buy Developer Edition or Evaluation
> Edition or MSDE would work.
> (2) I would be required to update my SQL Server database
> at least once in a week. How would I copy my database to
> hosting server database. If it were Access, I would have
> just copy the access database file to the hosting server.
> What steps are required to be taken to copy SQL Server
> Database sitting in our SQL Server to hosting server?
> (3) What are the recommened hosting server websites which
> support SQL Server.
> (4) Let's say I plan to buy SQL Server and host the
> website on our webserver,then which Edition of SQL Server
> should I buy ... and how would the licening thing work in
> this situation? For how may users/licences I have to buy
> this SQL Server?
> *
|||Regarding buying SQL if your internet guy is hosting it... The answer is
NO... The internet company would have purchased SQL Server that you are
using on the hosted web site...
You would be responsible for your test server, and MSDE is appropriate and
intended just for that purpose...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
<anonymous@.discussions.microsoft.com> wrote in message
news:0e0d01c47b47$f171fb90$a301280a@.phx.gbl...
> I am planning to develop a website which will use SQL
> Server as it's database.
> My question are:
> (1) Do I need to BUY Server in this scenario because I
> have to test my website on my local webserver. Ultimately
> the site would be uploaded to third-party's hosting
> server. Should I buy Developer Edition or Evaluation
> Edition or MSDE would work.
> (2) I would be required to update my SQL Server database
> at least once in a week. How would I copy my database to
> hosting server database. If it were Access, I would have
> just copy the access database file to the hosting server.
> What steps are required to be taken to copy SQL Server
> Database sitting in our SQL Server to hosting server?
> (3) What are the recommened hosting server websites which
> support SQL Server.
> (4) Let's say I plan to buy SQL Server and host the
> website on our webserver,then which Edition of SQL Server
> should I buy ... and how would the licening thing work in
> this situation? For how may users/licences I have to buy
> this SQL Server?
> *