Northwind数据库的服务器名称 [英] Server name for the Northwind database

查看:71
本文介绍了Northwind数据库的服务器名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我想知道是否有人可以提供帮助!



我是使用SQL Server Mangement Studio 2008访问Northwind数据库。我需要使用哪个Sever名称来访问Northwind数据库?单击连接时,收到无法连接到本地的错误消息。



当我出错时,你可以告诉我吗?



提前致谢。



Awais

解决方案

是 - 你要么试图通过SQL服务器连接到数据库没有安装(可能不需要它)或者你没有正确指定服务器实例。



因为你标记了这个SQL-Server我假设您确实希望通过SQL服务器访问数据库,因此您需要做的第一件事就是连接它。如果您运行SSMS,您将进入连接到服务器对话框。确保服务器类型设置为数据库引擎,然后尝试打开服务器名称下拉菜单 - 运气好,您的实例将出现在那里。如果它没有(您没有显示命名实例),请单击浏览更多选项,它应该打开一个新对话框以便您找到它。如果您在自己的电脑上安装了SQL服务器,那么它将是本地服务器,否则它将是网络服务器。

当您选择了正确的服务器并登录后,然后可以通过对象资源管理器附加你的数据库(如果它还没有) - 但先连接然后再担心!


是否安装了Northwind数据库?



你知道Northwind数据库有点过时了。我建议你从MS站点下载一个更新的SQL Server开发样本目标...说冒险工具。



顺便说一下,你的标签是专门的,而且是单独的,Sql-Server。如果你没有概括并在汤中加入更多的豌豆,你在Q& A中得到的唯一答案就是在那个狭窄的绿色范围内。





Ok Awais ...

1.从codeplex下载Northwind.sql.zip - > http://northwinddatabase.codeplex.com/releases/view/71634 [ ^ ]

2.将.sql文件解压缩到一个目录中您的安装驱动器。

3.使用SQL Server Management Studio(尝试)打开名为Northwind.sql的脚本

4.棘手的部分在这里...在一个打开的情况将导致文件的记事本再现。没关系。但是你想把你在那里看到的那个脚本打印在INTO ssms编辑器页面上作为一个可行的,编码的.sql脚本。

现在,你可以尝试再次证明所有系统都是不同的,它可能适合你(不适合我),使用猜测编码打开这个解压缩的脚本。它将在ssms中打开..但是代码不会被ssms读取。通过可读,我的意思是可执行文件。

5.最棘手的部分(你/我的方式)。只需使用记事本打开解压缩的Northwind.sql,按Ctrl + A打开整个文本,单击新建查询按钮在ssms编辑器窗口中创建脚本空间,然后粘贴此复制的文本。您会注意到代码已着色。

6.在您F5这个(完整的)可行脚本之前,您必须在您的机器上创建Northwind数据库。为此,在对象浏览器中右键单击数据库文件夹(其树视图)并选择新建数据库。在弹出窗口中填写数据库名称Northwind并点击OK。

7.我想到你甚至没有在你的机器上运行SQL Server的实例。在这种情况下,在执行上述任何操作之前,请访问Microsoft站点并下载任何(非常强大的)SQL Server包。我建议使用高级服务的SQL Server 2008 R2 64位。可能有一个Book on Line的帮助文件,通常用BOL作为说明。

8.祝你好运。

[结束]编辑]

Hi there,

I''m wondering if someone can help!

I am using SQL Server Mangement Studio 2008 to access the Northwind database. What is the Sever name I need to use to access the Northwind database? I get an error message saying "Cannot connect to local" when I click on Connect.

Can you please let me know when I am going wrong?

Thanks in advance.

Awais

解决方案

Yes - you are either trying to connect to the database via SQL server when you don''t have it installed (and possibly don''t need it) or you aren''t specifying the server instance correctly.

Since you tagged this SQL-Server I will assume you do want to access the DB via SQL server, so the first thing you need to do is connect to it. If you run SSMS, you will be at the "Connect to Server" dialog. Make sure that the "Server type" is set to "Database Engine" then try to open the "Server name" drop down - with any luck your instance will appear there. If it doesn''t (you have no named instances showing) click the "Browse for more" selection and it should open a new dialog to let you find it. If you installed SQL server on your own pc, then it will be a "Local Server", otherwise it will be a "Network Server".
When you have selected the correct server and logged in, you can then attach your database (if it isn''t already) via the object explorer - but connect first and worry about that afterwards!


Is Northwind database even installed?

You DO know that Northwind database is somewhat dated. I suggest you download from the MS site a more current target for SQL Server development samples ... say AdventureWorks.

By the way, your tag is specifically, and solely, "Sql-Server". If you don''t generalize and add more peas to the soup, the only answers you''ll get here in Q&A are going to be within that narrow "green" scope.

[Edit]
Ok Awais ...
1. Download the Northwind.sql.zip from codeplex -> http://northwinddatabase.codeplex.com/releases/view/71634[^]
2. Unzip the .sql file into a directory on your installation drive.
3. Using SQL Server Management Studio (try to) open the script named "Northwind.sql"
4. Tricky part here ... in one case that "open" will result in a notepad rendition of the file. It''s ok. But you want to get that script that you see there printed on the page INTO ssms editor as a viable, encoded .sql script.
Now, you could try, again qualifying the fact that all systems are different, and it might work for you (doesn''t for me), opening this unzipped script USING "guess encoding". It will open in ssms .. BUT the code won''t be readable by ssms. And by readable I mean executable.
5. The least tricky part (thee/my way). Just open the unzipped Northwind.sql using notepad, Ctrl+A the entire text, Click on the "New Query" button to make a script space in the ssms editor window, and paste this copied text. You''ll notice that the code is colorized.
6. Before you "F5" this (entire) viable script, you''ve got to create the "Northwind" DB on your machine. To do that, in "Object Browser" right click on the "Database" folder (its a treeview) and select "New Database". In the popup fill in the Database name "Northwind" and hit OK.
7. The thought just occured to me that you don''t even have an instance of SQL Server running on your machine. In which case before you do any of the above stuff, go to the Microsoft site and download any of the (great, as in robust) SQL Server packages. I recommend SQL Server 2008 R2 64-bit with Advanced Services. There''s probably a help file that is a "Book on Line" commonly refered to in lay parlance as "BOL".
8. Good luck.
[End edit]


这篇关于Northwind数据库的服务器名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