Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Friday, March 23, 2012

New SQL Server User Questions

I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this part.
Thank you for your help.
Regards,
SailFL
You get a command prompt by going to Start->Run and typing CMD. From that,
you run SQLCMD. From what you have given us, try:
SQLCMD -S NGT\SQLEXPRESS
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"SailFL" <SailFL@.discussions.microsoft.com> wrote in message
news:28954F43-0CBC-42FC-B7BC-B14C3E67BC83@.microsoft.com...
I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this
part.
Thank you for your help.
Regards,
SailFL
|||SQLCMD can be issued from the commadn prompt of Windows, so
Start->Run->cmd
int he doscommand you can type in e.g.
sqlcmd.exe -S NGT\SQLEXPRESS -E
-Whereas NGT is the servername and SQLEXPRESS the instancename
-E if you are using Trusted authentication to connect to the database
server.
You can test the successfull connection therefore that you get no error
are issue a Select command to any table:
USE AdventureWorks
GO
SELECT * from Person.Contact
GO
--or simpler
SELECT 1
GO
HTH, jens Suessmeyer.
|||Thank both you for your assistance.
I was able to use the commands and to attach the AdventureWorks Database to
my SQL server.
SailFL
"Jens" wrote:

> SQLCMD can be issued from the commadn prompt of Windows, so
> Start->Run->cmd
> int he doscommand you can type in e.g.
> sqlcmd.exe -S NGT\SQLEXPRESS -E
> -Whereas NGT is the servername and SQLEXPRESS the instancename
> -E if you are using Trusted authentication to connect to the database
> server.
> You can test the successfull connection therefore that you get no error
> are issue a Select command to any table:
> USE AdventureWorks
> GO
> SELECT * from Person.Contact
> GO
> --or simpler
> SELECT 1
> GO
>
> HTH, jens Suessmeyer.
>

New SQL Server User Questions

I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this part.
Thank you for your help.
Regards,
--
SailFLYou get a command prompt by going to Start->Run and typing CMD. From that,
you run SQLCMD. From what you have given us, try:
SQLCMD -S NGT\SQLEXPRESS
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"SailFL" <SailFL@.discussions.microsoft.com> wrote in message
news:28954F43-0CBC-42FC-B7BC-B14C3E67BC83@.microsoft.com...
I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this
part.
Thank you for your help.
Regards,
SailFL|||SQLCMD can be issued from the commadn prompt of Windows, so
Start->Run->cmd
int he doscommand you can type in e.g.
sqlcmd.exe -S NGT\SQLEXPRESS -E
-Whereas NGT is the servername and SQLEXPRESS the instancename
-E if you are using Trusted authentication to connect to the database
server.
You can test the successfull connection therefore that you get no error
are issue a Select command to any table:
USE AdventureWorks
GO
SELECT * from Person.Contact
GO
--or simpler
SELECT 1
GO
HTH, jens Suessmeyer.|||Thank both you for your assistance.
I was able to use the commands and to attach the AdventureWorks Database to
my SQL server.
--
SailFL
"Jens" wrote:
> SQLCMD can be issued from the commadn prompt of Windows, so
> Start->Run->cmd
> int he doscommand you can type in e.g.
> sqlcmd.exe -S NGT\SQLEXPRESS -E
> -Whereas NGT is the servername and SQLEXPRESS the instancename
> -E if you are using Trusted authentication to connect to the database
> server.
> You can test the successfull connection therefore that you get no error
> are issue a Select command to any table:
> USE AdventureWorks
> GO
> SELECT * from Person.Contact
> GO
> --or simpler
> SELECT 1
> GO
>
> HTH, jens Suessmeyer.
>

New SQL Server User Questions

I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this par
t.
Thank you for your help.
Regards,
SailFLYou get a command prompt by going to Start->Run and typing CMD. From that,
you run SQLCMD. From what you have given us, try:
SQLCMD -S NGT\SQLEXPRESS
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"SailFL" <SailFL@.discussions.microsoft.com> wrote in message
news:28954F43-0CBC-42FC-B7BC-B14C3E67BC83@.microsoft.com...
I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this
part.
Thank you for your help.
Regards,
SailFL|||SQLCMD can be issued from the commadn prompt of Windows, so
Start->Run->cmd
int he doscommand you can type in e.g.
sqlcmd.exe -S NGT\SQLEXPRESS -E
-Whereas NGT is the servername and SQLEXPRESS the instancename
-E if you are using Trusted authentication to connect to the database
server.
You can test the successfull connection therefore that you get no error
are issue a Select command to any table:
USE AdventureWorks
GO
SELECT * from Person.Contact
GO
--or simpler
SELECT 1
GO
HTH, jens Suessmeyer.|||Thank both you for your assistance.
I was able to use the commands and to attach the AdventureWorks Database to
my SQL server.
SailFL
"Jens" wrote:

