'Duplicate connection name' error from SQL Server - sql-server-2012

I've created a SQL Server database to keep track of transactions that will be handled by an application (Windows service) which connects to DB with a Login user.
When I'm trying to connect to the DB, the server replies with
Duplicate connection name
I've tried to connect to the database using SQL Server Management Studio and it works, but from the app it doesn't.
Does anyone know any solution for this?

The problem was caused by the fact that the user must be mapped to database role membership as db_owner. By setting the role, the connection problem was fixed.
image: set database role membership to db_owner in SQL Server Management Studio

Related

Can connect do SQL Server Database without Server Login - why?

We use AD groups to access SQL Server and Databases in this server. I have tested that if I deleted login from Server I still can connect to Database which i have defined User. Why this permission still exists? I thought that if I drop login from server i wouldn't access to database which was mapped from this login.

Connecting access 2007 to sql server 2012

I've linked to a table in an sql server 2012 database using an odbc connection. This was straightforward and worked fine using my log in. When I attempted to open the linked table on another users computer I got an error saying I could not connect. I tried to set up the connection on their PC but couldn't see the database on the server. I logged on to sql server and gave that user a log on to the sql and access to the database using windows log in.
I still could not gain access to the database through access. Any idea what I'm doing wrong.
One Idea, you shall create all linked tables with a privileged user account of the SQL Server.
For example, if you enabled Trusted_Connection in the SQL Server, you can use the administrator's account of Windows, for example, johndoe2 for connection. If your SQL Server is installed on the LAN host masterserver, a linked table can be created as this:
ODBC;DRIVER=SQL Server;SERVER=masterserver\SQLEXPRESS;Database=[MyDatabase];UID=johndoe2;Trusted_Connection=Yes;TABLE=dbo.[MyTable]
In our case we can access MyTable throuhg Access 2007 on the host biomas that is on the same LAN as the masterserver.

Connecting to SQL Azure via Management Studio

I have a SQL Azure database. I can successfully connect to the database via the Azure management portal. In addition, I can successfully connect to the database from my application using the Entity Framework. Unfortunately, I cannot connect to the database via SQL Server Management Studio.
My thought was that SQL Server Management Studio could not connect to the 'master' database. For that reason, it would fail. So, I tried adding the database name via the "Connect to Database" field on the "Connection Properties" tab. Yet, I get the same error. The error looks like the following:
TITLE: Connect to Server
------------------------------
Cannot connect to tcp:{serverName}.database.windows.net,1433.
------------------------------
ADDITIONAL INFORMATION:
Login failed for user '{username}'.
This session has been assigned a tracing ID of '{id}'. Provide this tracing ID to customer support when you need assistance. (Microsoft SQL Server, Error: 18456)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476
What am I doing incorrectly here? This "server" has 2 SQL Azure databases on it that I'd like to access via management studio. How do I add users so that i can login an manage those two databases? Is there a way to even manage users on a SQL Azure database? I can't seem to figure it out.
Thank you for your help.
What version of SQL Enterprise Management Studio are you using? You need at least SQL Enterprise Management Studio 2008 R2 or later. (Might as well get the latest: http://www.microsoft.com/en-us/download/details.aspx?id=29062)
Assuming you've got that, you'd enter it like so in the Connect to Server dialog:
Server type: Database Engine
Server name: tcp:servername.database.windows.net
Authentication: SQL Server
Login: username#servername
Password: password
That should do it -- the other thing to check are the firewall restrictions. You'd be seeing a different error ("client IP address is not allowed access") but it's good to verify that, anyway.

Connection via ODBC to SQL Server failing

I have a strange issue. I can connect from one Terminal server to the SQL server as an admin. I can also connect to the server via a straight SQL connection as a normal user. When I try and log on to the server using odbc I receive the following error.
07/08/2011 10:49:14,Logon,Unknown,Login failed for user ''. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only. [CLIENT: 10.0.0.25]
07/08/2011 10:49:14,Logon,Unknown,Error: 18456 Severity: 14 State: 58.
The SQL server is definitely in mixed mode and a user is definitely set up in the connection. It must be a permissions issue.
Probably the user that tries to login does not have permission to the database he/she is trying to connect.
Go to the SQL Server > Security > Select the User - Right Click > Properties > User Mapping
And there select the database that user needs to access (check box in the map column)
I'm pretty sure that error had happened to me before that that's how I fixed it. Assuming it is true that your server is setup as mixed mode already.
If your using ado.net, make sure your using the ODBC data adapter, connectors and odbcCommands instead of the SQL ones. ;)

How to allow access for a sql server user?

I am a developer-having-to-play-admin and wish to connect to a remote sql server from my development machine using a sql server user ("op_web").
When I try to connect from vs2008 Server Explorer, I can connect to the server, but no databases are listed. If I connect using the server admin user, all databases are listed as expected.
The server is a relatively fresh install made by me.
I have
allowed for remote connections in sql server.
created the login op_web at server level
created a user at database level and assigned to login with same name
assigned roles to the user to allow for reading and writing - I have assigned no schemas and default schema for the user is dbo.
If I log on (locally at server) using sqlserver management studio/sqlserver authentication and the created login, I can display and alter table data as I would expect.
Remote access gives me no choice of databases.
Any pointers to what I might have missed?
You have to give your users rights on the database.