Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Wednesday, March 21, 2012

Encrypting the configuration file values stored in SQL server

Hi All,

I have the following requirement. I need to store the password for the connection manager in the configuration file. The sink for the configuration file is SQL Server. Though the password field appears as "******" the actual value is being taken as ""******" itself. If i update the SQL server table with the correct value, then the package starts working. But, the password is shown as clear text.

If i write logic to encrypt the password column in the configuration table, is there a way to tell the SSIS execute engine to decrypt the password before using the same for making the connection.

Is there a place holder, where i can write the decrypt code so that the decrypted password can be sent to the execution engine?

Thanks In Advance,

Madhu

I think the short answer to this is no, and no code hooks either.

I think though that there is also an argument, that says it would not be more secure than what you have now. If you encrypt the data, you need to then secure the key. So what will you do to secure the key? Why not use strong security to secure the password data instead of worrying about how to secure the key? I accept that the encryption adds an extra step, but I'm not convinced it will actually be any safer.

|||I'm not sure if it's a good idea, but couldn't he create a script task to decrypt the password and reset the connection manager's connectionstring property before the connection manager is used in the package?|||

Yes and no. Some connections are used before your script task could run, such as connections used for logging.

How would you secure the key used to decrypt the password? You need to secure the encryption/decryption key, so why not just secure the password to start with?

|||DarrenSQLIS is right the recommended way to do this is to store the password in the connection. SSIS will automatically encrypt these so that they are not stored in cleartext.|||Thanks for the thoughts Darren. As suggested by you, way to go is to store the password in SQL server and make sure that the access to the configuration table is only for administrators.|||

Denise, I think you are talking about the package level encryption, protection levels and such like. Nice though it is, it is not very useful, as I think you should "externalise" any kind of security information.

Using package encryption becomes unfeasible when you have to migrate packages between environments. Configurations solve that migration issue, but don't give you the encryption that is often seen as a requirement for some organisations. I'd argue that is should not be a big deal, secure the password so you don't have to worry about the key, but often it is an internal "standard" that must be complied with.

Still we have the choice of package encryption, which is better than not!

Sunday, March 11, 2012

Encrypted Connection

