如何更正sql server错误消息:208? [英] How can I correct sql server error message :208?

查看:1285
本文介绍了如何更正sql server错误消息:208?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上我遵循了用C#备份SQL数据库的代码程序..

Actually I followed ur code procedure for Backing up an SQL Database in C#..

public static void BackupDatabase(string backUpFile)
    {
    ServerConnection con = new ServerConnection(@"xxxxx\SQLEXPRESS");
    Server server = new Server(con);
    Backup source = new Backup();
    source.Action = BackupActionType.Database;
    source.Database = "MyDataBaseName";
    BackupDeviceItem destination = new BackupDeviceItem(backUpFile, DeviceType.File);
    source.Devices.Add(destination);
    source.SqlBackup(server);
    con.Disconnect();
    }

public static void RestoreDatabase(string backUpFile)
    {
    ServerConnection con = new ServerConnection(@"xxxxx\SQLEXPRESS");
    Server server = new Server(con);
    Restore destination = new Restore();
    destination.Action = RestoreActionType.Database;
    destination.Database = "MyDataBaseName";
    BackupDeviceItem source = new BackupDeviceItem(backUpFile, DeviceType.File);
    destination.Devices.Add(source);
    destination.ReplaceDatabase = true;
    destination.SqlRestore(server);
    }





正确支持数据库在指定位置并且在我尝试恢复我已经支持数据库的数据库之后文件,所以在那之后我在sql server 2008中得到数据库错误,因为MS SQL错误:208无效的对象名称。

所以我需要做的是在sql server 2008中恢复我的数据库.. 。:(



It's backed database at specified location correctly and after I tried to restore the database from which I had already backed database file,so after that onwards Iám getting database error in sql server 2008 as MS SQL Error: 208 "Invalid object name".
so what I need to do for restore my database in sql server 2008...:(

推荐答案

最有可能的原因是备份和恢复不会使用相同版本的SQL:如果源是更高版本,那么它可以包括目的地不理解的备份中的数据。



首先查看数据库安装并检查修订级别。
Most likely reason is that the backup and restore are not going to the same version of SQL: if the source is a higher revision, then it could include data in the backup which the destination does not understand.

So start by looking at your database installations and check the revision levels.


错误208


这篇关于如何更正sql server错误消息:208?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