Share via


How to Create a SQL Connection String for an Application (UDL File)

Several applications and services use SQL as their database storage location. Often, the application or service that needs to connect to the SQL server is not on the same physical computer as the SQL server. In such cases, you may need to embed a connection string into the application in order to establish the connection. For example, when configuring a Certification Authority (CA) to connect to Forefront Identity Manager Certificate Management (FIM CM) 2010, you need to specify a connection string. To create such a connection string, you can do the following:

  1. On the computer that requires the connection string, create a new file with a file extension of .udl.
    1. To perform this task, you will have to be viewing file extensions. If you are unsure how to do that, see How To: View File Name Extensions.
    2. Create a new text file and then rename the three letter file extension .txt to .udl.
      • For example, if you create a file named ConnectionString.txt, just rename it to ConnectionString.udl.
      • The rest of these steps will assume that the file is actually named ConnectionString.udl. If you created another file name with a .udl file extension, that is fine, just substitute the appropriate name as needed in the following instructions.
  2. Right-click ConnectionString.udl that you just created and then click Properties.
  3. On the Connection tab, fill out the connection properties according to the server, authentication type, and database name that you need. This is typically something you would already know, but if you do not, you may have to contact the database administrator or go look at the database connection properties yourself. If you need help with that, check out the Server Management How To Pages.
  4.  Click Test Connection. Hopefully it will succeed. If not, check the credentials, authentication type, and any firewalls (How to: Configure a Windows Firewall for Database Engine Access) between servers.   
  5. Click OK.
  6. Open the url file and inside you will find the connection string. For example, Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;InitialCatalog=FIMCertificateManagement;Data Source=FIMDC1 (as shown in the following figure).
  7. Remove Provider portion of the string. Using the example above, the connection string for the application would be:** Integrated Security=SSPI;Persist Security Info=False;InitialCatalog=FIMCertificateManagement;Data Source=FIMDC1**