Skip to main content

Configure MSDE: Installation/Server Setup, Database Creation/Backup/Restore/Deletion using OSQL

SERVER SETUP

Step 1: Download Microsoft SQL Server 2000 Desktop Engine Service Pack 3 file (MSDE2000A.exe) from http://go.microsoft.com/fwlink/?linkID=14502

Step 2: Execute MSDE2000A.exe to extract the MSDE, it extracts to C:\MSDERelA by default

Step 3: Now open an MS-DOS command prompt, and change to the directory where MSDERelA file is extracted, now execute following command to set up the server.

Windows authentication with network access.
Setup.exe DISABLENETWORKPROTOCOLS=0 SAPWD=
Windows authentication without network access.
Setup.exe SAPWD=
Mixed Windows and SQL mode authentication with network access.
Setup.exe DISABLENETWORKPROTOCOLS=0 SAPWD= SECURITYMODE=SQL
Mixed Windows and SQL mode authentication without network access.
Setup.exe SAPWD= SECURITYMODE=SQL

Step 4: Now in installation window in the left pane double click “Named Pipes” and then “TCP/IP” and then click ok.

Step 5: Now go to Start>Control Panel>Administrative Tools>Services and right click MSSQLSERVER option in the right pane and press Start to start the service. Also make sure startup type should be “Automatic”.

CREATE DATABASE
Execute following command to create database

C:\>OSQL –U sa –P –S

1>use master
2>go
1>CREATE DATABASE
2>go

BACKUP DATABASE
Execute following command to backup database

C:\>OSQL –U sa –P –S

1>BACKUP DATABASE TO DISK=
2>go

RESTORE DATABASE
Execute following command to restore database

C:\>OSQL –U sa –P –S

1>RESTORE DATABASE FROM DISK=
2>go

DELETE DATABASE
Execute following command to delete database

C:\>OSQL –U sa –P –S

1>use master
2>go
1>DROP DATABASE
2>go

Comments

Popular posts from this blog

URL Rewritting

http://www.simple-talk.com/dotnet/asp.net/a-complete-url-rewriting-solution-for-asp.net-2.0/ http://msdn.microsoft.com/en-us/library/ms972974.aspx URL Rewriting in ASP.NET Summary: Examines how to perform dynamic URL rewriting with Microsoft ASP.NET. URL rewriting is the process of intercepting an incoming Web request and automatically redirecting it to a different URL. Discusses the various techniques for implementing URL rewriting, and examines real-world scenarios of URL rewriting. (31 printed pages) Download the source code for this article. Contents Introduction Common Uses of URL Rewriting What Happens When a Request Reaches IIS Implementing URL Rewriting Building a URL Rewriting Engine Performing Simple URL Rewriting with the URL Rewriting Engine Creating Truly "Hackable" URLs Conclusion Related Books Introduction Take a moment to look at some of the URLs on your website. Do you find URLs like http://yoursite.com/info/dispEmployeeInfo.aspx?EmpID=459-099&type=summ...

SEND A PDF FILE AS AN ATTACHEMENT OF MAIL!

System.Net.Mail.MailMessage m1 = new System.Net.Mail.MailMessage(); m1.From = "manpreet@gmail.com" m1.Subject = "Test mail "; m1.Body = str.ToString(); m1.IsBodyHtml = true; m1.To.Add("jasdeep@gmail.com"); m1.CC.Add("jasdeep123@gmail.com"); m1.Attachments.Add(new Attachment(strserverpath + @"\pdf\" + PdfFileName)); smtp.Send(m1);

Sql Server Tips

IF WE WANT TO SELECT  TOP N ROWS  FROM A TABLE ,  WE USE THE FETCH NEXT  SELECT    * FROM  table1   ---//First m rows ignore first n rows ORDER BY id OFFSET n ROWS FETCH NEXT m ROWS ONLY if n=0, m=10 then first  10 rows if n=10, m=10 then first  10 rows start from 11th row Row_number()   SELECT  ROW_NUMBER() OVER(order by db.id) Insertion Simultaneouly in temp table with output clause DECLARE @table1 table (   Id int,   name nvarchar(50) ); DECLARE @table2 table (  Id int,  name nvarchar(50) ); INSERT INTO @table2 OUTPUT INSERTED.*   INTO @table1   select top 10 id, name  from FinalTable SELECT * FROM @table2; SELECT * FROM @table1;