How to secure connection in sql server 2008? my main problem is which certificate should i add in mmc

i'm recently working on hardening of sql server 2008. now i face with a problem. my problem is  how to secure connection in sql server 2008?  my main problem is which certificate should i add in mmc? what are these certificates about?and guide
me in choosing the appropriate certificate.
and how should i know that the connection in sql server is secured?
plz guide me from the beginning cause i'm rookie in this subject.
thanks in advance.

Hi sqlfan,
Question 1: my problem is how to secure connection in sql server 2008?
Microsoft SQL Server can use Secure Sockets Layer (SSL) to encrypt data that is transmitted across a network between an instance of SQL Server and a client application. For more information about Encrypting Connections to SQL Server, please refer to the following
article:
http://technet.microsoft.com/en-us/library/ms189067(v=sql.105).aspx
Question 2: my main problem is which certificate should i add in mmc? what are these certificates about?and guide me in choosing the appropriate certificate.
To install a certificate in the Windows certificate store of the server computer, you will need to purchase/provision a certificate from a certificate authority first. So please go to a certificate authority to choose the appropriate certificate.
For SQL Server 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.
Question 3: how should i know that the connection in sql server is secured?
If the certificate is configured to be used, and the value of the ForceEncryption option is set to Yes, all data transmitted across a network between SQL Server and the client application will be encrypted using the certificate. For more detail about this,
please refer to Configuring SSL for SQL Server in the following article:
http://technet.microsoft.com/en-us/library/ms189067(v=sql.105).aspx
If you have any question, please feel free to let me know.
Regards,
Donghui Li

