While working on a project sometimes it happened that we need to shift the database from one server to another due to various reason (sometimes it is only money ). We are aware that this easy step take backup and restore another machine but glitch is what about the users which have access to the …
When we are keen to know that what is currently running on SQL SERVER for analysis purpose then with the help of below SQL statement we can easily find those statements, Stored procedure, status etc. GoSELECT [Spid] = session_Id, ecid, [Database] = DB_NAME(sp.dbid), [User] = nt_username, [Status] = er.status, [Wait] = wait_type, [Individual Query] = …
As we mention in TIP 10 to set database user as Single user now to make this available again for all the user or multi user we need to do following ALTER DATABASE FriendsDBSET MULTI_USER WITH NO_WAIT; GO Here when we run above command FriendsDB again changed to MULTI USER. Here NO_WAIT means not …
Sometimes it is require to set database as single user for maintenance or other recovery purpose. We need to write following statement GO ALTER DATABASE FriendsDBSET SINGLE_USER WITH ROLLBACK IMMEDIATE; GO Here ROLLBACK IMMEDIATE means if any transaction going on by other user then Rollback that data. See below snap for more detail Enjoy !!!