简体   繁体   English

如何使用MS Server Management Studio和ODBC连接到MS SQL数据库

[英]How to connect to a MS SQL database using MS Server Management Studio and ODBC

I need to connect to a MS SQL Server, using MS Management Studio, the hosting company only provided me the ODBC connection for this database, but I can see it only connecting using VPN on the Server. 我需要使用MS Management Studio连接到MS SQL Server,托管公司只为我提供了该数据库的ODBC连接,但是我只能在服务器上使用VPN看到它。

My question: - Can I connect to the DB using MS MS Management Studio through ODBC? 我的问题:-是否可以通过ODBC使用MS MS Management Studio连接到数据库?

I usually use SQL Server Authentication or Windows Authentication. 我通常使用SQL Server身份验证或Windows身份验证。

Thanks for your time. 谢谢你的时间。

I don't believe that you can connect directly to the odbc connection in SSMS, although you can connect to a SQL server, and add a linked server to the odbc connection. 我不相信您可以直接连接到SSMS中的odbc连接,尽管您可以连接到SQL Server,并将链接的服务器添加到odbc连接。 You would open the server objects -> Linked servers -> Add 您将打开服务器对象->链接服务器->添加

From the provider list choose Microsoft OLE DB Provider for ODBC Drivers 从提供程序列表中选择用于ODBC驱动程序的Microsoft OLE DB提供程序

I think the details will vary depending on if this is a System DSN or File DSN but here's the msdn. 我认为细节会有所不同,具体取决于这是系统DSN还是文件DSN,但这是msdn。 http://msdn.microsoft.com/en-us/library/windows/desktop/ms675326(v=vs.85).aspx http://msdn.microsoft.com/zh-CN/library/windows/desktop/ms675326(v=vs.85).aspx

Then you can query against the data source by opening a new query against your sql server and using the full four part name ie 然后,您可以通过对您的sql server打开一个新查询并使用完整的四部分名称来查询数据源,即

SELECT * FROM ServerName.DatabaseName.SchemaName.TableName 选择* FROM ServerName.DatabaseName.SchemaName.TableName

Another option would be using VS 2012 to add a Data Connection to the ODBC data source. 另一个选择是使用VS 2012将数据连接添加到ODBC数据源。 This would be the cleanest although it doesn't directly address the question. 尽管它不能直接解决问题,但这将是最干净的方法。

Possibly. 可能吧。 The ODBC connection will contain all the information you neeed - the server address or IP address, a user name and a password. ODBC连接将包含您需要的所有信息-服务器地址或IP地址,用户名和密码。

But there may be a firewall on your host preventing such connections. 但是主机上可能有防火墙阻止此类连接。

Try it. 试试吧。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 R 中的 ODBC 和 DBI 连接到 MS SQL 服务器 - How to connect to MS SQL Server using ODBC and DBI in R 如何在不使用 MS SQL Server Management Studio 的情况下更改 SQL 服务器中的默认数据库? - How to change default database in SQL Server without using MS SQL Server Management Studio? 如何使用SQLCMD中的Windows凭据连接到MS SQL Server Management Studio中的服务器 - how to connect to servers in MS SQL Server Management Studio using windows credential in SQLCMD 在MS SQL Server Management Studio中使用LIKE - Using LIKE in ms sql server management studio 如何使用MS SQL Server Management Studio删除SQL数据库表中的前导空白空间 - How to delete leading empty space in a SQL Database Table using MS SQL Server Management Studio 在没有 Microsoft ODBC 库的情况下使用 PHP 连接到 MS SQL 数据库 - Connect to a MS SQL database using PHP without Microsoft ODBC libraries 无法通过 MS Sql Management Studio 连接到本地主机服务器 - Can not connect to localhost Server via MS Sql Management Studio 有什么方法可以使用Management Studio 2005连接到MS SQL Server 2008? - Is there any way to connect to MS SQL Server 2008 using Management Studio 2005? 如何使用 php 将 opencart 应用程序连接到 ms sql server 数据库? - How to connect an opencart application to an ms sql server database using php? 如何使用 py(py)odbc 从 python 连接到远程 MS SQL Server - How to connect to remote MS SQL Server from python using py(py)odbc
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM