Restore database from dat file

  • Hi,

    I have A.dat file. Using BCP How to restore file to a new database.

    I am trying in this way.

    BCP ASPT in -iA.dat -t

    Here ASPT is new databse name. It throws 'Object Not found' error.

    Can anyone help on this?

    Thanks,

    Peer Mohamed.

  • Hi,

    You can try the below query. I'm connecting to the localserver using windows authentication

    bcp ASPT.dbo.tablename in A.dat -T -c

    Please note that you need to provide the table name to import the data, if the table doesnt exist, create the table with proper structure!!

  • I've got a set of BCP tutorials on my MidnightDBA site below. Go to the admin section and I think they're near the top.

    Watch my free SQL Server Tutorials at:
    http://MidnightDBA.com
    Blog Author of:
    DBA Rant – http://www.MidnightDBA.com/DBARant

    Minion Maintenance is FREE:

  • One of the clients sent me backup file once with .dat extention. I just restored it as regular backup. This may not be your case though.

  • peer_mohamed2k (6/19/2008)


    Hi,

    I have A.dat file. Using BCP How to restore file to a new database.

    I am trying in this way.

    BCP ASPT in -iA.dat -t

    Here ASPT is new databse name. It throws 'Object Not found' error.

    Can anyone help on this?

    Thanks,

    Peer Mohamed.

    Bcp dbo.ImpTst in 'D:\ImpData.txt' -T -S serverNameinstanceName

    Manoj

    MCP, MCTS (GDBA/EDA)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply