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

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.

Related

Azure SQL database user firewall

I am trying to set the firewall rule for specific user account in my Azure SQL database. Currently I have two login accounts, “admin” and “user”. I want to open up the access to allow all “user” IP addresses to be able to access the database. Right now my firewall settings are blocking anyone trying to access the “user” account without having their IP address whitelisted. I’m unclear how to assign a firewall rule to a specific database login.
First make sure while creating the SQL Server in Azure, select Yes for Allow Azure services and resources to access this server in Networking settings.
Open the Azure SQL Server in SQL Server Management Studio.
Switch to the "master" database from the database selection box.
Create the Server Login by executing below statements.
CREATE LOGIN testLogin1
WITH PASSWORD = '<Strong_Password_Goes_Here>';
Now select the database for which you want to create the user. In another Query window, run the below statements to create the user.
CREATE USER [testLogin1]
FROM LOGIN [testLogin1]
WITH DEFAULT_SCHEMA=dbo;
At last give the db_owner permission to the new user.
ALTER ROLE db_owner ADD MEMBER [testLogin1];
Now just go to your Azure Database Query editor, and login with new user and password. It will login.

'Duplicate connection name' error from SQL Server

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

SQL Server 2005 - removing permission from a Windows Authentication login

How Can I remove permissions from a windows authentication login in SQL 2005. Currently when I create a login in SQL Server 2005 and use the login in TSQL I can update/select/insert/delete all table in any database in the db server. Creating low level permission(on database level) is not working either.

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.

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.