通过t-sql脚本启用TCP / IP协议?

时间:2022-02-05 07:54:44

How to enable tcp/ip through t-sql script on sql server 2008?

如何在sql server 2008上通过t-sql脚本启用tcp / ip?

3 个解决方案

#1


In order to do that using a t-sql script, you might have to fiddle with the registry settings. I haven't done that before myself using t-sql so can't be of much help. But you may like to look up for xp_instance_regread and xp_instance_regwrite. They are extended stored procedures which allow you to read/write registry values.

为了使用t-sql脚本执行此操作,您可能必须使用注册表设置。我在使用t-sql之前没有这样做,所以不能提供太多帮助。但您可能希望查找xp_instance_regread和xp_instance_regwrite。它们是扩展存储过程,允许您读/写注册表值。

Here is an example which might be of some help - http://codebetter.com/blogs/raymond.lewallen/archive/2005/09/12/131869.aspx

这是一个可能有所帮助的例子 - http://codebetter.com/blogs/raymond.lewallen/archive/2005/09/12/131869.aspx

The following links should help you locate the whereabouts of TCP/IP settings in the registry. http://support.microsoft.com/kb/315236

以下链接可帮助您找到注册表中TCP / IP设置的位置。 http://support.microsoft.com/kb/315236

http://www.pctools.com/guides/registry/detail/1171/

cheers

#2


ALTER ENDPOINT [TSQL Default TCP] STATE = STOPPED;

I reckon though I'm not sure if they fix it to actually work in 2k8. In 2k5 this was a no-op. I don't have a 2k8 instance to test it.

我估计虽然我不确定他们是否确定它在2k8中实际工作。在2k5这是一个无操作。我没有2k8实例来测试它。

#3


In order to enable TCP/IP, you'd have to configure Sql Server and open the Windows firewall. I'd think that can't be done from T-SQL.

要启用TCP / IP,您必须配置Sql Server并打开Windows防火墙。我认为无法通过T-SQL完成。

Here's a link on how to dynamically configure Sql Server using DMO. That works from any language that supports ActiveX, for example VBScript, or any .NET language. http://support.microsoft.com/kb/822642

这是一个如何使用DMO动态配置Sql Server的链接。这适用于任何支持ActiveX的语言,例如VBScript或任何.NET语言。 http://support.microsoft.com/kb/822642

Here's how to open the Windows firewall programmatically: http://support.microsoft.com/kb/839980

以下是以编程方式打开Windows防火墙的方法:http://support.microsoft.com/kb/839980

#1


In order to do that using a t-sql script, you might have to fiddle with the registry settings. I haven't done that before myself using t-sql so can't be of much help. But you may like to look up for xp_instance_regread and xp_instance_regwrite. They are extended stored procedures which allow you to read/write registry values.

为了使用t-sql脚本执行此操作,您可能必须使用注册表设置。我在使用t-sql之前没有这样做,所以不能提供太多帮助。但您可能希望查找xp_instance_regread和xp_instance_regwrite。它们是扩展存储过程,允许您读/写注册表值。

Here is an example which might be of some help - http://codebetter.com/blogs/raymond.lewallen/archive/2005/09/12/131869.aspx

这是一个可能有所帮助的例子 - http://codebetter.com/blogs/raymond.lewallen/archive/2005/09/12/131869.aspx

The following links should help you locate the whereabouts of TCP/IP settings in the registry. http://support.microsoft.com/kb/315236

以下链接可帮助您找到注册表中TCP / IP设置的位置。 http://support.microsoft.com/kb/315236

http://www.pctools.com/guides/registry/detail/1171/

cheers

#2


ALTER ENDPOINT [TSQL Default TCP] STATE = STOPPED;

I reckon though I'm not sure if they fix it to actually work in 2k8. In 2k5 this was a no-op. I don't have a 2k8 instance to test it.

我估计虽然我不确定他们是否确定它在2k8中实际工作。在2k5这是一个无操作。我没有2k8实例来测试它。

#3


In order to enable TCP/IP, you'd have to configure Sql Server and open the Windows firewall. I'd think that can't be done from T-SQL.

要启用TCP / IP,您必须配置Sql Server并打开Windows防火墙。我认为无法通过T-SQL完成。

Here's a link on how to dynamically configure Sql Server using DMO. That works from any language that supports ActiveX, for example VBScript, or any .NET language. http://support.microsoft.com/kb/822642

这是一个如何使用DMO动态配置Sql Server的链接。这适用于任何支持ActiveX的语言,例如VBScript或任何.NET语言。 http://support.microsoft.com/kb/822642

Here's how to open the Windows firewall programmatically: http://support.microsoft.com/kb/839980

以下是以编程方式打开Windows防火墙的方法:http://support.microsoft.com/kb/839980