Re: Master database must never be the default database for any login



Carlos Felipe França da Fonseca (carlosfelipefranca@xxxxxxxxx) writes:
I mentioned MODEL only as an example.
So, let's say that I want TEMPDB as my default database for all logins
created in SQL Server 2000.
Is it possible?

To deal with current logins, this is the query I posted for SQL 2000:

SELECT 'EXEC sp_defaultdb ' + quotename(name) + ', 'thedbofyourchocie'
FROM syslogins

Copy and paste result into a query window.

For new logins, you will have to be observant and fix it yourself.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: System Administrator Implied Permissions
    ... >> Hi Dan, ... >> Now, given this, why does SQL Server ... However, these logins were not ... Other sysadmin role members have the ...
    (microsoft.public.sqlserver.security)
  • Re: ExecutionEngineException in Sql 2005 management studio
    ... The query window ... Here's a stack dump, ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.tools)
  • Re: SQL Server 2005 Login Problem
    ... There are two authentication method in SQL Server. ... 1- Windows Authentication ... Only creating Logins is not the complete solution of course, then you'll need to map those users to the appropriate databases and assign them roles and grant them permissons. ...
    (microsoft.public.sqlserver.clients)
  • Re: Windows permissions to run Jet OLEDB 4.0
    ... in SQL Server or not when you have to go outside of the server to the ... Actually I was talking about Windows logins. ... There is no security whatsoever implemented on the mdb ...
    (microsoft.public.data.oledb)
  • Re: Logins & Permissions
    ... At server level, we use "Logins" to connect to a SQL Server Instance and perform server level jobs. ... "Users" are used and these users are mapped to Logins. ... I am using SQL Server 2005 on a Windows NT Network ...
    (microsoft.public.sqlserver.security)