22 December 2009, 12:31 am
The kill command is used against a SPID. (Server Process ID). This command is typically used because something is misbehaving. In order to use the Kill command, simply type the word “kill” followed by a space and then the number of the Server Process ID to kill.
– Kill Server process ID 98
kill 98
The [...]
20 December 2009, 11:16 pm
This article shows the usage of sp_who2. To diagnose system slowdowns, see (Troubleshooting SQL Slowness).
One of the first lines of defense in determining the causes of database slowdowns is to use sp_who2. sp_who2 shows all the sessions that are currently established in the database. These are denoted as SPID’s, or Server process Id’s. [...]
16 November 2009, 7:13 pm
The following shows how to find the version of SQL Server you are running (described as productversion). It also shows how to query the level of the product. The level of the product indicates whether it was the initial release, a service pack, or a beta version:
RTM = shipping version
SPn = service pack [...]
16 November 2009, 7:08 pm
Determining the database owner is important if you want to take advantage of cross-database-ownership-chaining. If databases have different owners, then you have issues with accessing objects between databases.
To find the database owners:
SELECT SUSER_SNAME(owner_sid)
FROM sys.databases
To change the owner of a database:
USE database
EXEC sp_changedbowner ’sa’
The standard owner for databases is usually sa.
19 June 2009, 12:18 am
The following code generates the same information found in sp_who2, along with some additional troubleshooting information. It also contains the SQL Statement being run, so instead of having to execute a separate DBCC INPUTBUFFER, the statement being executed is shown in the results.
Unlike sp_who2, sp_who3 only shows sessions that have a current executing request.
What [...]