How to allow access for a sql server user? - sql-server-2005

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.

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.

'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

Running VB.Net Windows forms app as 2 different Windows authenticated users to connect to local and remote SQL server

I've inherited a VB.Net Windows forms application that is used across several hundred remote sites. On the remote sites the application connects locally to a local SQL server instance using the currently logged in Windows user at the workstation - this all works fine.
The application however also needs to connect to a remote SQL server - currently this is done using a set of connection strings and sql authentication. The DBA wants to move away from using SQL server authentication and make everything Windows authentication.
Clearly, adding hundreds of users to the remote DB is not an option. Therefore I need to be able to use the currently logged in user if connecting locally to a local SQL server and a different Windows users (which will have permissions to the db server) if I am connecting remotely.
Does anyone have any suggestions of how this can be done or can suggest an approach.
Thanks
Since both servers are on the same domain, create Active Directory Groups for the application, put the users' Windows logins into the groups, and then give the 2, 3 or 10 or whatever app-specific AD groups permissions in the databases. If you're using stored procedures, create a database role for each AD group, grant the DB role execute permissions, and add the AD groups to the DB roles.

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.

SQL Server 2008 database Publishing Wizard

I'm trying to run a database import using the Copy Database Wizard Tool from SQL Server Management Studio in SQL Server 2008.
I have connected to my database using the sa account and when I run the process I used the sa account on both the source and destination database.
All the processes are failing with
Event 18556, Login failed for user '{domain}\administrator'.
Reason: Failed to open the explicitly specified database. [CLIENT: ]
The SA account should have sufficient rights to import the database and the administrator account definitely has the rights.
So, the first question is, why is the administrator account even mentioned since everything is run as SA?
The second question is, why is the administrators account failing to open the explicitly specified database, when that account has total control of all databases on the destination server?
Finally, what exactly is the specified database? There is data in the binary portion of "event log" that points to Master but no mention of the database anywhere else.
Are you connecting to SSMS using pass through authentication? Your wizard will run as your user I believe if so. Connect to your database server in SSMS using the sa account and then try launching it.
Give it a valid account to the other database, sa needs access locally, the 2nd account needs access on your other SQL server.
Alternatively, make sure your domain user has access to the database in question (not the server, the db is dif.) and run it that way.
The master db is where all the sys tables reside, it's the overlord db so to say: http://msdn.microsoft.com/en-us/library/ms187837.aspx