DCSIMG
SQL Server 2005 - Gilad Lavian's Blog

Gilad Lavian's Blog

In Development

Browse by Tags

All Tags » SQL Server 2005 (RSS)
MS-SQL: Changing single user Database to multi users
The problem: Changes to the state or options of database "DatabaseName" cannot be made at this time. The database is in single-user mode, and a user is currently connected to it. The solutions: use master go alter database "DatabaseName" set multi_user; If there's users connected to the Database and you don't know who, you can use "sp_who2" to check who's connected. You can kill only user process by there SPID: kill 15;
LINQ to SQL Classes
One can only wish everybody to speak LINQ! The following solution demonstrate how to query database tables with object relational data classes. For this example you need to download and install the AdventureWorks Database provided by Microsoft. First, create a new console project: Open the "Server Explorer", click on the "Connect to Database" button: Select the Microsoft SQL Server: The next step is to connect to your AdventureWorks Database Server, from the "Add Connection"...
Download Microsoft AdventureWorks Database
Usually when we start writing a new program, or just playing with LINQ, we need a database with some information on it like tables, stored procedures and some data to play with. Microsoft offers a complete database called AdventureWorks just for that cause. The database contains more then 50 tables, 9 stored procedures and a few views and functions. For SQL Server 2005, you can download it from here: http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004 I downloaded...