Hi all,
If this is not the correct groups to post this, please redirect me.
I have a .NET application and SQL Server 2005 Express running on a Windows
Server 2003 Web Edition. Both connect to a remote SQL Server 2000 database
running on Windows 2000.
SQL Server Express 2005 has the 2000 server set up as a linked server.
What are my options for encrypting the connections to the SQL Server 2000?
For the .NET app, I assume that I can use multiprotocol. Correct? Other
suggestions?
What about the SQL Server 2005 linked server to 2000?
TIA
AG
Email: discuss at adhdata dot com
SQL Server supports SSL encryption for connections. See the following
articles:
http://support.microsoft.com/kb/276553
http://msdn2.microsoft.com/en-us/library/ms189067.aspx
http://msdn2.microsoft.com/en-us/library/ms191192.aspx
Regards,
Plamen Ratchev
http://www.SQLStudio.com
"AG" <NOSPAMa-giam@.newsgroups.nospam> wrote in message
news:%23JeihNoKHHA.960@.TK2MSFTNGP04.phx.gbl...
> Hi all,
> If this is not the correct groups to post this, please redirect me.
> I have a .NET application and SQL Server 2005 Express running on a Windows
> Server 2003 Web Edition. Both connect to a remote SQL Server 2000 database
> running on Windows 2000.
> SQL Server Express 2005 has the 2000 server set up as a linked server.
> What are my options for encrypting the connections to the SQL Server 2000?
> For the .NET app, I assume that I can use multiprotocol. Correct? Other
> suggestions?
> What about the SQL Server 2005 linked server to 2000?
> TIA
> --
> AG
> Email: discuss at adhdata dot com
>
>
|||Thanks for the quick response Plamen,
That all requires a SSL cert, which the 2000 server does not have.
Is there some way to use multiprotocol with the linked server?
The current setup is using a VPN, but we are moving to a new server and
there may be a problem setting up a VPN.
AG
Email: discuss at adhdata dot com
"Plamen Ratchev" <Plamen@.SQLStudio.com> wrote in message
news:Oyn6mApKHHA.4992@.TK2MSFTNGP04.phx.gbl...
> SQL Server supports SSL encryption for connections. See the following
> articles:
> http://support.microsoft.com/kb/276553
> http://msdn2.microsoft.com/en-us/library/ms189067.aspx
> http://msdn2.microsoft.com/en-us/library/ms191192.aspx
> Regards,
> Plamen Ratchev
> http://www.SQLStudio.com
>
> "AG" <NOSPAMa-giam@.newsgroups.nospam> wrote in message
> news:%23JeihNoKHHA.960@.TK2MSFTNGP04.phx.gbl...
>
|||The multiprotocol has been depreciated in SQL Server 2005. See this post for
details (look under the Changes section):
http://blogs.msdn.com/sql_protocols/archive/2005/09/22/473111.aspx
If you do not have a local Certificate Server you can always purchase a
third-party certificate.
Regards,
Plamen Ratchev
http://www.SQLStudio.com
"AG" <NOSPAMa-giam@.newsgroups.nospam> wrote in message
news:%23kAVctpKHHA.4384@.TK2MSFTNGP03.phx.gbl...
> Thanks for the quick response Plamen,
> That all requires a SSL cert, which the 2000 server does not have.
> Is there some way to use multiprotocol with the linked server?
> The current setup is using a VPN, but we are moving to a new server and
> there may be a problem setting up a VPN.
> --
> AG
> Email: discuss at adhdata dot com
>
> "Plamen Ratchev" <Plamen@.SQLStudio.com> wrote in message
> news:Oyn6mApKHHA.4992@.TK2MSFTNGP04.phx.gbl...
>
|||Hello AG,
I agree with Plamen that you could use a third party certificate if
necessary.
Also, you may consider configure IPsec between the servers so that all IP
traffic is protected between them. Pleas esee the following articles for
more details:
TechNet Support WebCast: How to use IPSec to help secure network traffic
http://support.microsoft.com/default.aspx?kbid=888266
IPsec
http://www.microsoft.com/technet/network/ipsec/default.mspx
If you have further comments or feedback, please feel free to let's know.
Thank you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Thanks Peter,
Sorry, I did not get back to you sooner. I wanted to get the client's
networking person involved and that will happen today.
IPsec looks like it might do the job.
AG
Email: discuss at adhdata dot com
"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:Jj1YdPvKHHA.2304@.TK2MSFTNGHUB02.phx.gbl...
> Hello AG,
> I agree with Plamen that you could use a third party certificate if
> necessary.
> Also, you may consider configure IPsec between the servers so that all IP
> traffic is protected between them. Pleas esee the following articles for
> more details:
> TechNet Support WebCast: How to use IPSec to help secure network traffic
> http://support.microsoft.com/default.aspx?kbid=888266
> IPsec
> http://www.microsoft.com/technet/network/ipsec/default.mspx
> If you have further comments or feedback, please feel free to let's know.
> Thank you.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Community Support
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications
> <http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> <http://msdn.microsoft.com/subscriptions/support/default.aspx>.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>

Encrypted Connection

