Showing posts with label all. Show all posts
Showing posts with label all. Show all posts
Saturday, October 25, 2014
PlanetSide 2 All Access Members Station Cash Trip Wire
This post has moved along with the rest of this blog to WordPress please go to this link here: http://obscureproblemsandgotchas.com/uncategorized/planetside-2-all-access-members-station/
Monday, January 13, 2014
How to get all files modified for a work item in TFS
This post has moved along with the rest of this blog to WordPress please go to this link here: http://obscureproblemsandgotchas.com/uncategorized/how-to-get-all-files-modified-for-work/
Wednesday, October 24, 2012
How to Kill all Processes for a Specific Database
Usually you would just use the Activity Monitor like shown below...
The idea behind this query is to first find out what you database's ID is, enter the ID in the where clause and generate the KILL statements. Copy and paste the KILL statements and execute all of them at once. You will be warned about killing your own connection though like this:
Msg 6104, Level 16, State 1, Line 1
Cannot use KILL to kill your own process.
No worries though you can just kill that process in the Activity Monitor or just close the query window.
Enjoy
![]() |
| The mundane repetition of right click each process and selecting Kill Process becomes annoying after the n_th process. |
...buuuuut if you need to restore your Dev Database with fresh data, you need to kill all of the individual connections/processes before attempting a restore. Well when you are doing development work you can have over 10+ connections and using the Activity Monitor is very annoying to close all of them. Therefore I have come up with the following tSQL query:
SELECT dbid, db_name(dbid) as DatabaseName, spid, KillStatement = 'KILL ' + CAST(spid AS varchar(10)) + '; ' FROM sys.sysprocesses WHERE dbid = 15 -- Put your Databases ID here
The idea behind this query is to first find out what you database's ID is, enter the ID in the where clause and generate the KILL statements. Copy and paste the KILL statements and execute all of them at once. You will be warned about killing your own connection though like this:
Msg 6104, Level 16, State 1, Line 1
Cannot use KILL to kill your own process.
No worries though you can just kill that process in the Activity Monitor or just close the query window.
Enjoy
Tuesday, January 10, 2012
Straight to the Point: Query for Database and Table Sizes
This post has moved along with the rest of this blog to WordPress please go to this link here: http://obscureproblemsandgotchas.com/uncategorized/straight-to-point-query-for-database/
Friday, July 29, 2011
How to Iterate Through all Enums from a Class in C#
This post has moved along with the rest of this blog to WordPress please go to this link here: http://obscureproblemsandgotchas.com/uncategorized/how-to-iterate-through-all-enums-fro/
Subscribe to:
Posts (Atom)
