locked
How to retrore database with the sql scripted file. RRS feed

  • Question

  • User1052662409 posted

    Hi All,

    I have bought some hosting space with sql database. Now I make a sql file by scripting the database from my local machine.

    I am doing it like because I don't have access on server's any drive/device otherwise I would have restore it with my .bak file.

    Now I am trying to restore it by querying my scripted file but it shows many error.

    The scripted file is as follows

    USE [master]
    GO
    /****** Object:  Database [pmscomp]    Script Date: 3/23/2016 8:33:42 AM ******/
    alter DATABASE [pmscomp]
     CONTAINMENT = NONE
     ON  PRIMARY 
    ( NAME = N'PMS', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\pmscomp.mdf' , SIZE = 21440KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)
     LOG ON 
    ( NAME = N'PMS_log', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\pmscomp_1.ldf' , SIZE = 219264KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)
    GO
    ALTER DATABASE [pmscomp] SET COMPATIBILITY_LEVEL = 90

    Do I need to change the path "c:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\pmscomp.mdf" ? but I don't know the exact path.

    What to do?

    Thanks

    Wednesday, March 23, 2016 5:40 AM

Answers

  • User-821857111 posted

    First thing you should do is ask your hosting company for some support - even if it's just to point you to some information that they provide on the way you should do this. The process can differ from one host to another. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 23, 2016 7:39 AM

All replies

  • User-236208671 posted

    Please have a look on this post: http://blog.sqlauthority.com/2007/02/25/sql-server-restore-database-backup-using-sql-script-t-sql/

    Wednesday, March 23, 2016 7:34 AM
  • User-821857111 posted

    First thing you should do is ask your hosting company for some support - even if it's just to point you to some information that they provide on the way you should do this. The process can differ from one host to another. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 23, 2016 7:39 AM