I have a development VM setup as a domain controller with SQL Server 2012 installed. I am trying to connect directly on the server, but am unable to connect to my SQL Alias via PowerShell using the following commands:
$sqlServer = "sp2013sql"
$objSQLConnection = New-Object System.Data.SqlClient.SqlConnection
$objSQLCommand = New-Object System.Data.SqlClient.SqlCommand
$objSQLConnection.ConnectionString = "Server=$sqlServer;Integrated Security=SSPI;"
$objSQLConnection.Open()
I can directly through SQL Server Management Studio using the sp2013sql SQL Alias and via the name of the server.
This is what I have checked so far:
SQL Server is running
SQL Server Browser is running
SQL Server Agent is running
Firewall is turned off for all three profiles (doamin, private, and public)
Named Pipes and TCP/IP are enabled in SQL Server Network Configuration within the SQL Server Configuration Manager
TCP/IP is set to 1433
I can connect to the Alias via SQL Management Studio on the server
I can ping the name of the alias
I have a DNS A Record for the SQL Alias
I created an entry in the HOSTS file (Just in case I screwed up the DNS A Record)
SQL Browser is running
The Domain account for the SQL Browser service is a SYSADMIN in SQL Server
Running SQLCMD -L in CMD returns the name of my alias (and server)
Remote connections are enabled in SQL Server Management Studio
This is driving me crazy. What am I missing?
I eventually rebuilt from scratch. I think my problem was that I changed the SQL Browser Service Account but I cannot be sure.
Related
I have a database alias made using SQL Server Configuration Manager.
Here is what I done:
I've made an alias named "FCIS.SIS" for both 32-bit and 64 bit configurations with port number 1437.
TCP/IP enabled.
TCP/IP properties IPALL port 1437.
Both SQL Server (MSSQLSERVER) and SQL Server Browser services have been restarted.
Here is what I get:
I'm using SQL Server 2012 on windows 7
Also I've tried every single solution mentioned in this question but nothing worked for me.
I am testing a SQL Server for my company as an on-site database for manufacturing data and records. I have the SQL Server on my laptop and have set up permissions and downloaded SQL Server Management Studio on other computers in the company and managed to connect via SQL Server authentication.
However, I can't get Windows Authentication to work. I also have a Visual Basic program that I can run on my laptop that will communicate with the SQL Server that is locally on my machine but that program will not work on other computers in the company because they can not connect to the SQL Server.
How do I set up SQL Server to allow for Windows authentication on any company computers running that program? I opened a port on my Windows firewall on the computer that has SQL Server installed, and it seems to work with SQL Server authentication.
The connection string I am using in my Visual Basic program is as follows:
Dim connstring As String = "Data Source = Server; integrated security = true"
I assume I need to change something in my logins folder in my SQL Server?
My desired result would be for any computer running this application to be allowed to communicate with SQL Server and be able to read and write data.
any computer running this application to be allowed to communicate with SQL Server
The normal configuration to enable this is:
1) The SQL Server must be running on a server joined to the domain.
2) The SQL Server is configured to use TCP/IP and listen on port 1433.
3) The other computers are also joined to the domain.
4) The users logged in on the other computers are added as Windows logins. in SQL Server, and mapped to users in the desired databases (can use groups instead of individual users).
See eg: How to add Active Directory user group as login in SQL Server
I would like to connect SQl server DB in VM using my local sql server management studio.
What should I need for server name ?
Can I use my server Windows authentication for VM in my local ?
Create an empty text file on your VM and give it extension .udl
Doubleclick on it now you can set the properties easy from combobox
Adjust the properties and click on "test connection" until it works
Now open the file in notepad and there you see a complete connection string.
Note that for SQL Server authentication you need to configure the protocol in SQL Server Configuration Manager
When you are in Management studio on your local machine, you will need the hostname or IP address of the VM.
For Windows Authentication, you will need an account on the local domain that both your workstation and the database VM are connected to.
For SQL server authentication, you will need an account in the SQL Server instance.
In both cases, security will need to be configured and associated with your account.
Are you on a domain, or is this just a private server?
Use name of the VM where SQL server is running.
And yes, you can use Windows authentication. Depending on your domain settings.
This will help you How to: Create a SQL Server Login It is not much difference from SQL login.
And if you are in Administrators group on machine running SQL Server, then your login already should be included.
And if your machine with Management Studio and server with SQL Server are in different domains, then you will need to run Management Studio under different account
runas /netonly /user:domain\username "c:\path\ssms.exe"
See Connect to SQL Servers in another domain using Windows Authentication
I have deployed one vb.net desktop application and sql server is used for backend. It is properly working on local machine but when accessing database from remote machine it giving the error in the title.
I have done these things already:
Started SQL server, sql browser service using sql server configuration manager.
added the sql server, browser exe in to firewall allowed program list.
restarted sql server and browser.
enabled TCP/IP, Shared memory, Named pipes in SQL server configuration manager
enabled the remote connection for this DB in database property
I use Microsoft Visual Studio 2010 Professional (I installed all components).
Here is what I'm trying to do. I create a new ASP.NET project. Then I open Server Explorer (View->Server Explorer), right click on Data Connections and choose Add Connection. Then I choose Microsoft SQL Server and press Continue, but the 'Server name' list is empty.
I launch Sql Server Configuration Manager and it shows that SQL Server is in running state (Agent and Browser are stopped)
Why there is no any Sql Server in Add Connection list?
--------------------------------------------------------------
I allow remote filestream for SQl Server, so no I can choose server in the list, but when I enter new database name and click Ok I get a error "sql server was not found or was not accessible"
--------------------------------------------------------------
Here is a list of installed programs with 'SQL' filter
Have you configured SQL Server to allow remote connections? By default, SQL Server Express Edition and SQL Server Developer Edition do not allow remote connections.
For SQL Server 2005:
How to configure SQL Server 2005 to allow remote connections
For SQL Server 2008:
From start menu of SQL Server 2008, run SQL Server Configuration Manager.
From left side view of SQL Server Configuration Manager, expand SQL Server Network Configuration.
In the right view, you will see the list of SQL Server protocols. By default only Shared Memory is enabled. Enable the other protocols to get your SQL server to accept connections over the network.
Your problem appears to be that you have more than one SQL Server instance installed locally. You will need to use the fully qualified name.