Results 1 to 3 of 3

Thread: SQL Server 4 niqash

  1. #1
    IT Power's Avatar
    IT Power is offline Senior Member+
    Last Online
    3rd May 2013 @ 03:31 PM
    Join Date
    28 Jul 2008
    Posts
    258
    Threads
    81
    Credits
    999
    Thanked
    13

    Unhappy SQL Server 4 niqash

    bhai jaan mear SQL server cruppet ho gya tha jo k me ne reinstal ker liya he abb data bhee creat kerli he abb files ko attech keasay kerwain gay plz help me with Sneps...

  2. #2
    Niqash's Avatar
    Niqash is offline Advance Member
    Last Online
    12th August 2021 @ 10:35 AM
    Join Date
    30 Jun 2008
    Posts
    4,569
    Threads
    160
    Credits
    58
    Thanked
    4

    Default

    To Attach a Database File
    Open the command prompt on the server.

    From the command prompt, connect to an instance of SQL Server by using the following sqlcmd command:

    Copy Code
    sqlcmd -S Server\Instance
    Where Server is the name of the computer and Instance is the name of the instance.

    When connected, type the following commands:

    Copy Code
    USE [master]
    GO
    CREATE DATABASE [database_name] ON
    ( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data\<database name>.mdf' ),
    ( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data\<database name>.ldf' )
    FOR ATTACH ;
    GO
    Where database_name is the name of the database you want to attach, FileName is the path and filename of the database file and the log file, and FOR ATTACH specifies that the database is created by attaching an existing set of operating system files.

    To verify that the database has been attached, type the following two commands:


    Copy Code
    select name from sys.databases
    go.
    The sqlcmd tool displays the names of all databases attached to this instance of SQL Server Express. In the list, you should see the database name you provided in step 3

  3. #3
    Niqash's Avatar
    Niqash is offline Advance Member
    Last Online
    12th August 2021 @ 10:35 AM
    Join Date
    30 Jun 2008
    Posts
    4,569
    Threads
    160
    Credits
    58
    Thanked
    4

    Default

    2nd method....

    To attach a database

    Right-click Databases, point to Tasks, and then click Attach.

    In the Attach Databases dialog box, to specify the database to be attached, click Add; and in the Locate Database Files dialog box, select the disk drive where the database resides and expand the directory tree to find and select the .mdf file of the database; for example:

    C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWor ks_Data.mdf

    Important:
    Trying to select a database that is already attached generates an error.


    Optionally, to specify a different name for the database to attach as, enter the name in the Attach as column of the Attach Databases dialog box.

    Optionally, change the owner of the database by selecting a different entry in the Owner column.

    When you are ready to attach the database, click OK.

Similar Threads

  1. Windows server 2003 exchange server and Blackberry server
    By sensitive719 in forum Ask an Expert
    Replies: 2
    Last Post: 10th August 2010, 10:17 PM
  2. niqash help me
    By don_90 in forum Ask an Expert
    Replies: 1
    Last Post: 15th December 2008, 03:38 AM
  3. Niqash Help Me!
    By joejeejay in forum Ask an Expert
    Replies: 3
    Last Post: 14th December 2008, 09:54 PM
  4. niqash help me
    By mmajeed in forum Ask an Expert
    Replies: 2
    Last Post: 12th December 2008, 03:42 PM
  5. Help Me Niqash...!
    By A.K@Wardak in forum Ask an Expert
    Replies: 2
    Last Post: 15th November 2008, 01:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •