Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Use Master
GO
Declare @spid as varchar(10),
@CMD as varchar(1000);
declare cur CURSOR for select spid from master.dbo.sysprocesses where dbid =
(select dbid from sysdatabases where name = 'MyDB'
)
open cur
fetch next from cur into @spid
while @@FETCH_STATUS = 0
BEGIN
set @CMD = 'kill ' + @spid
exec (@CMD)
fetch next from cur into @spid
END
close cur
deallocate cur
Use MyDB
GO
DECLARE @username varchar(25)
DECLARE fixusers CURSOR
FOR
SELECT UserName = users.name FROM sysusers users
JOIN master.dbo.syslogins logins
ON users.name=logins.name
WHERE users.uid > 2 AND users.issqluser = 1
ORDER BY users.name
OPEN fixusers
FETCH NEXT FROM fixusers
INTO @username
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC sp_change_users_login 'update_one', @username, @username
FETCH NEXT FROM fixusers
INTO @username
END
CLOSE fixusers
DEALLOCATE fixusers