changing to single user mode should be almost instantaneous, unless there was a HUGE transaction going on that eeds to be rolled back. I don’t think changing the security model in T-SQL is a good idea
Yes I would kill it, and try again. Did you set it to single user from SSMS or from NAV? From NAV it sometimes gets stuck, but I’ve never seen it get stuck in SSMS.
I was trying to set it to single user from NAV and that was taking time, in fact system was NOT RESPONDING, from NAV database>> information>> session it was showing 1 session but it seems some other process was using another session, so it was not able to make "single user " mode.
Later I tried to make “single user” from SSMS and it gave me error saying some session (more than 1) is in use, then I killed the session from SSMS, Activity monitor and did make it “songle user”, then changed security model to simple.
Following is the code for making 'single user ’ from SSMS:
ALTER DATABASE [Works] SET SINGLE_USER WITH NO_WAIT
Yep setting that property directly in NAV sometimes gets stuck, happened to me a few times [:^)]. Glad you got that to work and thanks for following up.
Personally I like using the properties pages. Right click the database, go to the Options page, and all the way down you’ll see a property called “Restrict Access”, which I would set to ‘SINGLE_USER’ there. That has always been almost instantaneous for me.