This should do the job:
DECLARE @login nvarchar(128), @isql nvarchar(2000)
DECLARE c1 CURSOR FOR
SELECT name from syslogins where name <>'sa'
OPEN c1
FETCH NEXT FROM c1
INTO @login
WHILE @@FETCH_STATUS <> -1
BEGIN
SET @isql = 'EXEC sp_defaultdb ' + QUOTENAME(@login, '''') + ' , ''YourDatabase'''
Exec sp_executesql @isql
FETCH NEXT FROM c1
INTO @login
END
CLOSE c1
DEALLOCATE c1
Just change the name to your database name and maybe you need to exclude some more logins besides "sa".
[font="Verdana"]Markus Bohse[/font]