My SQL Server Programming-Kill Spid?

Here's a little snippet from an SP i wrote a couple of years ago when i wanted to drop a db. Given the id of the database (@DR_ID), killed my processes just fine...
Get the dbid using the db_id() function.

    -- Get a cursor with the processes that have to die in order to be able to drop db
    DECLARE curProcesses CURSOR
        LOCAL
        FAST_FORWARD
        READ_ONLY
    FOR
        SELECT spid
        FROM
            Master..sysprocesses
        WHERE
            dbid = @nDR_ID

    OPEN curProcesses

    FETCH NEXT FROM curProcesses INTO --Gets the first process
        @nKillProcess
    SET @nFetchStatus = @@FETCH_STATUS

    --Kill the processes
    WHILE @nFetchStatus = 0
    BEGIN
        SET @sTemp ='KILL ' + CAST(@nKillProcess as varchar(5))
        EXEC(@sTemp)
        FETCH NEXT FROM curProcesses INTO --Gets the next process
            @nKillProcess
        SET @nFetchStatus = @@FETCH_STATUS
    END
    CLOSE curProcesses
    DEALLOCATE curProcesses

Microsoft Surface Diagram: How it all works

The Microsoft Surface is a revolutionary piece of equipment that has basically brought the major film Minority Report to life, we never imagined something so futuristic would be here with is in 2007. This is heaven to us and we guess it is to you as well, the way this new Touch Surface high tech table works is mind blowing but below we have 4 simple steps of how the Microsoft Surface works.
Microsoft Surface Diagram
Microsoft Surface Diagram
1) Screen –
• There is a diffuser which turns the Surface’s acrylic tabletop into a large horizontal “multitouch” screen, which is capable of processing multiple inputs from multiple users. The Surface is so far advanced than we could imagine that it can recognize objects by their shapes or by reading coded “domino” tags when placed on the table.
2) Infrared –
• Surface’s “machine vision” operates in the near-infrared spectrum, using an 850-nanometer-wavelength LED light source aimed at the screen. When objects touch the tabletop, the light reflects back and is picked up by multiple infrared cameras with a net resolution of 1280 x 960.
3) CPU –
• Surface uses many of the same components found in everyday desktop computers — a Core 2 Duo processor, 2GB of RAM and a 256MB graphics card. Wireless communication with devices on the surface is handled using WiFi and Bluetooth antennas (future versions may incorporate RFID or Near Field Communications). The underlying operating system is a modified version of Microsoft Vista.
4) Projector -
• Microsoft’s Surface uses the same DLP light engine found in many rear-projection HDTV’s. The footprint of the visible light screen, at 1024 x 768 pixels, is actually smaller than the invisible overlapping infrared projection to allow for better recognition at the edges of the screen.

How to Kill All Processes That Have Open Connection in a SQL

The below code block can be used to kill all the processes which are connected to the database named @dbname except the process that the code block is running in the scope of. You can also set the database name by the DB_NAME() property.

DECLARE @dbname nvarchar(50)
DECLARE @SPId int

SET @
dbname = N'Works'
--SET @
dbname = DB_NAME()
DECLARE my_cursor CURSOR FAST_FORWARD FOR
SELECT SPId FROM MASTER..SysProcesses
WHERE DBId = DB_ID(@DatabaseName) AND SPId <> @@SPId

OPEN my_cursor

FETCH NEXT FROM my_cursor INTO @SPId

WHILE @@FETCH_STATUS = 0
BEGIN
KILL @SPId

FETCH NEXT FROM my_cursor INTO @SPId
END

CLOSE my_cursor
DEALLOCATE my_cursor

MySQL 5.0 vs. Microsoft SQL Server 2005

Database engines are a crucial fixture for businesses today. There is no shortage of both commercial and open source database engines to choose from. Microsoft SQL Server 2005 is Microsoft’s next-generation data management solution that claims to deliver secure and scalable applications while making them easy to deploy and manage. MySQL has long been the DBMS of choice in the open source community. The recent release of MySQL 5.0 has seen major changes in both features and performance to bring the database system into enterprise-level standards.

This paper aims to give the low-down on features most desirable to database developers and compare both database management systems in light of these features.

View Complete article here