Hi all,
If this is not the correct groups to post this, please redirect me.
I have a .NET application and SQL Server 2005 Express running on a Windows
Server 2003 Web Edition. Both connect to a remote SQL Server 2000 database
running on Windows 2000.
SQL Server Express 2005 has the 2000 server set up as a linked server.
What are my options for encrypting the connections to the SQL Server 2000?
For the .NET app, I assume that I can use multiprotocol. Correct? Other
suggestions?
What about the SQL Server 2005 linked server to 2000?
TIA
AG
Email: discuss at adhdata dot comSQL Server supports SSL encryption for connections. See the following
articles:
http://support.microsoft.com/kb/276553
http://msdn2.microsoft.com/en-us/library/ms189067.aspx
http://msdn2.microsoft.com/en-us/library/ms191192.aspx
Regards,
Plamen Ratchev
http://www.SQLStudio.com
"AG" <NOSPAMa-giam@.newsgroups.nospam> wrote in message
news:%23JeihNoKHHA.960@.TK2MSFTNGP04.phx.gbl...
> Hi all,
> If this is not the correct groups to post this, please redirect me.
> I have a .NET application and SQL Server 2005 Express running on a Windows
> Server 2003 Web Edition. Both connect to a remote SQL Server 2000 database
> running on Windows 2000.
> SQL Server Express 2005 has the 2000 server set up as a linked server.
> What are my options for encrypting the connections to the SQL Server 2000?
> For the .NET app, I assume that I can use multiprotocol. Correct? Other
> suggestions?
> What about the SQL Server 2005 linked server to 2000?
> TIA
> --
> AG
> Email: discuss at adhdata dot com
>
>|||Thanks for the quick response Plamen,
That all requires a SSL cert, which the 2000 server does not have.
Is there some way to use multiprotocol with the linked server?
The current setup is using a VPN, but we are moving to a new server and
there may be a problem setting up a VPN.
AG
Email: discuss at adhdata dot com
"Plamen Ratchev" <Plamen@.SQLStudio.com> wrote in message
news:Oyn6mApKHHA.4992@.TK2MSFTNGP04.phx.gbl...
> SQL Server supports SSL encryption for connections. See the following
> articles:
> http://support.microsoft.com/kb/276553
> http://msdn2.microsoft.com/en-us/library/ms189067.aspx
> http://msdn2.microsoft.com/en-us/library/ms191192.aspx
> Regards,
> Plamen Ratchev
> http://www.SQLStudio.com
>
> "AG" <NOSPAMa-giam@.newsgroups.nospam> wrote in message
> news:%23JeihNoKHHA.960@.TK2MSFTNGP04.phx.gbl...
>|||The multiprotocol has been depreciated in SQL Server 2005. See this post for
details (look under the Changes section):
http://blogs.msdn.com/sql_protocols.../22/473111.aspx
If you do not have a local Certificate Server you can always purchase a
third-party certificate.
Regards,
Plamen Ratchev
http://www.SQLStudio.com
"AG" <NOSPAMa-giam@.newsgroups.nospam> wrote in message
news:%23kAVctpKHHA.4384@.TK2MSFTNGP03.phx.gbl...
> Thanks for the quick response Plamen,
> That all requires a SSL cert, which the 2000 server does not have.
> Is there some way to use multiprotocol with the linked server?
> The current setup is using a VPN, but we are moving to a new server and
> there may be a problem setting up a VPN.
> --
> AG
> Email: discuss at adhdata dot com
>
> "Plamen Ratchev" <Plamen@.SQLStudio.com> wrote in message
> news:Oyn6mApKHHA.4992@.TK2MSFTNGP04.phx.gbl...
>|||Hello AG,
I agree with Plamen that you could use a third party certificate if
necessary.
Also, you may consider configure IPsec between the servers so that all IP
traffic is protected between them. Pleas esee the following articles for
more details:
TechNet Support WebCast: How to use IPSec to help secure network traffic
http://support.microsoft.com/default.aspx?kbid=888266
IPsec
http://www.microsoft.com/technet/ne...ec/default.mspx
If you have further comments or feedback, please feel free to let's know.
Thank you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications
<http://msdn.microsoft.com/subscript...ps/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscript...rt/default.aspx>.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks Peter,
Sorry, I did not get back to you sooner. I wanted to get the client's
networking person involved and that will happen today.
IPsec looks like it might do the job.
AG
Email: discuss at adhdata dot com
"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:Jj1YdPvKHHA.2304@.TK2MSFTNGHUB02.phx.gbl...
> Hello AG,
> I agree with Plamen that you could use a third party certificate if
> necessary.
> Also, you may consider configure IPsec between the servers so that all IP
> traffic is protected between them. Pleas esee the following articles for
> more details:
> technet Support WebCast: How to use IPSec to help secure network traffic
> http://support.microsoft.com/default.aspx?kbid=888266
> IPsec
> http://www.microsoft.com/technet/ne...ec/default.mspx
> If you have further comments or feedback, please feel free to let's know.
> Thank you.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Community Support
> ========================================
==========
> Get notification to my posts through email? Please refer to
> l]
> ications
> <[url]http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx" target="_blank">http://msdn.microsoft.com/subscript...ps/default.aspx>.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> <http://msdn.microsoft.com/subscript...rt/default.aspx>.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>

Encrypted Connection

