Friday, March 30, 2012
how to attach a .mdf file?
i installed sqlserver express 2005.
I also use the sql server management studio express. I can connect to
(myserver\sqlexpress), but when i want to attach any existing .mdf file on
my disc, the window remains empty and i have not the opportunity to specify
a path.
Any idea how to fix this?
Thanks
BobYou also need the ldf file. Are you clicking the Add button in the attach
dialog box to browse for the file you want to attach?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Bob" <.> wrote in message news:u1RLbzeLHHA.1424@.TK2MSFTNGP04.phx.gbl...
> Hi,
> i installed sqlserver express 2005.
> I also use the sql server management studio express. I can connect to
> (myserver\sqlexpress), but when i want to attach any existing .mdf file on
> my disc, the window remains empty and i have not the opportunity to
> specify a path.
> Any idea how to fix this?
> Thanks
> Bob
>|||Hello,
In the SQL Server management studio express; go to query window and execute
SP_ATTACH_DB if you have both MDF and LDF files. If you have only MDF file
try sp_attach_single_file_db command. Take a look into books online for
usage.
Thanks
Hari
"Bob" <.> wrote in message news:u1RLbzeLHHA.1424@.TK2MSFTNGP04.phx.gbl...
> Hi,
> i installed sqlserver express 2005.
> I also use the sql server management studio express. I can connect to
> (myserver\sqlexpress), but when i want to attach any existing .mdf file on
> my disc, the window remains empty and i have not the opportunity to
> specify a path.
> Any idea how to fix this?
> Thanks
> Bob
>|||Hi, thanks for replying. I thing i become crazy. I desinstalled and
reinstalled it 2 times, but it still doen't work.
Yes, i have the ldf file.
When i click on ADD button, i get an error telling me that "cannot access
the sprecified path etc ...Verify that you have specific privileges ..."
I tried to add "myserver\aspnet" as account (server properties,
permissions), but then, it's always un recognized ...
I did sqlcmd -S myserver in the dos-box and i get:" name pipes provider:
could not open a connection to SQL Server"
And when i start an asp.net application, i get the error: "
An attempt to attach an auto-named database for file C:\myapp\my.mdf failed.
A database with the same name exists, or specified file cannot be opened, or
it is located on UNC share.
The only way it works is when doing ctrl-f5 in an application within VWD.
"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> schreef in bericht
news:uKalp4eLHHA.4244@.TK2MSFTNGP04.phx.gbl...
> You also need the ldf file. Are you clicking the Add button in the att
> dialog box to browse for the file you want to attach?
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Bob" <.> wrote in message news:u1RLbzeLHHA.1424@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> i installed sqlserver express 2005.
>> I also use the sql server management studio express. I can connect to
>> (myserver\sqlexpress), but when i want to attach any existing .mdf file
>> on my disc, the window remains empty and i have not the opportunity to
>> specify a path.
>> Any idea how to fix this?
>> Thanks
>> Bob
>|||Sounds like a security issue. When you attach through the debugger you
start up a user instance which attaches the database as the user who is
doing the debugging. When you attempt to attach using sqlcmd or the
workbench, you are attaching to the normal instance which runs as
networkservice by default. The problem is probably that network service
doesn't have write permission on the mdf and ldf files for your database.
There's more information about user instances here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsse/html/sqlexpuserinst.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Bob" <.> wrote in message news:u6TZOGoLHHA.4244@.TK2MSFTNGP04.phx.gbl...
> Hi, thanks for replying. I thing i become crazy. I desinstalled and
> reinstalled it 2 times, but it still doen't work.
> Yes, i have the ldf file.
> When i click on ADD button, i get an error telling me that "cannot access
> the sprecified path etc ...Verify that you have specific privileges ..."
> I tried to add "myserver\aspnet" as account (server properties,
> permissions), but then, it's always un recognized ...
> I did sqlcmd -S myserver in the dos-box and i get:" name pipes provider:
> could not open a connection to SQL Server"
> And when i start an asp.net application, i get the error: "
> An attempt to attach an auto-named database for file C:\myapp\my.mdf
> failed. A database with the same name exists, or specified file cannot be
> opened, or it is located on UNC share.
> The only way it works is when doing ctrl-f5 in an application within VWD.
>
>
> "Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> schreef in bericht
> news:uKalp4eLHHA.4244@.TK2MSFTNGP04.phx.gbl...
>> You also need the ldf file. Are you clicking the Add button in the att
>> dialog box to browse for the file you want to attach?
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> Use of included script samples are subject to the terms specified at
>> http://www.microsoft.com/info/cpyright.htm
>> "Bob" <.> wrote in message news:u1RLbzeLHHA.1424@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> i installed sqlserver express 2005.
>> I also use the sql server management studio express. I can connect to
>> (myserver\sqlexpress), but when i want to attach any existing .mdf file
>> on my disc, the window remains empty and i have not the opportunity to
>> specify a path.
>> Any idea how to fix this?
>> Thanks
>> Bob
>>
>|||Hi, thanks for replying.
I started from the beginning but still with problems.
I post a new thread therefore.
"Hari Prasad" <hari_prasad_k@.hotmail.com> schreef in bericht
news:e08sUAfLHHA.780@.TK2MSFTNGP03.phx.gbl...
> Hello,
> In the SQL Server management studio express; go to query window and
> execute SP_ATTACH_DB if you have both MDF and LDF files. If you have only
> MDF file
> try sp_attach_single_file_db command. Take a look into books online for
> usage.
> Thanks
> Hari
>
> "Bob" <.> wrote in message news:u1RLbzeLHHA.1424@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> i installed sqlserver express 2005.
>> I also use the sql server management studio express. I can connect to
>> (myserver\sqlexpress), but when i want to attach any existing .mdf file
>> on my disc, the window remains empty and i have not the opportunity to
>> specify a path.
>> Any idea how to fix this?
>> Thanks
>> Bob
>sql
Wednesday, March 28, 2012
how to attach a .mdf file?
i installed sqlserver express 2005.
I also use the sql server management studio express. I can connect to
(myserver\sqlexpress), but when i want to attach any existing .mdf file on
my disc, the window remains empty and i have not the opportunity to specify
a path.
Any idea how to fix this?
Thanks
BobYou also need the ldf file. Are you clicking the Add button in the attach
dialog box to browse for the file you want to attach?
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Bob" <.> wrote in message news:u1RLbzeLHHA.1424@.TK2MSFTNGP04.phx.gbl...
> Hi,
> i installed sqlserver express 2005.
> I also use the sql server management studio express. I can connect to
> (myserver\sqlexpress), but when i want to attach any existing .mdf file on
> my disc, the window remains empty and i have not the opportunity to
> specify a path.
> Any idea how to fix this?
> Thanks
> Bob
>|||Hello,
In the SQL Server management studio express; go to query window and execute
SP_ATTACH_DB if you have both MDF and LDF files. If you have only MDF file
try sp_attach_single_file_db command. Take a look into books online for
usage.
Thanks
Hari
"Bob" <.> wrote in message news:u1RLbzeLHHA.1424@.TK2MSFTNGP04.phx.gbl...
> Hi,
> i installed sqlserver express 2005.
> I also use the sql server management studio express. I can connect to
> (myserver\sqlexpress), but when i want to attach any existing .mdf file on
> my disc, the window remains empty and i have not the opportunity to
> specify a path.
> Any idea how to fix this?
> Thanks
> Bob
>|||Hi, thanks for replying. I thing i become crazy. I desinstalled and
reinstalled it 2 times, but it still doen't work.
Yes, i have the ldf file.
When i click on ADD button, i get an error telling me that "cannot access
the sprecified path etc ...Verify that you have specific privileges ..."
I tried to add "myserver\aspnet" as account (server properties,
permissions), but then, it's always un recognized ...
I did sqlcmd -S myserver in the dos-box and i get:" name pipes provider:
could not open a connection to SQL Server"
And when i start an asp.net application, i get the error: "
An attempt to attach an auto-named database for file C:\myapp\my.mdf failed.
A database with the same name exists, or specified file cannot be opened, or
it is located on UNC share.
The only way it works is when doing ctrl-f5 in an application within VWD.
"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> schreef in bericht
news:uKalp4eLHHA.4244@.TK2MSFTNGP04.phx.gbl...
> You also need the ldf file. Are you clicking the Add button in the att
> dialog box to browse for the file you want to attach?
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Bob" <.> wrote in message news:u1RLbzeLHHA.1424@.TK2MSFTNGP04.phx.gbl...
>|||Sounds like a security issue. When you attach through the debugger you
start up a user instance which attaches the database as the user who is
doing the debugging. When you attempt to attach using sqlcmd or the
workbench, you are attaching to the normal instance which runs as
networkservice by default. The problem is probably that network service
doesn't have write permission on the mdf and ldf files for your database.
There's more information about user instances here:
http://msdn.microsoft.com/library/d...>
userinst.asp
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Bob" <.> wrote in message news:u6TZOGoLHHA.4244@.TK2MSFTNGP04.phx.gbl...
> Hi, thanks for replying. I thing i become crazy. I desinstalled and
> reinstalled it 2 times, but it still doen't work.
> Yes, i have the ldf file.
> When i click on ADD button, i get an error telling me that "cannot access
> the sprecified path etc ...Verify that you have specific privileges ..."
> I tried to add "myserver\aspnet" as account (server properties,
> permissions), but then, it's always un recognized ...
> I did sqlcmd -S myserver in the dos-box and i get:" name pipes provider:
> could not open a connection to SQL Server"
> And when i start an asp.net application, i get the error: "
> An attempt to attach an auto-named database for file C:\myapp\my.mdf
> failed. A database with the same name exists, or specified file cannot be
> opened, or it is located on UNC share.
> The only way it works is when doing ctrl-f5 in an application within VWD.
>
>
> "Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> schreef in bericht
> news:uKalp4eLHHA.4244@.TK2MSFTNGP04.phx.gbl...
>|||Hi, thanks for replying.
I started from the beginning but still with problems.
I post a new thread therefore.
"Hari Prasad" <hari_prasad_k@.hotmail.com> schreef in bericht
news:e08sUAfLHHA.780@.TK2MSFTNGP03.phx.gbl...
> Hello,
> In the SQL Server management studio express; go to query window and
> execute SP_ATTACH_DB if you have both MDF and LDF files. If you have only
> MDF file
> try sp_attach_single_file_db command. Take a look into books online for
> usage.
> Thanks
> Hari
>
> "Bob" <.> wrote in message news:u1RLbzeLHHA.1424@.TK2MSFTNGP04.phx.gbl...
>
Wednesday, March 21, 2012
How to add/(connect to) database in SQL Server 2005 Express?
I just downloaded and installed the Visual Web Developer 2005 Express which is part of the new issued Visual Studio 2005 Express. It includes SQL Server 2005 Express, so I also installed it.
My problem is I can't connect to the database supported by SQL Server Express. The log in is failed.
I hope anyone who is using SQL Server Express can give me a help and tell me what wrong I've done.
What I've done are:
1. In the Database Explorer, right-click the Data Connections, I create a new database named "lavender", so it's "lavender.mdf".
2. Then I go to Tools->"connection to database...",
(1) then in the pop-up window, I chose the "Data Source" as "MS SQL Server Database File(SqlClient)". I ever tried to select "MS SQL Server", but it couldn't pass through the following step(4), not sure if SQL Server Express can only be chosen under "MS SQL Server Database File"?;
(2) Then database file name, which is to attach to the SQL Express Server, is "C:\Inetpub\wwwroot\lavender\App_Data\lavender.mdf";
(3) Then "log on to Server", I use "Windows authentication";
(4) Then I "test the connection", it works.
3. Then I create some table in the lavender.mdf database under the Database Explorer.
But when I run the connection.Open() code and some other sql codes inside a vb file in this lavender project, it can "successfully build" Website without error, but can't show me results in IE6, only shows me the following error:
Server Error in '/lavender' Application.
Cannot open database "lavender" requested by the login. The login failed.
Login failed for user 'HENRYPC\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Cannot open database "lavender" requested by the login. The login failed.
Login failed for user 'HENRYPC\ASPNET'.
Source Error:
Line 8: Dim command As New SqlCommand("GetDepartments", connection) Line 9: command.CommandType = Data.CommandType.StoredProcedure Line 10: connection.Open() Line 11: Return command.ExecuteReader(System.Data.CommandBehavior.CloseConnection) Line 12: End FunctionSource File: c:\inetpub\wwwroot\lavender\App_Code\Catalog.vb Line: 10
Stack Trace:
[SqlException (0x80131904): Cannot open database "lavender" requested by the login. The login failed. Login failed for user 'HENRYPC\ASPNET'.] I tried many different ways to connect to my "lavender" database before I seek help here. Really feel tired and don't know which point I've configured wrong.
I have windows IIS, and the Website can show up if there is no these sql codes or no need to connect to database. I am still not clear if my lavender database is already located in the SQL Server Express. If already there, how can I connect to it? Why log in fail while I am the only user of my computer and using Windows Authentication?
Thank you very much for your help! Have a good week!
Henry LiHenry,
I don't pretend to be a sql guru, but something that looks odd, is that in your error, it is indicating attempting to use windows authentication with the ASPNET user account. Even though you are the one logged onto your box, IIS uses the ASPNET to run .Net applications, not your userid. You will need to give the ASPNET account access to your database if you want to use windows authentication. I would imagine that you have set your database up to just allow your userid access.
Incidentally the reason, it works in Visual Studio is that Visual Studio authenticates using the credentials of the person logged into the box. Hence it is using your user account.
Either add ASPNET to your database or create a new login and password in SQL Server and don't use windows authentication.|||Hello Jon,
Really thanks for your quick help! I reckon you've already found out where I'd done wrong.
I just wish you could give me a detailed instructions how to add the ASPNET into my database account. And sorry as I am a beginner just setting up the SQL Server (Express) and VS Express, also a beginner handling with database or server.
And when you said "ASPNET account access to my database", do you mean my whole database or just my lavender.mdf data file(it's a single file holding a lot of forms & stored procedures inside it)?
If you mean my whole database, do you mean my SQL Server Express, are these two the same thing? I am also curious whether my lavender.mdf is already in my SQL Server database.
What I want to know most is how and where to set up the ASPNET account in my database (or in my SQL Server Express?). Could you please kindly tell me in details? Thank you in advance. I am not going to set it as SQL authentication with User ID & password at this moment, just because I am not so sure if I can do it well.
By the way, how to set the paramenters in the web.confi file? Is the code below correct?
<appSettings>
<add key="ConnectionString" value="Server=.\SQLEXPRESS;Integrated Security=True;Database=lavender.mdf" />
</appSettings>
Thank you very much indeed!
Henry Li|||Henry,
At the present time, I'm having issues with my SQL Server install as well, so I'm afraid I can't give you a clear walk through of adding the necessary security permissions to your server.
However, for the moment, I can answer some of your questions.
First off, when I referred to database, I was referring to your lavendar.mdf database. SQL Server Express is an engine that can contain multiple databases. Each *.mdf file is considered an individual database that SQL Server Express understands.
Second, while it is possible to add security to all your databases, if you're going to use windows authentication, it would be best to add just the individual account to the individual database. That way you don't open up holes to all your other databases you might have or create in the future.
Thirdly, I'm very familiar with how to add security to a database in SQL Server 2000, but I'd hesitate to tell you that is how it is done in SQL Server Express. As soon as I can get mine installed and working correctly, I'll let you know detailed steps.
On a side note, your connection string looks fine to me and the error you were getting also indicates that your web application can find the database just fine. It just can't authenticate to him.|||Hello Jon,
It's very nice of you. Thank you indeed!
Your reply gives me a better view of my problem.
Let me share how I install SQL Server Express.
I installed the SQL Server Express as a component of Visual Web Developer 2005 Express (440MB), free downloaded from microsoft.com. I don't know what problem you met with your installation, and as I am not a professional, I am happy to tell what I've done but not sure if it will help.
Visual Web Developer 2005 Express is part of recent release of the Visual Studio 2005 Express, it's a single file WEB.img(440MB), I downloaded it and then used the Nero Burn Room CD burning software to burn it into a CD, then it became scores of files. Then it started automatically the installation, which includes 4 components, the Windows installer 3.1, the VWebDep Express, MSDN Express, and SQL Server 2005 Express.
As I just upgraded my computer from XP Home to XP professional 4 days ago, and just set it up as a local server with the help of IIS 3 days ago, I don't know how to configure the database and the connection. I also got the MSQL Desktop Engine(MSDE) installed in my computer 3 days ago before I installed the SQL Express, they get on well with each other very well.
--
I wish you could give me a hint how you configure your SQL Server 2000, so that I can have some idea how to deal with the Express.
What I've done with SQL Express is: (but can't go throught):
I opened the "SQL Server Configuration Manager" and tried to find where I can configure database log on. Under the "SQL 2005 Server Service" -> "SQL Server(SQLEXPRESS)", right-click it for properties, it gives me 3 tabs.
One tab is "Log on as", there are 2 choices, one is "built-in account" which include 3 choices, local system, local service, and nextwork service.
The other choice is "this account" with account name and password and confirm password for me to enter. I don't know what it means. Is it for the system admin to log in or for creation of endusers' log-in? It has a "browse" button beside account name to browse some names.
But when I enter ASPNET as an account name, and give it a new password, it refresh the Server Express then pop me a window "The specified network password is not correct". Then I don't know how to deal with it.
The other two tabs are "service" about binary path and starting mode etc, and "advanced" about clustered, startup parameters, registry root, etc. No idea about it.
I hope you will work on well with you installation, and hope you could give me a hint about your log-in configuration of Server 2000 as your explanation I find is always very clear!!
Thank you in advance, have a nice day!
Henry Li|||Hello Jon,
I just installed the MS SQL Server Management Studio Express (CTP), and I found there are plenty of options inside to set up security and add new databases!
Thanks a lot!
I added a HENRYPC\ASPNET user besides other Buildin\users and sa, etc. Then I found under the DATABASES, I just got system databases, then I created a "EXPRESSDATA" for my own use.
Then I modify the connection in the Visual Web Developer Express under the Database Explorer. It connects successfully to the EXPRESSDATA under the .\SQLEXPRESS data source!
And I still got one error when I run the project in the IE6 browser: can't find the stored procedures "GetDepartments". So it seems it connects! but maybe there is still some issue related to these tedious connection, because I have the stored procedure there under the "lavender.mdf" database, but can't see it in the Management Studio Express.
I am still trying to solve it. Thanks a lot for your help! Now I have a clearer understanding of these complicated connections.
Best wishes,
henry Li|||Henry,
I'm glad you've figured your connection stuff out. I'm glad to know that what you were looking for was in the Management Studio. I kind of thought it might be, but I still haven't been able to get my install working to verify it.
The reason it can't find your stored procedure is that you hooked up to a new database called ExpressData instead of your lavender database. Your stored procedure resides in lavender instead of ExpressData.
The best thing to do would be to try to get Management Studio express to see your lavender database. You should be able to do this by right clicking on the databases tab or folder and there should be an option to attach or import an existing database. Again, I don't have it installed, but that is how it functions in SQL Server 2000.
If you can get the lavender database seen in Management studio, then you'll want to change your configuration file to look at that database again instead of ExpressData. In addition, you'll want to add the aspnet account to have access to the lavender database.
Again, once I can get my install working I'll be able to provide you with specific steps. Good luck!
Friday, March 9, 2012
how to add data to my tables (was "SQL Server Newbie")
I'm not sure how to add data to my tables. In MS Access, you can edit the table and add records. How do I do that in SQL Server?
I'm using the Enterprise manager tool to create tables... does it have something i can use?
ThanksThe sky's the limit on how you can add and edit data in SQL tables, but comparable to what you said about editing tables in access... In EM, you can right click a table then select to open table and return all rows, top or specifiy a query. (I usually use top 1 if I plan on adding rows)
I would advise using query analyzer to do any editing though. Much easier and more efficient IMHO.|||When I try to return rows by right clicking on the table, i get an error that says:
An unexpected error happened during this operation.
Query Designer encountered a Query Error: Unspecified error.
??|||If all else fails, and you have primary keys on your tables, you can always just link the tables in MS Access. As Dr_Clong advised, though, you probably want to pick up a book on Transact-SQL. I liked Sams Publishing's "Teach Yourself in 21 Days" book.|||ok... so it sounds like i have to write sql INSERT statements to add data...??
Sorry if that's a dumb question.
I'll look up some books on transact sql.|||I don't know your setup or for that matter what could be causing your error, but I agree the best way to start out is by educating yourself on SQL Server tools and TSQL.|||1. Stop using Enterprise Manager
2. Start Using Query Analyzer
3. Open Books Online and Leave it Open
4. INSERT INTO myTable99(Col1, Col2, Col3) SELECT 'x','y','z'
5. Or bcp data in from flat files
6. Have a Margarita!
7. Post here often
8. Have Another Margarita
9. Go to 8.
Sunday, February 19, 2012
How to access to database with c# using DSN
Hello, im new in c# language.
Can someone show me, step by step(with simples code) how can i connect to a DSN connection that aconfigure in my odbc connection in my machine, to connect to mydatabase ?
I need only a simple class that use a DSN connection to retreive information from the database.
Best regards
You don't want to use a System DSN. A System DSN uses ODBC which is a wrapper for OLE DB, meaning that you're talking about a lot of unnecessary overhead. The .Net System.Data.SqlClient classes talk directly to the SQL Server, without having to use OLE DB OR ODBC. Instead, you need to figure out how to build your Connection correctly.
TryConnectionStrings.com.
|||Im not use SQL server, my database is db2 in AS/400.
Do u know how to connect directly to an as/400 database ?
|||Hi,
From you description, it seems that you want to connect to your DB2 database by using DSN, right?
I suggest that you can try DB2OdbcFileConnectionString class which describes a DB2 ODBC file connection string.
To create a DSN file and associated connection string
Call the constructor for DB2OdbcFileConnectionString, DB2OdbcSysConnectionString, or DB2OdbcUserConnectionString.
Calling the constructor creates a connection string with default settings. These default settings can be set only through the Data Access Tool user interface.
If you use a file path for a file that currently exists, the system loads the connection string information in that file instead.
Fill in the relevant connection string properties with a call to the properties of the object created.
You can also fill in the connection string with GetString, which returns the connection string as a text string. Once you finish modifying the relevant values, you can return the connection string to the object with a call to SetString.
Save the connection string information back into storage with a call to Save.
For more information, see:
http://msdn2.microsoft.com/en-us/library/ms945575.aspx
Thanks.
How to access SQL Server 2005 with Query Analyzer (SQL 2000)
from an XP Pro machine running MS SQL 2000. I'm able to connect to the SQL
2005 server and display all objects in the Object Browser but can't run a
simple query. Any ideas?
By the way, I'm connecting with a new SQL account I created in SQL 2005 with
full rights.
What error message(s) are you getting?
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"Sal Young" <SalYoung@.discussions.microsoft.com> wrote in message
news:9BCEACF4-3E33-48B2-AB00-70AF2D087F5D@.microsoft.com...
> I'm not able to run queries on a MS SQL Server 2005 using the Query
> Analyzer
> from an XP Pro machine running MS SQL 2000. I'm able to connect to the
> SQL
> 2005 server and display all objects in the Object Browser but can't run a
> simple query. Any ideas?
> By the way, I'm connecting with a new SQL account I created in SQL 2005
> with
> full rights.
|||I'm running the following select statement to get a table does not exist error:
SELECT * FROM Address
"Gail Erickson [MS]" wrote:
> What error message(s) are you getting?
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> "Sal Young" <SalYoung@.discussions.microsoft.com> wrote in message
> news:9BCEACF4-3E33-48B2-AB00-70AF2D087F5D@.microsoft.com...
>
>
|||Sal Young wrote:
> I'm running the following select statement to get a table does not
> exist error:
> SELECT * FROM Address
>
I believe this was already addressed in another post (unless we're
dealing with two identifical posts from two users).
SQL Server databases use the concept of schemas. That is, objects may or
may not be owned by "dbo" - the general default from prior SQL versions.
Because of this, the schema must be supplied so SQL Server knows where
to look. The Address table in the AdventureWorks database is contained
in the Person schema. So try:
Select * from Person.Address
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Query Analyzer does not fully support new SQL Server 2005 features. For
example, it does not recognize schema names in the Object Browser. So when
you look at the AdventureWorks objects in the Object Browser of QA, they all
appear to belong to dbo even though very few objects actually do. If you
want to continue to use QA for 2005 databases, you'll need to keep that in
mind. The SQL Server 2005 Books Online topic "AdventureWorks Data
Dictionary" lists all the tables and the schemas they are contained in.
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:%234sqZta1FHA.4032@.TK2MSFTNGP15.phx.gbl...
> Sal Young wrote:
> I believe this was already addressed in another post (unless we're dealing
> with two identifical posts from two users).
> SQL Server databases use the concept of schemas. That is, objects may or
> may not be owned by "dbo" - the general default from prior SQL versions.
> Because of this, the schema must be supplied so SQL Server knows where to
> look. The Address table in the AdventureWorks database is contained in the
> Person schema. So try:
> Select * from Person.Address
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
|||I may just be me but I honestly think the SQL Server Management Studio is one
of the worst tool I have ever used. I wish they still had enterprise manager
and query analyzer for 2005. The new tools are so slow an bloated.
"Gail Erickson [MS]" wrote:
> Query Analyzer does not fully support new SQL Server 2005 features. For
> example, it does not recognize schema names in the Object Browser. So when
> you look at the AdventureWorks objects in the Object Browser of QA, they all
> appear to belong to dbo even though very few objects actually do. If you
> want to continue to use QA for 2005 databases, you'll need to keep that in
> mind. The SQL Server 2005 Books Online topic "AdventureWorks Data
> Dictionary" lists all the tables and the schemas they are contained in.
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> "David Gugick" <david.gugick-nospam@.quest.com> wrote in message
> news:%234sqZta1FHA.4032@.TK2MSFTNGP15.phx.gbl...
>
>