--MSSQL 2005
SELECT SP.name as [login_name],DP.default_schema_name as [Schema_with_user],DP.name as [user_name]
FROM sys.database_principals DP ,sys.server_principals SP
WHERE SP.sid = DP.sid
--and SP.name='xxx'
--MSSQL 2000
SELECT SP.name as login_name,DP.name as default_schema_name FROM sysusers DP ,master..sysxlogins SP WHERE SP.sid = DP.sid
-- and SP.name = 'sa'
SELECT SP.name as [login_name],DP.default_schema_name as [Schema_with_user],DP.name as [user_name]
FROM sys.database_principals DP ,sys.server_principals SP
WHERE SP.sid = DP.sid
--and SP.name='xxx'
--MSSQL 2000
SELECT SP.name as login_name,DP.name as default_schema_name FROM sysusers DP ,master..sysxlogins SP WHERE SP.sid = DP.sid
-- and SP.name = 'sa'