Hi all,
If this is not the correct groups to post this, please redirect me.
I have a .NET application and SQL Server 2005 Express running on a Windows
Server 2003 Web Edition. Both connect to a remote SQL Server 2000 database
running on Windows 2000.
SQL Server Express 2005 has the 2000 server set up as a linked server.
What are my options for encrypting the connections to the SQL Server 2000?
For the .NET app, I assume that I can use multiprotocol. Correct? Other
suggestions?
What about the SQL Server 2005 linked server to 2000?
TIA
AG
Email: discuss at adhdata dot comSQL Server supports SSL encryption for connections. See the following
articles:
http://support.microsoft.com/kb/276553
http://msdn2.microsoft.com/en-us/library/ms189067.aspx
http://msdn2.microsoft.com/en-us/library/ms191192.aspx
Regards,
Plamen Ratchev
http://www.SQLStudio.com
"AG" <NOSPAMa-giam@.newsgroups.nospam> wrote in message
news:%23JeihNoKHHA.960@.TK2MSFTNGP04.phx.gbl...
> Hi all,
> If this is not the correct groups to post this, please redirect me.
> I have a .NET application and SQL Server 2005 Express running on a Windows
> Server 2003 Web Edition. Both connect to a remote SQL Server 2000 database
> running on Windows 2000.
> SQL Server Express 2005 has the 2000 server set up as a linked server.
> What are my options for encrypting the connections to the SQL Server 2000?
> For the .NET app, I assume that I can use multiprotocol. Correct? Other
> suggestions?
> What about the SQL Server 2005 linked server to 2000?
> TIA
> --
> AG
> Email: discuss at adhdata dot com
>
>|||Thanks for the quick response Plamen,
That all requires a SSL cert, which the 2000 server does not have.
Is there some way to use multiprotocol with the linked server?
The current setup is using a VPN, but we are moving to a new server and
there may be a problem setting up a VPN.
AG
Email: discuss at adhdata dot com
"Plamen Ratchev" <Plamen@.SQLStudio.com> wrote in message
news:Oyn6mApKHHA.4992@.TK2MSFTNGP04.phx.gbl...
> SQL Server supports SSL encryption for connections. See the following
> articles:
> http://support.microsoft.com/kb/276553
> http://msdn2.microsoft.com/en-us/library/ms189067.aspx
> http://msdn2.microsoft.com/en-us/library/ms191192.aspx
> Regards,
> Plamen Ratchev
> http://www.SQLStudio.com
>
> "AG" <NOSPAMa-giam@.newsgroups.nospam> wrote in message
> news:%23JeihNoKHHA.960@.TK2MSFTNGP04.phx.gbl...
>|||The multiprotocol has been depreciated in SQL Server 2005. See this post for
details (look under the Changes section):
http://blogs.msdn.com/sql_protocols.../22/473111.aspx
If you do not have a local Certificate Server you can always purchase a
third-party certificate.
Regards,
Plamen Ratchev
http://www.SQLStudio.com
"AG" <NOSPAMa-giam@.newsgroups.nospam> wrote in message
news:%23kAVctpKHHA.4384@.TK2MSFTNGP03.phx.gbl...
> Thanks for the quick response Plamen,
> That all requires a SSL cert, which the 2000 server does not have.
> Is there some way to use multiprotocol with the linked server?
> The current setup is using a VPN, but we are moving to a new server and
> there may be a problem setting up a VPN.
> --
> AG
> Email: discuss at adhdata dot com
>
> "Plamen Ratchev" <Plamen@.SQLStudio.com> wrote in message
> news:Oyn6mApKHHA.4992@.TK2MSFTNGP04.phx.gbl...
>

Friday, March 9, 2012

Encrypt Connection with Certificate

I have been trying to create a certificate for use with SQL2005. I found openSSL to create a cert but I am not sure how to use it.

When I go into SQL Config Manager / Protocol Properties / Certificate Tab... I do not see any certificates. The list is empty. Where are these certs pulled from and how can I create one on my own?

Here are the Reqs:

Certificate Requirements

For SQL Server 2005 to load a SSL certificate, the certificate must meet the following conditions:

The certificate must be in either the local computer certificate store or the current user certificate store.

The current system time must be after the Valid from property of the certificate and before the Valid to property of the certificate.

The certificate must be meant for server authentication. This requires the Enhanced Key Usage property of the certificate to specify Server Authentication (1.3.6.1.5.5.7.3.1).

The certificate must be created by using the KeySpec option of AT_KEYEXCHANGE. Usually, the certificate's key usage property (KEY_USAGE) will also include key encipherment (CERT_KEY_ENCIPHERMENT_KEY_USAGE).

The Subject property of the certificate must indicate that the common name (CN) is the same as the host name or fully qualified domain name (FQDN) of the server computer. If SQL Server is running on a failover cluster, the common name must match the host name or FQDN of the virtual server and the certificates must be provisioned on all nodes in the failover cluster.http://msdn2.microsoft.com/en-us/library/ms187798.aspx|||Is this the cert that SQL is looking for? I thought it was a local computer cert generated through CA.|||Data Source=server.domain.com;Initial Catalog=master;User ID=SQLuser;Encrypt=True;TrustServerCertificate=Tru e

this works but I want to create my own cert.

Friday, February 24, 2012

Enable SQL Server Remote Connections via Script

Hi,
I am connecting to my SQL server 2005 database using a remote connection.
Can someone provide me with a SQL script which will enable connections
via TCP/IP to the database? (i.e. I'd like to do the step of going to
the configuration manager and enabling the TCP/IP protocol for the SQL
Server Instance using a SQL Script instead of doing through the UI).
Thanks in advance!
- ramaduHello Ramadu,
Thank you for posting in the MSDN newsgroup.
From your description, I understand that you're wondering how to configure
the SQL Server 2005 database instance's remote connectivity settings(the
allowed protocols) programmatically (through commandline or script file),
correct?
Based on my research, as for the remote connection setting, generally we
can configure it in the SQL Server 2005's "Surface Area Configuration" tool
which is a GUI component. However, it has a commandline version (SAC.EXE)
which can execute command based on a XML file, and the xml file can be
exported from an existing server and use the SAC.exe to
import the setting on another machine with SQL 2005.
#sac Utility
http://msdn2.microsoft.com/en-us/ms162800.aspx
And here is a web article which demonstrate on the most common
configuration tools in SQL SERVER 2005:
#SQL Server 2005 Management Tools
http://www.informit.com/guides/cont...seqNum=178&rl=1
Also, if you're familiar with WMI programming, you can have a look at the
new WMI provider interfaces provided in SQL SERVER 2005:
#WMI Provider for Configuration Management
http://msdn2.microsoft.com/en-us/library/ms180499.aspx
http://blogs.msdn.com/sql_protocols.../19/482840.aspx
Hope this helps.
Regards,
Steven Cheng
Microsoft MSDN Online Support Lead
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hi Steven,
I'm not looking for a command line tool. I am rather looking for a
Stored Procedure / SQL Script which I can execute using the Query
Analyzer to enable remote connections.
The reason for this is that we are in the process of migrating from SQL
Server 2000 to SQL Server 2005 and in our application we provide a SQL
Script which out clients execute for doing updates to their database. I
wanted to include the enabling of remote connections in the same.
Hope you understood what I am looking for.
- ramadu
:
> Hello Ramadu,
> Thank you for posting in the MSDN newsgroup.
> From your description, I understand that you're wondering how to configure
> the SQL Server 2005 database instance's remote connectivity settings(the
> allowed protocols) programmatically (through commandline or script file),
> correct?
> Based on my research, as for the remote connection setting, generally we
> can configure it in the SQL Server 2005's "Surface Area Configuration" too
l
> which is a GUI component. However, it has a commandline version (SAC.EXE)
> which can execute command based on a XML file, and the xml file can be
> exported from an existing server and use the SAC.exe to
> import the setting on another machine with SQL 2005.
> #sac Utility
> http://msdn2.microsoft.com/en-us/ms162800.aspx
> And here is a web article which demonstrate on the most common
> configuration tools in SQL SERVER 2005:
> #SQL Server 2005 Management Tools
> http://www.informit.com/guides/cont...seqNum=178&rl=1
>
> Also, if you're familiar with WMI programming, you can have a look at the
> new WMI provider interfaces provided in SQL SERVER 2005:
> #WMI Provider for Configuration Management
> http://msdn2.microsoft.com/en-us/library/ms180499.aspx
> http://blogs.msdn.com/sql_protocols.../19/482840.aspx
> Hope this helps.
> Regards,
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
>
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Study the registry. this setting is stored in the registry, so look at it be
fore and after you
modify using the tool. Then you can use xp_instance_regwrite to do the modif
ication from within SQL
Server. This xp isn't documented so use at your own risk, and a method which
it really preferable is
to ship with a CLR proc that you wrote and that does the registry modificati
ons for you. Another
thought is to have the CLR proc use SMO to do this instead of hacking the re
gistry directly.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"ramadu" <tnr@.newsgroups.nospam> wrote in message news:%23NMu$7ujGHA.3304@.TK2MSFTNGP03.phx.
gbl...
> Hi Steven,
> I'm not looking for a command line tool. I am rather looking for a Stored
Procedure / SQL Script
> which I can execute using the Query Analyzer to enable remote connections.
> The reason for this is that we are in the process of migrating from SQL Se
rver 2000 to SQL Server
> 2005 and in our application we provide a SQL Script which out clients exec
ute for doing updates to
> their database. I wanted to include the enabling of remote connections in
the same.
> Hope you understood what I am looking for.
> - ramadu
> :|||Thanks for Tibor's informative input.
Hi Ramadu,
I'm sorry for the misunderstand, I originally think that you're wantting
some shell script(vbscript, jscript) code to run such task on commandline.
Actually, to enable remote connections in SQL Server 2005 it'll involve
multiple steps:
#How to configure SQL Server 2005 to allow remote connections
http://support.microsoft.com/?id=914277
and not all of them are possible to do in pure T-SQL script.
1) Based on my research, as for the "Surface Area configuration" setting,
we need to use "SAC.exe" utility, and if we want to integrate this command
into T-SQL script, we can consider use the "xp_cmdshell" extender command
which can help execute external commandline utility(such as the SAC.exe).
You need to enable it through sp_configure in script since it is disabled
by default:
#xp_cmdshell
http://msdn.microsoft.com/library/e...jxo.asp?frame=t
rue
However, since SAC.exe will execute based on a xml file, it will still
require external resources(can not completely be done in T-SQL). BTW, do
you think it convenient that you put all such external resource file(such
as the xml import/export file) in a shared folder location so that it can
be conveniently referenced by commandline tool(through xp_cmdshell)?
2) As for enabling server protocol, there are serveral approaches, however,
most of them rely on some external programming interfaces, such as WMI or
.net framework SMO objects(new in SQL 2005). If none of them is possible
for your scenario, I'm afraid the only way is to manipulate the registry
directly (frankly speaking, this is not what I would prefer or recommend).
The server protocols setting is under the following registry path (specific
to each instance):
===========
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Mi
crosoft SQL
Server\MSSQL. 1\MSSQLServer\SuperSocketNetLib\Tcp\@.Ena
bled
===========
and there is some internal system SP which can help manipulate registry
values. e.g.
the below command enable the "TCP" protocol for the certain instance:
=============
EXEC master..xp_regwrite @.rootkey='HKEY_LOCAL_MACHINE',
@.key='SOFTWARE\Microsoft\Microsoft SQL
Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Tcp', @.value_name='Enabled',
@.type='REG_DWORD', @.value=1
===============
Here is a web article introduce some other such undocumented system
extended sps:
http://www.sql-server-performance.c..._procedures.asp
3) If there is also windows firewall enabled on the server, here is a kb
article discussing on programmatically open firewall ports for sqlserver:
#How to use a script to programmatically open ports for SQL Server to use
on systems that are running Windows XP Service Pack 2
http://support.microsoft.com/kb/839980
Hope this also helps.
Regards,
Steven Cheng
Microsoft MSDN Online Support Lead
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
|||Thanks Steven! I will look into these.
- Sri
Steven Cheng[MSFT] wrote:
> Thanks for Tibor's informative input.
> Hi Ramadu,
> I'm sorry for the misunderstand, I originally think that you're wantting
> some shell script(vbscript, jscript) code to run such task on commandline.
> Actually, to enable remote connections in SQL Server 2005 it'll involve
> multiple steps:
> #How to configure SQL Server 2005 to allow remote connections
> http://support.microsoft.com/?id=914277
> and not all of them are possible to do in pure T-SQL script.
> 1) Based on my research, as for the "Surface Area configuration" setting,
> we need to use "SAC.exe" utility, and if we want to integrate this command
> into T-SQL script, we can consider use the "xp_cmdshell" extender command
> which can help execute external commandline utility(such as the SAC.exe).
> You need to enable it through sp_configure in script since it is disabled
> by default:
> #xp_cmdshell
> [url]http://msdn.microsoft.com/library/en-us/tsqlref/ts_xp_aa-sz_4jxo.asp?frame=t[/ur
l]
> rue
> However, since SAC.exe will execute based on a xml file, it will still
> require external resources(can not completely be done in T-SQL). BTW, do
> you think it convenient that you put all such external resource file(such
> as the xml import/export file) in a shared folder location so that it can
> be conveniently referenced by commandline tool(through xp_cmdshell)?
>
> 2) As for enabling server protocol, there are serveral approaches, however
,
> most of them rely on some external programming interfaces, such as WMI or
> .net framework SMO objects(new in SQL 2005). If none of them is possible
> for your scenario, I'm afraid the only way is to manipulate the registry
> directly (frankly speaking, this is not what I would prefer or recommend).
> The server protocols setting is under the following registry path (specifi
c
> to each instance):
> ===========
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Mi
crosoft SQL
> Server\MSSQL. 1\MSSQLServer\SuperSocketNetLib\Tcp\@.Ena
bled
> ===========
> and there is some internal system SP which can help manipulate registry
> values. e.g.
> the below command enable the "TCP" protocol for the certain instance:
> =============
> EXEC master..xp_regwrite @.rootkey='HKEY_LOCAL_MACHINE',
> @.key='SOFTWARE\Microsoft\Microsoft SQL
> Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Tcp', @.value_name='Enabled',
> @.type='REG_DWORD', @.value=1
> ===============
> Here is a web article introduce some other such undocumented system
> extended sps:
> http://www.sql-server-performance.c..._procedures.asp
>
> 3) If there is also windows firewall enabled on the server, here is a kb
> article discussing on programmatically open firewall ports for sqlserver:
> #How to use a script to programmatically open ports for SQL Server to use
> on systems that are running Windows XP Service Pack 2
> http://support.microsoft.com/kb/839980
> Hope this also helps.
> Regards,
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
>
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)|||Thanks for your response Sri,
Hope that will help you resolve the problem. If you meet any further
problem, please feel free to post here.
Regards,
Steven Cheng
Microsoft MSDN Online Support Lead
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Enable SQL Server Remote Connections via Script

Hi,
I am connecting to my SQL server 2005 database using a remote connection.
Can someone provide me with a SQL script which will enable connections
via TCP/IP to the database? (i.e. I'd like to do the step of going to
the configuration manager and enabling the TCP/IP protocol for the SQL
Server Instance using a SQL Script instead of doing through the UI).
Thanks in advance!
- ramaduHi Ramadu,
Thank you for posting.
Regarding on this issue, I've also found your another duplicated thread in
the
microsoft.public.sqlserver.programming
newsgroup. I've posted my response there. I'd appreciate if you have a look
there. Also, if you feel it convenient that we continue to discuss in that
thread, please feel free to post there.
Regards,
Steven Cheng
Microsoft MSDN Online Support Lead
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hi Ramadu,
Thank you for posting.
Regarding on this issue, I've also found your another duplicated thread in
the
microsoft.public.sqlserver.programming
newsgroup. I've posted my response there. I'd appreciate if you have a look
there. Also, if you feel it convenient that we continue to discuss in that
thread, please feel free to post there.
Regards,
Steven Cheng
Microsoft MSDN Online Support Lead
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Enable SQL Server Remote Connections via Script

Hi,
I am connecting to my SQL server 2005 database using a remote connection.
Can someone provide me with a SQL script which will enable connections
via TCP/IP to the database? (i.e. I'd like to do the step of going to
the configuration manager and enabling the TCP/IP protocol for the SQL
Server Instance using a SQL Script instead of doing through the UI).
Thanks in advance!
- ramaduHi Ramadu,
Thank you for posting.
Regarding on this issue, I've also found your another duplicated thread in
the
microsoft.public.sqlserver.programming
newsgroup. I've posted my response there. I'd appreciate if you have a look
there. Also, if you feel it convenient that we continue to discuss in that
thread, please feel free to post there.
Regards,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)