附加SQL2005数据库出现“Transact-SQL...了异常”
附加数据库出错提示: 执行 Transact-SQL 语句或批处理时发生了异常。 (Microsoft.SqlServer.ConnectionInfo) ------------------------------ 未能在 sysindexes 中找到数据库 ID 7 中对象 ID 1 的索引 ID 1 对应的行。请对 sysindexes 运行 DBCC CHECKTABL
附加数据库出错提示:
执行 Transact-SQL 语句或批处理时发生了异常。 (Microsoft.SqlServer.ConnectionInfo)
------------------------------
未能在 sysindexes 中找到数据库 ID 7 中对象 ID 1 的索引 ID 1 对应的行。请对 sysindexes 运行 DBCC CHECKTABLE。
Could not find row in sysindexes for database ID 7, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
未能打开新数据库 'xiaoche'。CREATE DATABASE 将终止。 (Microsoft SQL Server,,错误: 602)
解决方法:
一、
.select @@version看当前的数据库实例版本,是不是SQL2000在附加SQL2005的数据库。
二、
SQL2000附加SQL2005数据具体方法
如题,若使用SQL2000附加SQL2005的数据库时在附加时会出现了错误602,提示“对sysindexes运行DBCC CHECKTABLE”因为数据库附加到2005的时候, 数据库文件已经自动升级到2005, 所以在2000下是无法再附加的(没有向上兼容的)
直接restore或附加是不行的, 用脚本+导数据肯定没有问题。
2005转到2000的步骤步骤
1. 生成for 2000版本的数据库脚本
2005 的manger studio
-- 打开"对象资源管理器"(没有的话按F8), 连接到你的实例
-- 右键要转到2000的库
-- 任务
-- 生成脚本
-- 在"脚本向导"的"选择数据库"中, 确定选择的是要转到2000的库
-- 勾选"为所选数据库中的所有对象编写脚本"
-- 在接下来的"选择脚本选项"中, 找到"为服务器版本编写脚本"项, 选择"SQL Server 2000"
-- 其他选项根据需要设置
-- 最后把脚本保存到一个 .sql 脚本文件
2. 在2000中创建目标数据库
在查询分析器(或2005的manger studio在打开脚本文件), 连接到SQL Server 2000,执行上面生成的脚本.以创建一个新的数据库
3. 将数据从2005导到2000
2005 的manger studio
-- 打开"对象资源管理器"(没有的话按F8), 连接到你的实例
-- 右键要转到2000的库
-- 任务
-- 导出数据
-- 在"SQL Server 导入和导出向导"的"选择数据源"步骤中, 确定选择的是要导出的数据库
-- 在"选择目标"步骤中, 连接到 2000, 并选择步骤2新建的库
-- 在"选择源表和源视图"中, 选择所有的表
-- 最后完成

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

Analysis of the basic principles of the MySQL database management system MySQL is a commonly used relational database management system that uses structured query language (SQL) for data storage and management. This article will introduce the basic principles of the MySQL database management system, including database creation, data table design, data addition, deletion, modification, and other operations, and provide specific code examples. 1. Database Creation In MySQL, you first need to create a database instance to store data. The following code can create a file named "my

How to integrate GoWebSocket with a database: Set up a database connection: Use the database/sql package to connect to the database. Store WebSocket messages to the database: Use the INSERT statement to insert the message into the database. Retrieve WebSocket messages from the database: Use the SELECT statement to retrieve messages from the database.

PHP is a back-end programming language widely used in website development. It has powerful database operation functions and is often used to interact with databases such as MySQL. However, due to the complexity of Chinese character encoding, problems often arise when dealing with Chinese garbled characters in the database. This article will introduce the skills and practices of PHP in handling Chinese garbled characters in databases, including common causes of garbled characters, solutions and specific code examples. Common reasons for garbled characters are incorrect database character set settings: the correct character set needs to be selected when creating the database, such as utf8 or u