> SQLCMD can be issued from the commadn prompt of Windows, so
> Start->Run->cmd
> int he doscommand you can type in e.g.
> sqlcmd.exe -S NGT\SQLEXPRESS -E
> -Whereas NGT is the servername and SQLEXPRESS the instancename
> -E if you are using Trusted authentication to connect to the database
> server.
> You can test the successfull connection therefore that you get no error
> are issue a Select command to any table:
> USE AdventureWorks
> GO
> SELECT * from Person.Contact
> GO
> --or simpler
> SELECT 1
> GO
>
> HTH, jens Suessmeyer.
>

Monday, March 19, 2012

New Query Connect Dialog

The "Microsoft SQL Server Management Studio" opens a connection dialog with every new query. Please tell me there is setting to prevent this.

Thanx,

Greg

The popup of the dialog is related to your current context. If you have object explorer open and a server connected then the query will be connected to that server. If you have an existing query window connected it should connect to that server.

If working disconnected then you will get the pop up.

|||

Thank you for your reply, your answer does work nicely. It would seem this would be something you could define a default for. It is taking a little time to get used to the SQL 2005 tools after using SQL 2000 for so long.

If you are a member of Experts-Exchange.com please visit this link and post your answer to receive the allotted points. If after 48 hours or so I have not seen your post there I will post your answer for the benefit of others and close the question in that forum.

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_21773295.html

Regards,

Greg

|||Done, haven't answered a question on EE for a while|||

EE Saves my bacon from time to time:)

Your blog site is very kewl, you must be a busy person.

Sent an email to your yahoo address Returned Undeliverable.

|||I think this is semi-related to your thread, so I hope it's cool to post this here. If you have a query window in SSMS, and drag and drop one or more script files on it, it prompts you for the database to connect to, for each file you dropped. In 2000 query analyzer, it will automatically connect each file to the same server and database. Do you know of a way to accomplish this in 2005?|||I don't believe so.

New Query Connect Dialog

The "Microsoft SQL Server Management Studio" opens a connection dialog with every new query. Please tell me there is setting to prevent this.

Thanx,

Greg

The popup of the dialog is related to your current context. If you have object explorer open and a server connected then the query will be connected to that server. If you have an existing query window connected it should connect to that server.

If working disconnected then you will get the pop up.

|||

Thank you for your reply, your answer does work nicely. It would seem this would be something you could define a default for. It is taking a little time to get used to the SQL 2005 tools after using SQL 2000 for so long.

If you are a member of Experts-Exchange.com please visit this link and post your answer to receive the allotted points. If after 48 hours or so I have not seen your post there I will post your answer for the benefit of others and close the question in that forum.

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_21773295.html

Regards,

Greg

|||Done, haven't answered a question on EE for a while|||

EE Saves my bacon from time to time:)

Your blog site is very kewl, you must be a busy person.

Sent an email to your yahoo address Returned Undeliverable.

|||I think this is semi-related to your thread, so I hope it's cool to post this here. If you have a query window in SSMS, and drag and drop one or more script files on it, it prompts you for the database to connect to, for each file you dropped. In 2000 query analyzer, it will automatically connect each file to the same server and database. Do you know of a way to accomplish this in 2005?|||I don't believe so.

Monday, March 12, 2012

new on asp.net 2.0 trying to figure out how to connect to a database

Right now I'm just looking at websites how to create a database and putting it in the App_Data folder which is no problem. What I want to do is Programmatically do it. in the example code that I see it says:

Dim ConnString as string = ConfigurationManager.ConnectionStrings(connStringName).ConnectionString

or

Dim MyConnString as new sqlconnection = New SqlConnection(ConfigurationManager.ConnectionStrings(connStringName).ConnectionString)

now every time I put the connStringName in the parenthasis it tells me that its an error: Name connstringName is not declared.

I figure the connstringName is the name in the connectionStrings in the web.config.

So I am doing something wrong here, I would appreciate any help.

Have a look athttp://www.asp.net/learn/videos/view.aspx?tabid=63&id=49

alsohttp://www.asp.net/learn/videos/view.aspx?tabid=63&id=110

and very concisely inhttp://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/databases.aspx#connstrings

HTH

Friday, March 9, 2012

New Login - SQL Server 2005

I need to create a new login that can only see 2 Views.

I have tried everything, but when I connect to the server with MS Access or MS Excel, and sign in using that Login, I can still a bunch of views. I only want this Login to be able to run either view and not see anything else.

This is what I have done so far:

1) Created Login zzz (w/ SQL Ser Auth)

2) Set the default database to database abc (Nothing is selected in Server Roles)

3) Set User Mapping to database abc, user = zzz

4) Database roll membership is public. (It won't let me change it)

5) Added user zzz to the two Views (Granted Select only)

Now when I connect to the server from Excel

Select new database query, add new data source (connection tests successful)

When I go to select the default table I can see the two views, but I can also see a whole list of other views (all_columns, all_objects, etc..)

It looks like it's everything in the System Views Folder.(Not only can I see the other views, I can query them)

I can individually remove the Public User from each view in the System View folder and it disappears from the default table list..

Do I need to do that for each item in the system views folder? There has to be upwards of 200 views. Anyway to change them all at once?

And then there is the views listed under Information_Schema, the public user isn't setup on those.I can't find a way to get rid of these.

all_columns and all_objects are system catalogs that have catalog security, which means that the user cannot see information for objects he doesn't have access to. The user will be able to query all_columns and he will see results, but those will be results for system objects, not for your application objects. You don't need to add further restrictions, there is really no point to it, because that information is public and the user could obtain it as well by installing his own copy of SQL Server Express and making the same query.

Thanks
Laurentiu

|||I need to setup a user that people will use in conjuction with OutlookSoft, these will be financial users, not techy. I was trying to make it as simple as posiable for them. Sign in, see 2 views, pick one.

Thanks for your help.|||you could use a cursor to loop through all the views in sys.all_objects and deny select permission on all the system views except the 2 you are interested in. That would ensure that only those 2 views are visible.|||Thanks, I will give that a try.

Wednesday, March 7, 2012

New Installation can't connect to default database

I installed SQL Server 2005. Connected to an external dB on a different
server just fine. Now am trying to connect (via SQL Server Management Studio
)
to the default local dB. I get the following error:
Cannot connect to <server name in here>
A connection was successfully established with the server, but then an error
occurred during the login process (provider shared memory provider error 0 -
no process is on the other end of the pipe). Microsoft SQL Server error 23
3.
any ideas what's wrong?Run the SQL Server Configuration Manager and click on the Protocols for that
instance. Check to make sure that you enable Shared Memory.
Andrew J. Kelly SQL MVP
"ChristieD" <ChristieD@.discussions.microsoft.com> wrote in message
news:5298A83E-8980-46E7-BC6F-DB283673B3E0@.microsoft.com...
>I installed SQL Server 2005. Connected to an external dB on a different
> server just fine. Now am trying to connect (via SQL Server Management
> Studio)
> to the default local dB. I get the following error:
> Cannot connect to <server name in here>
> A connection was successfully established with the server, but then an
> error
> occurred during the login process (provider shared memory provider error
> 0 -
> no process is on the other end of the pipe). Microsoft SQL Server error
> 233.
> any ideas what's wrong?|||Shared memory is enabled as is TCP/IP. Shared Pipes was not, and I enabled
that. VIA remains disabled. I can't start the SQL Serveer Agent, either. It
is set to Manual and if I try to start it, I get a message that it started
and stopped again.
"Andrew J. Kelly" wrote:

> Run the SQL Server Configuration Manager and click on the Protocols for th
at
> instance. Check to make sure that you enable Shared Memory.
> --
> Andrew J. Kelly SQL MVP
>
> "ChristieD" <ChristieD@.discussions.microsoft.com> wrote in message
> news:5298A83E-8980-46E7-BC6F-DB283673B3E0@.microsoft.com...
>
>|||What do the error and Agent logs say?
Andrew J. Kelly SQL MVP
"ChristieD" <ChristieD@.discussions.microsoft.com> wrote in message
news:4C86F2E6-A2CF-486B-8967-873B8A2D7F1B@.microsoft.com...[vbcol=seagreen]
> Shared memory is enabled as is TCP/IP. Shared Pipes was not, and I enabled
> that. VIA remains disabled. I can't start the SQL Serveer Agent, either.
> It
> is set to Manual and if I try to start it, I get a message that it started
> and stopped again.
> "Andrew J. Kelly" wrote:
>|||There was an application event (MSSQLSERVER) that said that the max number o
f
2 user connections had been reached and the connection was closed
"Andrew J. Kelly" wrote:

> What do the error and Agent logs say?
> --
> Andrew J. Kelly SQL MVP
>
> "ChristieD" <ChristieD@.discussions.microsoft.com> wrote in message
> news:4C86F2E6-A2CF-486B-8967-873B8A2D7F1B@.microsoft.com...
>
>|||I re-installed SQL and opened the default db first and now it seems to be
working. Very weird.
"Andrew J. Kelly" wrote:

> What do the error and Agent logs say?
> --
> Andrew J. Kelly SQL MVP
>
> "ChristieD" <ChristieD@.discussions.microsoft.com> wrote in message
> news:4C86F2E6-A2CF-486B-8967-873B8A2D7F1B@.microsoft.com...
>
>

New Installation can't connect to default database

I installed SQL Server 2005. Connected to an external dB on a different
server just fine. Now am trying to connect (via SQL Server Management Studio)
to the default local dB. I get the following error:
Cannot connect to <server name in here>
A connection was successfully established with the server, but then an error
occurred during the login process (provider shared memory provider error 0 -
no process is on the other end of the pipe). Microsoft SQL Server error 233.
any ideas what's wrong?
Run the SQL Server Configuration Manager and click on the Protocols for that
instance. Check to make sure that you enable Shared Memory.
Andrew J. Kelly SQL MVP
"ChristieD" <ChristieD@.discussions.microsoft.com> wrote in message
news:5298A83E-8980-46E7-BC6F-DB283673B3E0@.microsoft.com...
>I installed SQL Server 2005. Connected to an external dB on a different
> server just fine. Now am trying to connect (via SQL Server Management
> Studio)
> to the default local dB. I get the following error:
> Cannot connect to <server name in here>
> A connection was successfully established with the server, but then an
> error
> occurred during the login process (provider shared memory provider error
> 0 -
> no process is on the other end of the pipe). Microsoft SQL Server error
> 233.
> any ideas what's wrong?
|||Shared memory is enabled as is TCP/IP. Shared Pipes was not, and I enabled
that. VIA remains disabled. I can't start the SQL Serveer Agent, either. It
is set to Manual and if I try to start it, I get a message that it started
and stopped again.
"Andrew J. Kelly" wrote:

> Run the SQL Server Configuration Manager and click on the Protocols for that
> instance. Check to make sure that you enable Shared Memory.
> --
> Andrew J. Kelly SQL MVP
>
> "ChristieD" <ChristieD@.discussions.microsoft.com> wrote in message
> news:5298A83E-8980-46E7-BC6F-DB283673B3E0@.microsoft.com...
>
>
|||What do the error and Agent logs say?
Andrew J. Kelly SQL MVP
"ChristieD" <ChristieD@.discussions.microsoft.com> wrote in message
news:4C86F2E6-A2CF-486B-8967-873B8A2D7F1B@.microsoft.com...[vbcol=seagreen]
> Shared memory is enabled as is TCP/IP. Shared Pipes was not, and I enabled
> that. VIA remains disabled. I can't start the SQL Serveer Agent, either.
> It
> is set to Manual and if I try to start it, I get a message that it started
> and stopped again.
> "Andrew J. Kelly" wrote:
|||There was an application event (MSSQLSERVER) that said that the max number of
2 user connections had been reached and the connection was closed
"Andrew J. Kelly" wrote:

> What do the error and Agent logs say?
> --
> Andrew J. Kelly SQL MVP
>
> "ChristieD" <ChristieD@.discussions.microsoft.com> wrote in message
> news:4C86F2E6-A2CF-486B-8967-873B8A2D7F1B@.microsoft.com...
>
>
|||I re-installed SQL and opened the default db first and now it seems to be
working. Very weird.
"Andrew J. Kelly" wrote:

> What do the error and Agent logs say?
> --
> Andrew J. Kelly SQL MVP
>
> "ChristieD" <ChristieD@.discussions.microsoft.com> wrote in message
> news:4C86F2E6-A2CF-486B-8967-873B8A2D7F1B@.microsoft.com...
>
>

New IBM Laptop running SQL server cannot connect to another sql server on network

I am trying to connect a new LBM Laptop to an SQL server on the
network
and I get "test connection failed because of an error in initializing
provider, [dbnetlib][connectionopren(connect()),] SQL server does not
exist or access denied. The laptom has sql server running on it
locally and I am trying to connect to an SQL server on the network.
Thanks
TomHi

You should make sure that SQL Server is at Service Pack 3a on both machines
and check the MDAC installation on the laptop with the MDAC component
checker (see microsoft download centre)?

If you can connect to the network SQL Server from other machines, then check
the network settings on the laptop.

John

"TomCullen" <cullentw2000@.yahoo.com> wrote in message
news:6ba80eaf.0410220926.6c2f4355@.posting.google.c om...
> I am trying to connect a new LBM Laptop to an SQL server on the
> network
> and I get "test connection failed because of an error in initializing
> provider, [dbnetlib][connectionopren(connect()),] SQL server does not
> exist or access denied. The laptom has sql server running on it
> locally and I am trying to connect to an SQL server on the network.
> Thanks
> Tom