MS-SQL: Changing single user Database to multi users

יום שבת, נובמבר 22, 2008

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 mastergo 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

יום רביעי, אוקטובר 31, 2007

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" window. Select the appropriate Server and Database (AdventureWorks) and click OK. After that, you should see the AdventureWorks.dbo in...
2 תגובות

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 the AdventureWorksDB.msi and the run the following query in the SQL 2005: 1: exec sp_attach_db @dbname=N'AdventureWorks', 2: @filename1=N'C:\Program Files\Microsoft SQL...
תגובה אחת