Rexiology::Work

Microsoft, Information Technologies...

Community

News

  • From Taiwan, living and working at Tokyo, Japan.




Recent Posts

Tags

Microsoft Sites

Other Sites

Blog pools

Bloggers

Archives

Site Info



Locations of visitors to this page




Logos & Chicklets


GeoURL


Rex's Certifications
Rex's Certifications


Creative Commons授權條款
本 著作 係採用
Creative Commons 授權條款



March 2008 - Posts

Modern Internet Service API source code list...

crosspost from http://blogs.msdn.com/rextang

[via Scott Hanselman]

Scott just wrote a nice list couple days ago, of all API source code list of the modern internet services like Flickr, Twitter, Digg, etc. I'll just write down here for later references. too busy playing Windows HPC Server 2008 (HPC v2) for now...

FYI.

The Weekly Source Code 22 - C# and VB .NET Libraries to Digg, Flickr, Facebook, YouTube, Twitter, Live Services, Google and other Web 2.0 APIs

Technorati Tags: ,,,

Posted: 2008/3/31 19:11 by rextangtw | with no comments
Filed under:
Forcefully detach mdf file in SQL Express...

crosspost from http://blogs.msdn.com/rextang

[via http://www.mssqlonline.com/?p=14]

when you want to force a detach of sqlexpress mdf file, while there are still other processes currently using it (or normally when there were still connections remain in the connection pool), you can use the following sqlcmd script to force a process kill and then detach the database. the condition is that this script assumed that the application is using .Net SqlClient Data Provider. if you are using other provider, change the query string below to identify processes to kill.

Declare @spId Varchar(30)

DECLARE TmpCursor CURSOR FOR
Select 'Kill ' + convert(Varchar, spid) as spId
from master..SysProcesses
where program_name = '.Net SqlClient Data Provider'

OPEN TmpCursor

FETCH NEXT FROM TmpCursor
INTO @spId

WHILE @@FETCH_STATUS = 0

BEGIN

Exec (@spId)

FETCH NEXT FROM TmpCursor
INTO @spId

END

CLOSE TmpCursor
DEALLOCATE TmpCursor
go
exec sp_detach_db [###mdf file name in full path###]
go

this script basically iterates all the spid, form the kill statement, and run it in the while loop, and finally do the detach of the database.

beware that after forcefully  detaching the database, your current running application may behave abnormal since the connection / process assumed to be exist was lost.

FYI.

Forcefully detach mdf file in SQL Express...

crosspost from http://blogs.msdn.com/rextang

[via http://www.mssqlonline.com/?p=14]

when you want to force a detach of sqlexpress mdf file, while there are still other processes currently using it (or normally when there were still connections remain in the connection pool), you can use the following sqlcmd script to force a process kill and then detach the database. the condition is that this script assumed that the application is using .Net SqlClient Data Provider. if you are using other provider, change the query string below to identify processes to kill.

Declare @spId Varchar(30)

DECLARE TmpCursor CURSOR FOR
Select 'Kill ' + convert(Varchar, spid) as spId
from master..SysProcesses
where program_name = '.Net SqlClient Data Provider'

OPEN TmpCursor

FETCH NEXT FROM TmpCursor
INTO @spId

WHILE @@FETCH_STATUS = 0

BEGIN

Exec (@spId)

FETCH NEXT FROM TmpCursor
INTO @spId

END

CLOSE TmpCursor
DEALLOCATE TmpCursor
go
exec sp_detach_db [###mdf file name in full path###]
go

this script basically iterates all the spid, form the kill statement, and run it in the while loop, and finally do the detach of the database.

beware that after forcefully  detaching the database, your current running application may behave abnormal since the connection / process assumed to be exist was lost.

FYI.

Windows 2008 Server Core commands...

crosspost from http://blogs.msdn.com/rextang

just started toying Windows 2008 Server Core installation, and found no place to go when I just got a cmd.exe at start (been too comforted in a GUI environment!!!).

actually there is a good start guide at TechNet site that covered most of the commands needs to configure a server core installation:

Server Core Installation Option of Windows Server 2008 Step-By-Step Guide

errrrrrrr... lots of commands needs to remember...