0

I have a database in SQL Server that i create backup file from it. Now i create a new database and i try to restore backup to this new database.

I try to restore a database from a .bak file. When I restore it in SQL Server, I get a "successful" message, but all tables and stored procedures are not restored.

What is problem?

hmahdavi
  • 2,250
  • 3
  • 38
  • 90
  • 1
    Have you tried refreshing tables & stored procedures to see if they show up? Have you tried a new query and running a select statement against one of the tables that was restored? – dnunez32 Nov 10 '19 at 06:07
  • ok I refresh tables and stored procedures but dont solved. Then i execute query that get error : Invalid object name – hmahdavi Nov 10 '19 at 06:20
  • 1
    These are older threads, but they may help out for your situation: 1) https://stackoverflow.com/questions/1362531/sql-server-invalid-object-name-but-tables-are-listed-in-ssms-tables-list 2) https://stackoverflow.com/questions/6711474/invalid-object-name-after-restoring-sql-server-2008-database – dnunez32 Nov 10 '19 at 06:28
  • Not relevant to my case – hmahdavi Nov 10 '19 at 07:43
  • 2
    My first guess is that you didn't restore to the database you thought you restored to, or the backup doesn't contain what you think it does. – Nick.Mc Nov 10 '19 at 08:37
  • Backup file contains all data because when i restore this file into database with same name restored currently!!!! – hmahdavi Nov 10 '19 at 09:20

2 Answers2

0

but all tables and stored procedures are not restored.

It means that you can see newly restored database in SQL server. in that case verify the .bak file to check whether it's got actually all those required Tables/Procedures part of it, or the same .bak file might have appended with empty database backup (for some reason). You can check that with following query:

RESTORE HEADERONLY FROM DISK = 'C:\Backups\AppendedBackup.bak';
Shekar Kola
  • 1,287
  • 9
  • 15
0

I do this settings and restored currently. enter image description here enter image description here

hmahdavi
  • 2,250
  • 3
  • 38
  • 90