• Here are the steps I have followed:

    1.Took a full back up of an existing database (abc.bak)

    2.Executed your script, but using entirely new database name thinking that it will create a new database and restores the data from the backup.

    So your script works only if the target database already exists. I was thinking even if it doesn't exist it will create a database with new name.

    PLEASE CLARIFY MY UNDERSTANDING IS CORRECT.