Showing posts with label queries. Show all posts
Showing posts with label queries. Show all posts

Tuesday, March 27, 2012

connecting to sql server 2000 from sql server 2005 management studio

My web site is hosted by a third party, and the back-end is a sql server 2000 database. I was routinely running queries over the internet against the database using Query Analyzer. I just installed sql server 2005. Is it possible to run a sql query against a table in the sql server 2000 database from within sql server 2005 management studio? I haven't found anything in the docs explaining how to connect to sql server 2000. Any help would be appreciated.

You can just connect to the SQL Server 200 as you connected before and are connecting now with your Business Management Studio. Its downwards compatible.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Hi there,

If all you want to do is access your SQL Server 2000 database using SQL Server 2005 Management Studio then you just need to add another connection in your Object Explorer. I believe the steps are:

1) Go File > Connect Object Explorer (NB. alternately you can click on the "Connect Object Explorer" button in the Object Explorer window

2) A dialog will appear where you specify the server name, auth type (SQL Server, Windows), username and password.

Enter the server name (should be the same as the name of the server you connect to in Query Analyzer) and other details as appropriate (the same config you used in Query Analyzer should apply here).

3) A node for your SQL Server 2000 server should appear in the Object Explorer. To query against the database, an easy way is to click on the database (you'll need to expand a few nodes in Obejct Explorer) and then click the "New Query" button (or go File > New > Query With Current Connection).

If your intent is to have your SQL Server 2005 database and define queries for that database that reference the SQL Server 2000 database then you'll need to define a linked server from the SQL Server 2005 instance to the SQL Server 2000 instance. There should be details on how to do this in Books Online.

Hope that helps a bit but sorry if it doesn't & I've missed the mark completely.

Sunday, March 25, 2012

connecting to SQL express through VB

Hi all,

I have SQL server express edition 2005 installed on my computer and using VB in MS Access to run some queries. The VB function looks something like this..

Dim dataRS As New ADODB.Recordset
Dim cnnSQL As New ADODB.Connection

Set cnnSQL = New ADODB.Connection
cnnSQL.ConnectionString = "Provider=SQLNCLI;Server=.\SQLExpress;Database=TestDB;Trusted_Connection=yes;"

cnnSQL.Properties("Integrated Security").Value = "SSPI"
cnnSQL.Open

dataRS.Open "SELECT dbo_Table_1.* FROM dbo_Table_1", cnnSQL, adOpenStatic, adLockOptimistic

The code fails on the last line with message
"Invalid object name 'dbo_Table_1'"
(yes, I verified that the table actually does exist in the DB)

I must be doing something wrong with the connection string but all the things that I've tried so far haven't worked.. Can anyone offer any suggestions?

Thanks in advance,

Try providing the schema name for the table in your select statement, as in:

SELECT DBO.dbo_Table1.* FROM DBO.dbo_Table1

You schema may or may not be DBO, I just use that here as an example.

Mike

Sunday, March 11, 2012

connecting to asp.net website

I want to connect to a asp.net website...
does any1 know how to connect queries from the database to the website??
Tahttp://www.123aspx.com/directory.aspx?dir=74 & http://www.devarticles.com/c/a/ASP/Two-Ways-To-Connect-To-SQL-Server-2000-Via-ASP/ for your reference.

Saturday, February 25, 2012

Connecting through Enterprise Manager

Hi
I am running Win2k Server on an XP machine. I have two
databases which I can run programs on with no problem. I
can connect and run queries through Query Analyzer with
no problem, but when i open Enterprise Manager to access
the Databases, the DB service stops and then I get the
message "The Connection to SQL Server has been broken.
The connection to the SQL Server is broken. Do you want
to try reconnecting to it?" I answer yes, and the prompt
for reconnecting keeps coming up. I can't access any of
my DB's through Enterprise manager. When I try to attach
a DB through the All Tasks option I get "Error 22528 [SQL-
DMO]This server connection has been unexpectedly broken
and cannot be reconnected."
Any ideas on what I need to do to rectify this problem?
Thanks
Dave LugoCheck your SQL errorlog to see if you have any stack dumps.
Cindy Gross, MCDBA, MCSE
http://cindygross.tripod.com
This posting is provided "AS IS" with no warranties, and confers no rights.

Connecting through Enterprise Manager

Hi
I am running Win2k Server on an XP machine. I have two
databases which I can run programs on with no problem. I
can connect and run queries through Query Analyzer with
no problem, but when i open Enterprise Manager to access
the Databases, the DB service stops and then I get the
message "The Connection to SQL Server has been broken.
The connection to the SQL Server is broken. Do you want
to try reconnecting to it?" I answer yes, and the prompt
for reconnecting keeps coming up. I can't access any of
my DB's through Enterprise manager. When I try to attach
a DB through the All Tasks option I get "Error 22528 [SQL-
DMO]This server connection has been unexpectedly broken
and cannot be reconnected."
Any ideas on what I need to do to rectify this problem?
Thanks
Dave Lugo
Check your SQL errorlog to see if you have any stack dumps.
Cindy Gross, MCDBA, MCSE
http://cindygross.tripod.com
This posting is provided "AS IS" with no warranties, and confers no rights.