How can we move mdf files from one drive to another with tsql

  • How can we move mdf files from one drive to another with tsql i know how to do with ssms .

    Thaxxx

    Regards

    jagpal singh

  • Have you tried the trusty "Script action to new query window"?

    "Got no time for the jibba jabba!"
    -B.A. Baracus

  • yes but i need another script like in which i can attach that detach file with one script .

  • exec sp_detach_db ...

    exec master.xp_cmdshell 'move ...'

    exec sp_attach_db ...

    Or do you need a more detailled answer?

    Wilfred
    The best things in life are the simple things

  • hi,

    thaxx for reply i know these syntax but i need more information about this .

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

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