Similar Messages

  • How to enable remote connections in SQL Server 2008

    I'm trying to enable remote connections in SQL Server 2008 R2 as described in the following article.  I see the error message at the top of the article. 
    http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx
    One step in the article describes how to enable TCP/IP in Configuration Manager.  Specifically it says that
    'SQL Server NETWORK Configuration' should have TCP/IP enabled.
    The issue I've encountered is that my Configuration Manager
    is different than what appears in the article. My Configuration Manager shows the following:
    SQL Server 2005 Services
    SQL Server 2005 Network Configuration (32 bit)
           - Protocols for SQLExpress
    SQL Native Client Configuration (32 bit)
           - Client protocols
           - Aliases
    Note that I see 'SQL Server 2005 Network Configuration'
    rather than that for 2008.  When 'Protocols for SQLExpress'
    is expanded, there is a TCP/IP setting, but it's disabled and I see an
    Access Denied message if I try to enable this. 
    I also see a TCP/IP setting under Client protocols and successfully enabled this.  This uses port 1433 and I configured my firewall to accomodate this port as suggested in the article. 
    I also followed the other steps in the article, but still don't have remote access to SQL Server 2008 R2.  (I can access it from the office.)  I'm wondering if this remote access issue is because SQL Server
    2008 Network Configuration does not appear in Configuration Manager
    and if so, I'm interested in how this might be resolved.  (I'm running Windows 7 - 64 bit.)
    I'd appreciate any ideas on this.  Thanks. 

    Hello,
    Please refer to the following resource.
    http://support.microsoft.com/kb/KbView/914277
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How do i connect to sql server 2012 from cmd .

    Hi ,
    I Installed sql server 2008 R2 and 2012 Express and sql server2014 . I can conect to sql server 2008 R2 using
    SQLCMD -L command .
    How do i connect to sql server 2012 express edition from cmd .
    Any Hep appreciated
    Thanks in advance,
    Shravan

    I HAVE ANOTHER INSTANCE NAMED TEST  WHEN I USE THE COMMAND IT GIVES ME THIS ERROR 
    HOW TO RECTIFY 
    C:\Users\HP>SQLCMD -S HP-HP/TEST
    Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Named Pipes Provider: C
    ould not open a connection to SQL Server [67]. .
    Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login timeout expired.
    Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : A network-related or in
    stance-specific error has occurred while establishing a connection to SQL Server
    . Server is not found or not accessible. Check if instance name is correct and i
    f SQL Server is configured to allow remote connections. For more information see
     SQL Server Books Online..
    PLZ HELP 

  • Cannot connect to SQL Server 2008 R2 Express

    I have a database application that connects to the Northwind sample db in MS Access and lets the user perform CRUD operations.
    Now I want to add the same for MS SQL Server, however, I have trouble connecting to it using this connection string:
    I changed the server properties in SQL Server Management Studio to allow windows and SQL Server authentication, yet, I still get this exception when trying to open the connection:
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
    (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
    I thought it might be because the server is not allowing remote connections and followed this guide to allow remote connections:
    http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/
    But the SQL Server windows service won't start. The Browser works fine, but the server doesn't do anything.
    When trying to start it I get this error:
    The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details.
    The event log says:
    2011-07-07 17:02:55.35 spid51 Starting up database 'Northwind'.
    2011-07-07 17:02:59.98 spid51 Starting up database 'Northwind'.
    2011-07-07 17:03:03.68 spid53 Starting up database 'Northwind'.
    2011-07-07 17:03:07.01 spid55 Attempting to load library 'xpstar.dll' into memory. This is an informational message only. No user action is required.
    2011-07-07 17:03:07.30 spid55 Using 'xpstar.dll' version '2009.100.1600' to execute extended stored procedure 'xp_instance_regread'. This is an informational message only; no user action is required.
    2011-07-07 17:03:07.76 spid55 Starting up database 'pubs'.
    2011-07-07 17:03:08.89 spid55 Starting up database 'pubs'.
    2011-07-07 17:03:09.30 spid55 Starting up database 'pubs'.
    2011-07-07 17:04:11.37 spid55 Starting up database 'pubs'.
    2011-07-07 17:08:17.28 spid52 Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.
    2011-07-07 17:08:17.35 spid52 Using 'xplog70.dll' version '2009.100.1600' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
    However, when starting SQL Server Management Studio, I can normally work with the databases, perform CRUD operations, etc.
    I was wondering if it might be a connection string issue.
    I'm using this string:
    @"Server=lolcalhost;Database=Northwind;User ID=BEN-A350C47E32F;Password=;Trusted_Connection=False;";
    I added the Northwind database as data source to the project and the connection string is in the app.config:
    <connectionStrings>
    <add name="NwindConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Nwind.mdb" providerName="System.Data.OleDb"/>
    </connectionStrings>
    using this code to access it:
    constringServer = ConfigurationManager.ConnectionStrings["NwindConnectionString"].ToString();
    but when using this string I get an ArgumentException:
    Keyword not supported: 'provider'.
    I'd appreciate any help that would let me connect to the server from a program.

    Here is an active Sql connection string we use currently from our app.config file:
    <connectionStrings>
    <clear/>
    <add name="ServerConnectionString" connectionString="Data Source=SqlBox;Initial Catalog=YourCatalog;User Id=Username; Password=password;" providerName="System.Data.SqlClient"/><br/> </connectionStrings>
    here is one for Sql Express:
    <add name="LocalConnectionString" connectionString="Data Source=MachineName\SqlExpress;Initial Catalog=YourCatalog;Integrated Security= true;" providerName="System.Data.SqlClient"/>

  • Security Update for SQL Server 2008 R2 Service Pack 2 (KB2977320)

    So i have been trying to install this update on one of our servers since it is showing up on our MBSA scans but it has been failing on one of our machines with the error code: 0x80070643
    I downloaded the update and tired to install it manually. The installer returned: There are no SQL Server instances or shared features that can be updated on this computer. If that was true then why is SCCM still pushing the update to the machine and why
    is the MBSA showing that it needs the update? Any advice would be helpful. Thanks!

    Hi David,
    Based on my understanding, the error code: 0x80070643 was thrown out when you install KB2977320 with MBSA. And installation also failed when you download and install update manually.
    Regarding the error code: 0x80070643, it can be caused if the MSI software update registration has become corrupted, or if the .NET Framework installation on the computer has become corrupted. To fix this issue, we can follow these methods:
    Fix MSI software update registration corruption issues
    Repair the .Net Framework
    Uninstall and reinstall the .Net Framework
    For more information, please refer to this link:
    http://support.microsoft.com/kb/976982.
    Besides, the security update is released for SQL Server 2008 R2 Service Pack 2, please check the version of SQL Server you are using. About how to check the SQL Server version, please refer to this article: How to tell what SQL Server version you are running
    (http://www.mssqltips.com/sqlservertip/1140/how-to-tell-what-sql-server-version-you-are-running/). Then please download the Security Update for SQL
    Server 2008 R2 Service Pack 2 from this link (http://www.microsoft.com/en-us/download/details.aspx?id=43957), and retry install it manually.
    Best regards,
    Qiuyun Yu

  • How can I connect to SQL Server CE?

    Hi!
    How can I connect to SQL Server CE ?
    Any idea?
    I found jdbc driver for SQL Server 6.5,7.0,2000.
    But no driver for SQL CE.
    Thanks for any suggestion....

    I am also searching for same answer.
    I wanna choose Access as a db. but I can't find that so I have a no choice to select SQL2000CE though.
    I am stuck in driver problem. I can't find that.
    Should I use Oracle Lite or PointBase?
    I am under a lot of stress... like you've been...
    I wish you find and post that....

  • Unable to connect to SQL Server 2008 from OBIEE 11G(on 64 bit Linux box)

    We are unable to connect to connect to SQL Server 2008 from OBIEE 11G which is on 64 bit Red Hat Enterprise Linux.
    Infrastructure: OBIEE 11.1.1.5 64bit, on 64 bit Red Hat Linux Enterprise Linux 5.6 , MS SQL Server 2008 on 64 bit Microsoft Windows Server
    Issue Description: Unable to connect to SQL Server 2008 from OBIEE11G RPD
    Details: We are unable to connect to SQL Server 2008 from OBIEE which is on a 64 bit Linux box. We created the ODBC connection on Linux box to the SQL server. Whenever we try to import metadata it throws an error that says ‘Connection Failed’.
    Here are the steps we followed to setup the ODBC connection on Linux box.
    1) We updated the user.sh file with the LD_LIBRARY_PATH and LD_LIBRARY_PATH_64 values that point to $ORACLE_HOME/bifoundation/odbc/lib
    This is where we found the driver for SQL server SEmsss23.so.
    2) We updated the odbc.ini file with the entry for SQL server with the connection details
    SI_SQL_Server_DEV = SQL Server
    [SI_SQL_Server_DEV]
    Driver=/u001_OAS/Oracle/Middleware/Oracle_BI1/bifoundation/odbc/lib/SEmsss23.so
    Description=DataDirect 5.1 SQL Server Wire Protocol
    Address=10.230.216.52,54970
    AlternateServers=
    AnsiNPW=Yes
    ConnectionRetryCount=0
    ConnectionRetryDelay=3
    Database=SVBDW_NEW
    LoadBalancing=0
    LogonID=SIDatavalidation
    Password=~~~Password123
    QuoteID=No
    ReportCodePageConversionErrors=0
    3) We updated the IDENTIFIER_QUOTE_CHAR with single quotes instead of double quotes in the DB features of the RPD
    4) We updated the bash_profile file to point the ODBCINI variable to the path where the OBIEE odbc.ini file is present.
    Export ODBCINI=/u001_OAS/Oracle/Middleware/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup/odbc.ini
    The error in nqsserver.log file says “[nQSError: 16001] ODBC error state: IM002 code: 0 message: [DataDirect][ODBC lib] Data source name not found and no default driver specified.”

    Hi,
    Make sure SQL Configuration Manager make sure the TCP/IP enabled. please try below method
    Method 1
    Re Create a new ODBC & Oracle Bi Server DSN Configuration test it and use it in the connection pools.
    define your ODBC data source in your server where the BI Server is installed. Check your DB connections in your physical layer and make they are defined on your BI Server as well.
    Method 2:
    try using the complete TNS in below format in the datasource name section:
    (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST =DB IP)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = ORCL) ) and provide the credentials.
    Method 3:
    To use the OCI call interface you need to have oracle client DB to be installed so that you can establish a connection using that DB credentials and connect to the remote dB and then import the tables.....this is the rule of thumb.
    hope helps you.
    Thanks
    Deva

  • How to repair database using SQL server 2008 and C#

    How to repair database in SQL server 2008 using C#
    Musakkhir Sayyed.

    Unfortunately your post is off topic as it's not specific to SQL Server Samples and Community Projects.  
    This is a standard response I’ve written in advance to help the many people who post their question in this forum in error, but please don’t ignore it.  The links I provide below will help you determine the right forum to ask your
    question in.
    For technical issues with Microsoft products that you would run into as an end user, please visit the Microsoft Answers forum ( http://answers.microsoft.com ) which has sections for Windows, Hotmail,
    Office, IE, and other products.
    For Technical issues with Microsoft products that you might have as an IT professional (like technical installation issues, or other IT issues), please head to the TechNet Discussion forums at http://social.technet.microsoft.com/forums/en-us, and
    search for your product name.
    For issues with products you might have as a Developer (like how to talk to APIs, what version of software do what, or other developer issues), please head to the MSDN discussion forums at http://social.msdn.microsoft.com/forums/en-us, and
    search for your product or issue.
    If you’re asking a question particularly about one of the Microsoft Dynamics products, a great place to start is here: http://community.dynamics.com/
    If you think your issue is related to SQL Server Samples and Community Projects and I've flagged it as Off-topic, I apologise.  Please repost your question and include as much detail as possible about your problem so that someone can assist you further. 
    If you really have no idea where to post your question please visit the Where is the forum for…? forum http://social.msdn.microsoft.com/forums/en-us/whatforum/
    When you see answers and helpful posts, please click Vote As Helpful,
    Propose As Answer, and/or Mark As Answer
    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCSD, MCSA, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    Twitter: @Mr_Wharty
    MC ID:
    Microsoft Transcript

  • Unable to connect to sql server 2008 r2 after upgrading from framework 4.0 to 4.5.2 in windows 7 environment

    Hi  All,
    BackGround
    I used to connect to database with Encrypt set true  in sql connection which helps  established encrypted data base connection . I verified  that created certificate in order
    to provide Encrypted connection to database for client is valid.
    Issue :Issue
    is un-able to connect to sql sever2008 r2 from vs2013 by enforcing encryption to true.
    while trying to test the connection from vs2013 error log getting recorded as well as error notification is getting populated as below .
    Step1 :
    from Vs2013 trying to connect to sql server 2008 r2
    step 2: on Click test Connection . getting below mentioned error notification
    Event Viewer Log:<o:p></o:p>
     <o:p></o:p>
    (Process Id: 7472)
    <o:p></o:p>
    .Net SqlClient Data Provider:<o:p></o:p>
    A connection was successfully established with the server, but then an error
    occurred during the login process. (provider: SSL Provider, error: 0 - The
    target principal name is incorrect.)<o:p></o:p>
       at
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception,
    Boolean breakConnection, Action`1 wrapCloseInAction)<o:p></o:p>
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)<o:p></o:p>
       at
    System.Data.SqlClient.TdsParserStateObject.SNIWritePacket(SNIHandle handle,
    SNIPacket packet, UInt32& sniError, Boolean canAccumulate, Boolean
    callerHasConnectionLock)<o:p></o:p>
       at System.Data.SqlClient.TdsParserStateObject.WriteSni(Boolean
    canAccumulate)<o:p></o:p>
       at System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte
    flushMode, Boolean canAccumulate)<o:p></o:p>
       at System.Data.SqlClient.TdsParser.TdsLogin(SqlLogin rec,
    FeatureExtension requestedFeatures, SessionData recoverySessionData)<o:p></o:p>
       at
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
    serverInfo, String newPassword, SecureString newSecurePassword, Boolean
    ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)<o:p></o:p>
       at
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo
    serverInfo, String newPassword, SecureString newSecurePassword, Boolean
    redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential
    credential, TimeoutTimer timeout)<o:p></o:p>
       at
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer
    timeout, SqlConnectionString connectionOptions, SqlCredential credential,
    String newPassword, SecureString newSecurePassword, Boolean
    redirectedUserInstance)<o:p></o:p>
       at
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    identity, SqlConnectionString connectionOptions, SqlCredential credential,
    Object providerInfo, String newPassword, SecureString newSecurePassword,
    Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions,
    SessionData reconnectSessionData)<o:p></o:p>
       at
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo,
    DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions
    userOptions)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool
    pool, DbConnection owningObject, DbConnectionOptions options,
    DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    owningObject, DbConnectionOptions userOptions, DbConnectionInternal
    oldConnection)<o:p></o:p>
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    owningObject, DbConnectionOptions userOptions, DbConnectionInternal
    oldConnection)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
    owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate,
    Boolean onlyOneCheckConnection, DbConnectionOptions userOptions,
    DbConnectionInternal& connection)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
    owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions,
    DbConnectionInternal& connection)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection
    owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions
    userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&
    connection)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection
    outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1
    retry, DbConnectionOptions userOptions)<o:p></o:p>
       at
    System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)<o:p></o:p>
       at
    System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)<o:p></o:p>
       at System.Data.SqlClient.SqlConnection.Open()<o:p></o:p>
    Inner Exception:<o:p></o:p>
    :<o:p></o:p>
    The target principal name is incorrect

    The target principal name is incorrect
    Hi Rahul.U,
    Are you able to connect to SQL Server successfully from SQL Server Management Studio (SSMS) when enforcing encryption?
    According to above error message, it could be caused by the inappropriate server name or incorrect TrustServerCertificate configuration in the connection string from Visual Studio. There are some proposals for you troubleshooting this error.
    1. Make sure that you connect to the SQL server using the fully qualified domain name (FQDN).
    2. When connecting to a SQL Server instance with a valid certificate, please add the
    TrustServerCertificate
    parameter and set it to true in the connection string. For more details, please review this
    article.
    However, if you can successfully connect to SQL Server via SSMS, but still fail to connect to SQL Server from Visual Studio, I would like to recommend you post the question in the .Net Framework forum at
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=netdevelopment . It is appropriate and more experts will assist you.
    There are similar articles about error “The target principal name is incorrect” for your reference.
    http://serverfault.com/questions/458935/aws-rds-sql-server-ssl-connection-the-target-principal-name-is-incorrect
    http://www.derekseaman.com/2013/09/sql-2012-failover-cluster-pt-12-kerberos-n.html
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • How to Configure Remote Connections To SQL Server 2008 R2 Express

    Post written June 10, 2010 and pertains to:
    SQL Server 2008 R2 Express on both my server and local machines: SQLX_SRV,
    SQLX_LOC
    SQL Server 2008 R2 Management Studio on both my server and local machines:
    MS_SRV, MS_LOC
    Windows Server 2008 R2 Enterprise installed on a Hyper-V VPS: WS
    SQL Server Configuration Manager on both my server and local machines:
    CMGR_SRV, CMGR_LOC
    Server Manager: SMGR
    I am connecting to my hosting server via Remote Desktop Connection: RDC
    I installed SQLX_SRV and MS_SRV on my hosting server and SQLX_LOC and MS_LOC on my local development machine.  I am able to use MS_LOC to connect to SQLX_LOC and to use MS_SRV to connect to SQLX_SRV.  However I am not able to use MS_LOC to connect
    with SQLX_SRV.  Here's what I have done so far:
    SMGR -> Configuration -> Windows Firewall to turn off the Windows Firewall for Domain, Private and Public profiles.  Obviously I'll change this later, but until I can connect I want to remove as many variables as possible.
    CMGR_SRV -> SQL Server Services to confirm that both SQL Server (SQLEXPRESS) and SQL Server Browser services were running.
    CMGR_SRV -> SQL Server Network Configuration -> Protocols for SQLEXPRESS to ENABLE the Shared Memory, Named Pipes, and TCP/IP protocols and DISABLE the deprecated VIA protocol.
    CMGR_SRV -> SQL Server Network Configuration -> Protocols for SQLEXPRESS -> double click TCP/IP to open the TCP/IP properties dialogue.  On the Protocol tab Enabled: Yes, Keep Alive: 30000, changed Listen All to No.  I've tried it both
    ways, but I've got six IP addresses on my server and I wanted to configure SQLEXPRESS to listen to only the first and primary IP.  On the IP Addresses tab went to IPALL and cleared the TCP Dynamic Ports field and entered 1433 in the TCP Port field. 
    For my first and primary IP Address I made sure that Enabled was Yes, I cleared the TCP Dynamic Ports field, and entered 1433 in the TCP Port field.  For all other IP Addresses Enabled was set to No and I cleared both the TCP Dynamic Ports and TCP Port
    fields.
    CMGR_SRV -> SQL Server Services -> SQL Server (SQLEXPRESS) right click and Restart.  This of course stopped and restarted my instance of SQLX_SRV enabling the TCP/IP configuration in the previous step to take effect.
    On my server, SQLX_SRV is the only instance of SQL Server running and so it's easy to hard wire it to the default port 1433.
    The instance name for both SQLX_SRV and SQLX_LOC is the default "SQLEXPRESS".  My server machine name is "SERVER1" on the EnglishBrains.com domain.  So the proper local name (local within the context of my remote server as connected via RDC) for
    my instance of SQLX_SRV would be:
    SERVER1\SQLEXPRESS 
    Note the use of a backslash NOT a forward slash. 
    Of course to connect remotely from my development machine, which is not on the same domain as my hosting server, I would need to specify the domain as well, so the SQL Server name becomes:
    SERVER1.EnglishBrains.com\SQLEXPRESS
    I must also use SQL Server Authentication.  Before I can use such a remote connection, however, there are still several configuration steps required.  So on my server (connected via RDC) I used MS_SRV to connect to SQLX_SRV using SERVER1\SQLEXPRESS
    for the server name and Windows Authentication.  Once connected I performed the following steps:
    MS_SRV -> right click the connected parent SERVER1\SQLEXPRESS instance node at the top -> Properties -> Security -> Server authentication: select "SQL Server and Windows Authentication mode".  This will enable connections using either type
    of authentication.
    Next, leaving the Server Properties dialogue open, Connections -> check "Allow remote connections to this server" box.
    Click OK to save these changes and close the Server Properties dialogue.
    MS_SRV -> Security -> right click Logins and select "New Login...", the Login - New dialogue opens.
    On the General page Enter a name for your new login
    Select SQL Server Authorization
    Enter and confirm a password
    Uncheck Enforce password expiration
    Select the default Database and Language
    On the ServerRoles page Public will be checked, also check SysAdmin.  This is probably not a good idea and I'll uncheck this as soon as I can connect to the SQLX_SRV.
    On the User Mapping page select the databases you want your new Login to access and enter the Default Schema of "dbo".
    At the bottom of the User Mapping page you'll see the Database Roles table.  Public will be selected by default.  Also select db_Owner.  Again this is probably not a good idea, and I'll refine this once I can connect.
    On the Status page confirm that "Grant" is checked under "Permission to connect to database engine" and "Enable" is checked under "Login".
    Click OK to save all changes and close the Login - New dialogue.
    With these steps completed you should now be able to use MS_SRV to connect to SQLX_SRV using SQL Server Authentication by supplying the name and password for your new Login.  I tried this and it worked fine.  Next I tried to use this same login
    remotely, that is I went to my local development machine and used MS_LOC to try and connect to SQLX_SRV by using
    SERVER1.EnglishBrains.com\SQLEXPRESS
    and opting for SQL Server Authentication and supplying the name and password of my new login.
    THIS DID NOT WORK??  Instead I get the following error message:
    Cannot connect to SERVER1.EnglishBrains.com\SQLEXPRESS.
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider:
    SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)
    For help, click:
    http://www.microsoft.com/products/ee/transform.aspx?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1
    If you follow the suggested help link, you are told:
    The SQL Server client cannot connect to the server.  This error could be caused by one of the following reasons:
    A specified SQL Server instance name is not valid.
    The TCP, or named pipes protocols are not enabled.
    The firewall on the server has refused the connection.
    The SQL Server Browser service (sqlbrowser) is not started.
    WRONG on all 4 counts!  The instance name IS valid.  Both TCP/IP and Named Pipes protocols are enabled.  The firewall has been shut down, so it is not relevant.  Finally the SQL Server Browser IS started.
    The next thing I tried was to circumvent discovery by the SQL Browser service by using the following syntax to specify the IP address and port directly when specifying the SQL Server name.
    tcp:68.71.134.186,1433
    Using this in the Server Name field I was able to use MS_SRV to successfully connect to SQLX_SRV (using SQL Server Authentication of course) with or without the SQL Browser service running. 
    However when I tried to connect from MS_LOC to SQLX_SRV using this same login (WITH SQL Browser service running just for good measure) it does not work??  I get the following error message:
    Cannot connect to tcp:68.71.134.186,1433.
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider:
    TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)
    For help, click:
    http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=10060&LinkId=20476
    If you follow the help link you are told:
    "The SQL Server client cannot connect to the server. This error could occur because either the firewall on the server has refused the connection or the server is not configured to accept remote connections."
    However, the firewall has been shut down and the server HAS been configured to accept remote connections! 
    I confirmed that i could indeed Ping to 68.71.134.186  and running NetStat -a |find /i "listening" on the server shows that the server is indeed listening at 68.71.134.186 Port 1433 -- which is why I was able to connect to SQLX_SRV using MS_SRV with
    tcp:68.71.134.186,1433 .
    IN SUMMARY: Even though I can connect to my SQLEXPRESS instance multiple ways from the server itself, I cannot connect remotely from my development machine! 
    If anyone can help me figure out why I would be very, very grateful!

    My two cents to help you out on c# code example to configure the remote sql server express.
    Hope it helps. It works, but you have to be extra carefull to read it all and setup the server configuration and netsh commands; also the port fowarding on the router.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data.SqlClient;
    namespace sqlremoteconnection
    class Program
    static void Main(string[] args)
    // this is the local sql server connection
    // 192.168.1.101\SQLEXPRESS
    // now, the configuration for remote access:
    // activate SQL SERVER BROWSER - set it to start "automatic"; then START UP
    // SQL Server Configuration Manager
    // --> SQL SERVER BROWSER -> properties -> Service -> Start Mode -> automatic -> apply
    // --> Log On -> Start -> Ok
                // netsh firewall set portopening protocol = TCP port = 1433 name = SQLPort mode = ENABLE scope = all profile = CURRENT
                // netsh firewall set portopening protocol = UDP port = 1434 name = SQLPort mode = ENABLE scope = all profile = CURRENT
                // netsh advfirewall firewall add rule name = SQLPort dir = in protocol = tcp action = allow localport = 1433 remoteip = any profile = PUBLIC
                // netsh advfirewall firewall add rule name = SQLPort dir = in protocol = udp action = allow localport = 1434 remoteip = any profile = PUBLIC
    // VERY IMPORTANT FOR REMOTE ACCESS: you have to add the rules on port fowarding
    // on the router!!!
    // TCP: 1433
    // UDP: 1434
    // or just a personal port like TCP 31433/UDP 31434
    // read carefully the netsh commands above
    // server name: 123.132.24.177\SQLEXPRESS
    // server name: anyurl.myftp.org\SQLEXPRESS,1433 <<-- regular port
    // server name: anyurl.myftp.org\SQLEXPRESS
    // server name: anyurl.myftp.org\SQLEXPRESS,31433 <<-- WOW different PORT here!!!
    SqlConnection myConnection = new SqlConnection(
    "user id=sa;" +
    "password=password_goes_here!;" +
    "server=anyurl.myftp.org\\SQLEXPRESS,31433;" +
    //"Trusted_Connection=no;" +
    "database=database_name_here; " +
    "connection timeout=30");
    try
    myConnection.Open();
    catch (Exception e)
    Console.WriteLine(e.ToString());
    try
    SqlDataReader myReader = null;
    SqlCommand myCommand = new SqlCommand("select * from mytable", myConnection);
    myReader = myCommand.ExecuteReader();
    while (myReader.Read())
    Console.WriteLine(myReader["tab01_name"].ToString());
    Console.WriteLine(myReader["tab01_age"].ToString());
    catch (Exception e)
    Console.WriteLine(e.ToString());
    try
    myConnection.Close();
    catch (Exception e)
    Console.WriteLine(e.ToString());
    Adelino Araujo

  • How to connect to SQL SERVER 2008 from labview

    We have installed a SQL server 2008 in the local PC and through DSN we were able to connect to the database on the same PC . Now we have loaded SQL server 2008 in another PC but in same network but we are not able connect to the database. we can do it with connnectiong string?

    Thanks for your reply, 
    We verified through DSN it works, we are able to connect to database by DSN.
    But the issue is for connecting it to database we need to dynamically obtain the IP by choosing the Obtain the IP address automatically in TCP/IP Properties.
    Whereas all the other devices connected to the PC are having static IP of 192.168.127.xxx from which we are getting the data. Also the PC IP address is 192.168.127.001 which is connected to the devices with a LAN switch to acquire the data from these devices.
    Now i can either communicate with the devices using static IP address 192.168.127.1 or connect to database using dynamic address. 
    A separate LAN port will solve or is there solution for this issue?

  • JTDS not connecting with SQL Server 2008 R2 SP2 + SSL with Java 6 U34-35

    Environment:
    Windows 7 Pro 32-bit
    SQL Server 2008 R2 SP2 (Forced Encryption = Yes, No Certificate provided to server)
    Java 6 Update 27-35 and Java 7 Update 2-7
    jTDS 1.2.2 and 1.2.6
    Under the following setup, our Java application is able to connect to the SQL Server database:
    - SQL Server 2008 R2 SP2
    - Java 6 Update 27-33 or Java 7 Update 2-5
    just switching the JVM to the following would cause the application to be unable to connect to the database:
    - Java 6 Update 34 or 35, or Java 7 Update 6 or 7
    Browsing through the Java 6 Update 34 release notes, it looks like nothing big was changed, so I'm wondering what has changed with Java 6 U34 and Java 7 U6. I was also looking through a packet sniffer, and indeed the behavior of Java 6 Update 33 and lower was different from Java 6 Update 34 (although I couldn't understand the messages being passed, the number of connections and messages were different).
    * This is different from the issue with Java 6 Update 29-30 and Java 7 wherein they were patched for the BEAST SSL vulnerability. That was fixed with the SP2 patch for SQL Server 2008 R2, and for SQL Server 2008 you'd need a hotfix aside from SP3. After patching the server with those updates, Java 6 Update 29-33 and Java 7 U1-5 should be able to connect to the database.
    * If I do switch off Force Encryption, all Java versions are able to connect to the database.
    Edited by: user1357749 on Oct 12, 2012 1:20 AM

    Hi,
    It's four months later, but my colleague and I have reproduced the same behavior in both our commercial product, and a very simple example class. It's exactly as you describe it, where the latest versions of both Java 6 and 7 (and several previous versions) hang during the first jTDS SQL query to the DB (immediately after the SSL and handshake). It also happens with the Microsoft JDBC driver.
    If you disable the BEAST SSL fix (-Djsse.enableCBCProtection=false), then the connections work without any problems. So, while this is different from the original BEAST SSL problem and subsequent fix, it really seems like some additional changes were made to the fix in a later Java release that broke things.
    My colleague has filed a bug with Oracle, and is awaiting a response. We also filed a bug at the jTDS project (#690 - http://sourceforge.net/p/jtds/bugs/690/) that has simple reproduction steps. A contributer at the jTDS project agrees that this seems to be a problem with the JRE, and is not specific to jTDS.
    I hope that Oracle will address this issue soon. We need to periodically update the JRE due to vulnerabilities, and we need to have SSL for our JDBC connections for security reasons. This bug puts us and others in a difficult position.

  • Cannot connect to SQL Server 2008 Express

    I install SQL Server 2008 Express on Windows 7 and make sure SQL Server(SQLEXPRESS) service is running. Then I write a program via Visual C++ & ADO, and try to connect to the local SQL Service instance by using the following SQL connection string:
    “Provider=sqloledb;Data Source=(local);Integrated Security=SSPI;”
    But the connection fails. I try the same code on a computer with SQL Server 2008 Professional installed and it works without problems.
    Please advise. Thanks.

    Hi chcw,
    Are you got any error message/information while connect to SQL Server express instance faild via VC++ & ADO? If so, please post them for further investigation.
    Please also check the windows firewall. Firewall systems help prevent unauthorized access to computer resources. If a firewall is turned on but not correctly configured, attempts to connect to SQL Server might be blocked. For more information, please see:
    http://technet.microsoft.com/en-us/library/cc646023.aspx
    If you have any feedback on our support, please click
    here.
    Regards,  
    Elvis Long
    TechNet Community Support

  • Login fails when connecting to SQL Server 2008

    There were 3 databases and a report server database on sql server 2008 r2. All were renamed.  Now, when trying to connect to sql server I am getting a login failed error for default database. I'm guessing because the default db name was changed. How
    can I fix this so that I can connect to the db server\instance?
    Thanks

    Hi ,
    According to your description, I do a test in SQL Server 2008R2. If you use windows system admin account to log in the instance via Windows authentication, even if you change all use database name, you can still log in successfully. However, if you create
    a SQL Server login name to connect to instance via SQL Server authentication, when you change the default database name, it will
     occur the error which just like at follows .
    //Cannot open user default database. Login failed.
    Login failed for user '***'. (.Net SqlClient Data Provider), Error Number: 4064//
    I recommend you change the default database any existing database on your server like master via clicking on Option , or you can run following statement for username
     to replace your original database name with master.
    ALTER LOGIN [login name] WITH DEFAULT_DATABASE = master
     GO
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Connection failed SQL Server 2008 R2 with Instance Name but with IP connect

    Hello,
    We have a server where SQL Server 2008 R2 is installed. Now from our local pc we connect to that database. I try to connect that database using instance name but cannot. If I put IP Address in the server name field, then it connect. my other colleague, they
    can connect using instance name but I cannot.
    How can I resolve this problem? How can I connect using Instance Name?
    Please help.

    Faisal there are a couple of possibilities for you. Some have been mentioned already. For us to help if you can provide some further information this would be appreciated. In the mean time some things that you can check
    If you are able to connect to the instance via Server IP Address then the instance is configured for remote connections and the firewall does allow for remote connections to come through. You can check the SQL Server Configuration Manager on the server to
    check what protocols (Named Pipes & TCP/IP are enabled). You can also check that the Browser is running.
    What error message do you receive when trying to connect via the ServerName or ServerName\InstanceName remotely?
    You could look at creating an entry in your host file with the server name and IP address on you workstation and test this. I am thinking that if a colleague is able to connect remotely via ServerName or ServerName\InstanceName that you potentially have
    a caching issue or a DNS issue. Are you able to ping the servername from your workstation and get a valid response from the correct IP address?
    I hope this helps.
    Thanks
    Warwick Rudd (MCM - SQL 2008 | MCT)
    (SQL Masters Consulting |
    My SQL Server Blog | Twitter)

Maybe you are looking for