Showing posts with label attach. Show all posts
Showing posts with label attach. Show all posts

Wednesday, March 7, 2012

could not find row in sysindexes for database

I am trying to attach a database that was created on another server. I believe the database was created using SQL Server Management Studio Express 2005. Now, I have successfully attached the database in my development environment, which is using SQL Server Management Studio Express 2005.

However, when I tried to attach the database onto our production server, which is SQL Server 2000 I received the error:

Error 602:
Could not find row in sysindexes for database ID 18, object ID 1, index ID 1. Run DBCC CheckTable on sysindexes.

In my development environment, I ran DBCC CheckDB on the source database and no errors are returned.

I aslo checked the compatibility level under the database properties and it shows: Sql Server 2000 (80)

So, this should not be a version incompatibility issue. What is causing the attach to fail on SQL Server 2000?

Thanks for any help.

What I know is:

If you have an .mdf file in SQL Server 2000, then you attached it to SQL Server 2005 ... no way you can use it (the .mdf file) again with SQL Server 2000.

What I think about is SQL Serve 2006 .mdf files can not be used with SQL Server 2000!!

Try Backup/Restore option or Copy Database Wizard.

Good luck.

|||

Are you trying to attach a SQL 2005 database to a SQL 2000 server? If so, that's the issue. Obviously you can upgrade (2000 --> 2005), but you can't downgrade.

-Damien

|||

CS4Ever:

What I know is:

If you have an .mdf file in SQL Server 2000, then you attached it to SQL Server 2005 ... no way you can use it (the .mdf file) again with SQL Server 2000.

What I think about is SQL Serve 2006 .mdf files can not be used with SQL Server 2000!!

Try Backup/Restore option or Copy Database Wizard.

Good luck.

Here is a link that support what I wrote and it marked as answered in MSDN forum: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=165696&SiteID=17

This link might be helpful for you as well: http://sqlserver-qa.net/blogs/tools/archive/2007/08/14/error-could-not-find-row-in-sysindexes-for-database-8966-823-and-602.aspx

Good luck.

Could Not Find Row In Sysindexes

Folks,
I have an MDF and LDF file which I am attempting to attach as a SQL db. I
keep getting the error 602 that begins with "could not find row in sysindexes
for database ID 13, object id 1, index id 1".
I think MDF and LDF files are SQL 2000, but I'm having my doubts. If I tried
to load MDF and LDF files into 2000 that had been tweaked by 2005, would I
get this error?
Bob Sullentrup
> I think MDF and LDF files are SQL 2000, but I'm having my doubts. If I
> tried
> to load MDF and LDF files into 2000 that had been tweaked by 2005, would I
> get this error?
Yes, that is the error you get when trying to attach a database that is from
a higher version of SQL Server.
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
"Bob Sullentrup" <BobSullentrup@.discussions.microsoft.com> wrote in message
news:0BE96022-FD34-41CB-AFFE-18B3D3B2FEA7@.microsoft.com...
> Folks,
> I have an MDF and LDF file which I am attempting to attach as a SQL db. I
> keep getting the error 602 that begins with "could not find row in
> sysindexes
> for database ID 13, object id 1, index id 1".
> I think MDF and LDF files are SQL 2000, but I'm having my doubts. If I
> tried
> to load MDF and LDF files into 2000 that had been tweaked by 2005, would I
> get this error?
> --
> Bob Sullentrup
|||Hi,
Looks like your database is corrupted. Do you a good copy of database in
your server; else you may need to restore
from a good backup available.
For SQL 2000; Please execute DBCC CHECKDB atleast weekly once to chek if
there is any corruptions.
Thanks
Hari
"Bob Sullentrup" <BobSullentrup@.discussions.microsoft.com> wrote in message
news:0BE96022-FD34-41CB-AFFE-18B3D3B2FEA7@.microsoft.com...
> Folks,
> I have an MDF and LDF file which I am attempting to attach as a SQL db. I
> keep getting the error 602 that begins with "could not find row in
> sysindexes
> for database ID 13, object id 1, index id 1".
> I think MDF and LDF files are SQL 2000, but I'm having my doubts. If I
> tried
> to load MDF and LDF files into 2000 that had been tweaked by 2005, would I
> get this error?
> --
> Bob Sullentrup
|||And the answer is ...
I installed SQL Server 2005 and tried to load my mdf file. It worked
perfectly, so clearly I was trying to load into SQL Server 2000 something
that had the 2005 format.
Meanwhile, I scripted the objects and tweaked the script and loaded the
gemisch into SQL 2000. Then I exported the data from 2005 into 2000. Works
like a charm in SQL 2000 now.
Bob Sullentrup
"Gail Erickson [MS]" wrote:

> Yes, that is the error you get when trying to attach a database that is from
> a higher version of SQL Server.
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> Download the latest version of Books Online from
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> "Bob Sullentrup" <BobSullentrup@.discussions.microsoft.com> wrote in message
> news:0BE96022-FD34-41CB-AFFE-18B3D3B2FEA7@.microsoft.com...
>
>

Could Not Find Row In Sysindexes

Folks,
I have an MDF and LDF file which I am attempting to attach as a SQL db. I
keep getting the error 602 that begins with "could not find row in sysindexe
s
for database ID 13, object id 1, index id 1".
I think MDF and LDF files are SQL 2000, but I'm having my doubts. If I tried
to load MDF and LDF files into 2000 that had been tweaked by 2005, would I
get this error?
--
Bob Sullentrup> I think MDF and LDF files are SQL 2000, but I'm having my doubts. If I
> tried
> to load MDF and LDF files into 2000 that had been tweaked by 2005, would I
> get this error?
Yes, that is the error you get when trying to attach a database that is from
a higher version of SQL Server.
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://www.microsoft.com/technet/pr...oads/books.mspx
"Bob Sullentrup" <BobSullentrup@.discussions.microsoft.com> wrote in message
news:0BE96022-FD34-41CB-AFFE-18B3D3B2FEA7@.microsoft.com...
> Folks,
> I have an MDF and LDF file which I am attempting to attach as a SQL db. I
> keep getting the error 602 that begins with "could not find row in
> sysindexes
> for database ID 13, object id 1, index id 1".
> I think MDF and LDF files are SQL 2000, but I'm having my doubts. If I
> tried
> to load MDF and LDF files into 2000 that had been tweaked by 2005, would I
> get this error?
> --
> Bob Sullentrup|||Hi,
Looks like your database is corrupted. Do you a good copy of database in
your server; else you may need to restore
from a good backup available.
For SQL 2000; Please execute DBCC CHECKDB atleast weekly once to chek if
there is any corruptions.
Thanks
Hari
"Bob Sullentrup" <BobSullentrup@.discussions.microsoft.com> wrote in message
news:0BE96022-FD34-41CB-AFFE-18B3D3B2FEA7@.microsoft.com...
> Folks,
> I have an MDF and LDF file which I am attempting to attach as a SQL db. I
> keep getting the error 602 that begins with "could not find row in
> sysindexes
> for database ID 13, object id 1, index id 1".
> I think MDF and LDF files are SQL 2000, but I'm having my doubts. If I
> tried
> to load MDF and LDF files into 2000 that had been tweaked by 2005, would I
> get this error?
> --
> Bob Sullentrup|||And the answer is ...
I installed SQL Server 2005 and tried to load my mdf file. It worked
perfectly, so clearly I was trying to load into SQL Server 2000 something
that had the 2005 format.
Meanwhile, I scripted the objects and tweaked the script and loaded the
gemisch into SQL 2000. Then I exported the data from 2005 into 2000. Works
like a charm in SQL 2000 now.
Bob Sullentrup
"Gail Erickson [MS]" wrote:

> Yes, that is the error you get when trying to attach a database that is fr
om
> a higher version of SQL Server.
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> Download the latest version of Books Online from
> http://www.microsoft.com/technet/pr...oads/books.mspx
> "Bob Sullentrup" <BobSullentrup@.discussions.microsoft.com> wrote in messag
e
> news:0BE96022-FD34-41CB-AFFE-18B3D3B2FEA7@.microsoft.com...
>
>

Sunday, February 19, 2012

Could not allocate space because the 'DEFAULT' filegroup is full.

We are getting the error below when trying to attach a MS SQL 2005 Express
Database with a size of around 2GB.
The database had some issues before we detached the database and now we can
not attach.
There are a number of other databases in the primary filegroup but they are
all very small i.e. no more than 100Mb total in size.
Is this a configuration issue of some sort or a database corruption issue.
==================
TITLE: Microsoft SQL Server Management Studio Express
Attach database failed for Server 'ONLINE-INT'.
(Microsoft.SqlServer.Express.Smo)
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.Express.ConnectionInfo)
Could not allocate space for object 'events' in database 'port' because the
'DEFAULT' filegroup is full.
Error while undoing logged operation in database 'port'. Error at log record
ID (11807:19741:34).
Could not open new database 'port'. CREATE DATABASE is aborted.
1 transactions rolled forward in database 'port' (10). (Microsoft SQL
Server, Error: 1105)
PSernz
Hi
Do you have free space on the filesystem ?
"PSernz" <PSernz@.discussions.microsoft.com> wrote in message
news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
> We are getting the error below when trying to attach a MS SQL 2005 Express
> Database with a size of around 2GB.
> The database had some issues before we detached the database and now we
> can
> not attach.
> There are a number of other databases in the primary filegroup but they
> are
> all very small i.e. no more than 100Mb total in size.
> Is this a configuration issue of some sort or a database corruption issue.
>
> ==================
> TITLE: Microsoft SQL Server Management Studio Express
> --
> Attach database failed for Server 'ONLINE-INT'.
> (Microsoft.SqlServer.Express.Smo)
> --
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.Express.ConnectionInfo)
> --
> Could not allocate space for object 'events' in database 'port' because
> the
> 'DEFAULT' filegroup is full.
> Error while undoing logged operation in database 'port'. Error at log
> record
> ID (11807:19741:34).
> Could not open new database 'port'. CREATE DATABASE is aborted.
> 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
> Server, Error: 1105)
>
>
> PSernz
|||Yes I have 5Gb free on the disk that contains all Primary files.
PSernz
"Uri Dimant" wrote:

> Hi
> Do you have free space on the filesystem ?
>
>
> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
> news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
>
>
|||Hi
Do you have valid BACKUP of the database? Have you tried RESTORE?
"PSernz" <PSernz@.discussions.microsoft.com> wrote in message
news:0F6C0960-F410-46D5-87AE-8890D3163D55@.microsoft.com...[vbcol=seagreen]
> Yes I have 5Gb free on the disk that contains all Primary files.
>
> --
> PSernz
>
> "Uri Dimant" wrote:
|||Unfortunately not and hence we are hopeful that this is a config issue and
not a data integrity issue.
PSernz
"Uri Dimant" wrote:

> Hi
> Do you have valid BACKUP of the database? Have you tried RESTORE?
>
>
> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
> news:0F6C0960-F410-46D5-87AE-8890D3163D55@.microsoft.com...
>
>

Could not allocate space because the 'DEFAULT' filegroup is full.

We are getting the error below when trying to attach a MS SQL 2005 Express
Database with a size of around 2GB.
The database had some issues before we detached the database and now we can
not attach.
There are a number of other databases in the primary filegroup but they are
all very small i.e. no more than 100Mb total in size.
Is this a configuration issue of some sort or a database corruption issue.
==================
TITLE: Microsoft SQL Server Management Studio Express
--
Attach database failed for Server 'ONLINE-INT'.
(Microsoft.SqlServer.Express.Smo)
--
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.Express.ConnectionInfo)
--
Could not allocate space for object 'events' in database 'port' because the
'DEFAULT' filegroup is full.
Error while undoing logged operation in database 'port'. Error at log record
ID (11807:19741:34).
Could not open new database 'port'. CREATE DATABASE is aborted.
1 transactions rolled forward in database 'port' (10). (Microsoft SQL
Server, Error: 1105)
PSernzHi
Do you have free space on the filesystem ?
"PSernz" <PSernz@.discussions.microsoft.com> wrote in message
news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
> We are getting the error below when trying to attach a MS SQL 2005 Express
> Database with a size of around 2GB.
> The database had some issues before we detached the database and now we
> can
> not attach.
> There are a number of other databases in the primary filegroup but they
> are
> all very small i.e. no more than 100Mb total in size.
> Is this a configuration issue of some sort or a database corruption issue.
>
> ==================> TITLE: Microsoft SQL Server Management Studio Express
> --
> Attach database failed for Server 'ONLINE-INT'.
> (Microsoft.SqlServer.Express.Smo)
> --
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.Express.ConnectionInfo)
> --
> Could not allocate space for object 'events' in database 'port' because
> the
> 'DEFAULT' filegroup is full.
> Error while undoing logged operation in database 'port'. Error at log
> record
> ID (11807:19741:34).
> Could not open new database 'port'. CREATE DATABASE is aborted.
> 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
> Server, Error: 1105)
>
>
> PSernz|||Yes I have 5Gb free on the disk that contains all Primary files.
PSernz
"Uri Dimant" wrote:
> Hi
> Do you have free space on the filesystem ?
>
>
> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
> news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
> > We are getting the error below when trying to attach a MS SQL 2005 Express
> > Database with a size of around 2GB.
> >
> > The database had some issues before we detached the database and now we
> > can
> > not attach.
> >
> > There are a number of other databases in the primary filegroup but they
> > are
> > all very small i.e. no more than 100Mb total in size.
> >
> > Is this a configuration issue of some sort or a database corruption issue.
> >
> >
> > ==================> >
> > TITLE: Microsoft SQL Server Management Studio Express
> > --
> >
> > Attach database failed for Server 'ONLINE-INT'.
> > (Microsoft.SqlServer.Express.Smo)
> >
> > --
> > ADDITIONAL INFORMATION:
> >
> > An exception occurred while executing a Transact-SQL statement or batch.
> >
> > (Microsoft.SqlServer.Express.ConnectionInfo)
> >
> > --
> >
> > Could not allocate space for object 'events' in database 'port' because
> > the
> > 'DEFAULT' filegroup is full.
> > Error while undoing logged operation in database 'port'. Error at log
> > record
> > ID (11807:19741:34).
> > Could not open new database 'port'. CREATE DATABASE is aborted.
> > 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
> > Server, Error: 1105)
> >
> >
> >
> >
> > PSernz
>
>|||Hi
Do you have valid BACKUP of the database? Have you tried RESTORE?
"PSernz" <PSernz@.discussions.microsoft.com> wrote in message
news:0F6C0960-F410-46D5-87AE-8890D3163D55@.microsoft.com...
> Yes I have 5Gb free on the disk that contains all Primary files.
>
> --
> PSernz
>
> "Uri Dimant" wrote:
>> Hi
>> Do you have free space on the filesystem ?
>>
>>
>> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
>> news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
>> > We are getting the error below when trying to attach a MS SQL 2005
>> > Express
>> > Database with a size of around 2GB.
>> >
>> > The database had some issues before we detached the database and now we
>> > can
>> > not attach.
>> >
>> > There are a number of other databases in the primary filegroup but they
>> > are
>> > all very small i.e. no more than 100Mb total in size.
>> >
>> > Is this a configuration issue of some sort or a database corruption
>> > issue.
>> >
>> >
>> > ==================>> >
>> > TITLE: Microsoft SQL Server Management Studio Express
>> > --
>> >
>> > Attach database failed for Server 'ONLINE-INT'.
>> > (Microsoft.SqlServer.Express.Smo)
>> >
>> > --
>> > ADDITIONAL INFORMATION:
>> >
>> > An exception occurred while executing a Transact-SQL statement or
>> > batch.
>> >
>> > (Microsoft.SqlServer.Express.ConnectionInfo)
>> >
>> > --
>> >
>> > Could not allocate space for object 'events' in database 'port' because
>> > the
>> > 'DEFAULT' filegroup is full.
>> > Error while undoing logged operation in database 'port'. Error at log
>> > record
>> > ID (11807:19741:34).
>> > Could not open new database 'port'. CREATE DATABASE is aborted.
>> > 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
>> > Server, Error: 1105)
>> >
>> >
>> >
>> >
>> > PSernz
>>|||Unfortunately not and hence we are hopeful that this is a config issue and
not a data integrity issue.
--
PSernz
"Uri Dimant" wrote:
> Hi
> Do you have valid BACKUP of the database? Have you tried RESTORE?
>
>
> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
> news:0F6C0960-F410-46D5-87AE-8890D3163D55@.microsoft.com...
> > Yes I have 5Gb free on the disk that contains all Primary files.
> >
> >
> > --
> > PSernz
> >
> >
> > "Uri Dimant" wrote:
> >
> >> Hi
> >> Do you have free space on the filesystem ?
> >>
> >>
> >>
> >>
> >> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
> >> news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
> >> > We are getting the error below when trying to attach a MS SQL 2005
> >> > Express
> >> > Database with a size of around 2GB.
> >> >
> >> > The database had some issues before we detached the database and now we
> >> > can
> >> > not attach.
> >> >
> >> > There are a number of other databases in the primary filegroup but they
> >> > are
> >> > all very small i.e. no more than 100Mb total in size.
> >> >
> >> > Is this a configuration issue of some sort or a database corruption
> >> > issue.
> >> >
> >> >
> >> > ==================> >> >
> >> > TITLE: Microsoft SQL Server Management Studio Express
> >> > --
> >> >
> >> > Attach database failed for Server 'ONLINE-INT'.
> >> > (Microsoft.SqlServer.Express.Smo)
> >> >
> >> > --
> >> > ADDITIONAL INFORMATION:
> >> >
> >> > An exception occurred while executing a Transact-SQL statement or
> >> > batch.
> >> >
> >> > (Microsoft.SqlServer.Express.ConnectionInfo)
> >> >
> >> > --
> >> >
> >> > Could not allocate space for object 'events' in database 'port' because
> >> > the
> >> > 'DEFAULT' filegroup is full.
> >> > Error while undoing logged operation in database 'port'. Error at log
> >> > record
> >> > ID (11807:19741:34).
> >> > Could not open new database 'port'. CREATE DATABASE is aborted.
> >> > 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
> >> > Server, Error: 1105)
> >> >
> >> >
> >> >
> >> >
> >> > PSernz
> >>
> >>
> >>
>
>

Could not allocate space because the 'DEFAULT' filegroup is full.

We are getting the error below when trying to attach a MS SQL 2005 Express
Database with a size of around 2GB.
The database had some issues before we detached the database and now we can
not attach.
There are a number of other databases in the primary filegroup but they are
all very small i.e. no more than 100Mb total in size.
Is this a configuration issue of some sort or a database corruption issue.
==================
TITLE: Microsoft SQL Server Management Studio Express
--
Attach database failed for Server 'ONLINE-INT'.
(Microsoft.SqlServer.Express.Smo)
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.Express.ConnectionInfo)
Could not allocate space for object 'events' in database 'port' because the
'DEFAULT' filegroup is full.
Error while undoing logged operation in database 'port'. Error at log record
ID (11807:19741:34).
Could not open new database 'port'. CREATE DATABASE is aborted.
1 transactions rolled forward in database 'port' (10). (Microsoft SQL
Server, Error: 1105)
PSernzHi
Do you have free space on the filesystem ?
"PSernz" <PSernz@.discussions.microsoft.com> wrote in message
news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
> We are getting the error below when trying to attach a MS SQL 2005 Express
> Database with a size of around 2GB.
> The database had some issues before we detached the database and now we
> can
> not attach.
> There are a number of other databases in the primary filegroup but they
> are
> all very small i.e. no more than 100Mb total in size.
> Is this a configuration issue of some sort or a database corruption issue.
>
> ==================
> TITLE: Microsoft SQL Server Management Studio Express
> --
> Attach database failed for Server 'ONLINE-INT'.
> (Microsoft.SqlServer.Express.Smo)
> --
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.Express.ConnectionInfo)
> --
> Could not allocate space for object 'events' in database 'port' because
> the
> 'DEFAULT' filegroup is full.
> Error while undoing logged operation in database 'port'. Error at log
> record
> ID (11807:19741:34).
> Could not open new database 'port'. CREATE DATABASE is aborted.
> 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
> Server, Error: 1105)
>
>
> PSernz

Friday, February 17, 2012

Could anyone attach the AdventureWorksDW to their SQL Server database engine?

Hi, all here,

I got a problem when trying to attach the AdventureWorksDW sample database to the SQL Server database engine. Error occured as:could not find row in sysindexes for database ID 21, object ID 1, index ID 1, Run DBCC CHECKTABLE on sysindexes. The sample database was downloaded from

http://www.microsoft.com/downloads/details.aspx?FamilyID=e719ecf7-9f46-4312-af89-6ad8702e4e6e&DisplayLang=en.

So could anyone help me to solve this problem tho? thanks a lot for any guidance and help.

Hi Hellen,

Try isntall from scripts.. look this URL on BOL

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/7de6ceb0-be7a-4309-894b-a0963dc6c27b.htm

thx
Nilton

|||

Hi, Nilton, thanks a lot for your guidance.

My problem is: during the set up of the SQL Server 2005, the sample database was not selected to be installed, thus I actully not need to reinstall it in this way. Since currently I dont have the CD available tho.

My question is: the sample database is actually available online now, and I have got the database .mdf and .ldf files, while I cant attach the database to the SQL Server then? Thanks a lot in advance for your further guidance.

|||

Hi Helen,

Try the follow:

1. Create the AdvantureWorksDW on SQL Server with the same name and size that your .mdf and .ldf files. (note the path)
2. Detach the created database.
3. Locate files of the create database e replace it with you mdf and ldf files.
4. Try attach the database

I think that is should work

regards
Nilton Pinheiro

|||

Hi, Nilton,

thanks a lot. I have tried all the ways you taught me, but it just did not work. I tried different database files as well, but none of them could be attached to my SQL Server, it must be the problem of the Server tho. But I am not sure where is indeed the problem. Really need help.

Thanks a lot.

|||

Hi Helen,

You it applied the SP1 for the SQL Server 2005? If not, to apply and later tries again.

http://www.microsoft.com/downloads/details.aspx?familyid=CB6C71EA-D649-47FF-9176-E7CAC58FD4BC&displaylang=en

Otherwise try a previous version of sample (December 2005).

http://www.microsoft.com/downloads/details.aspx?familyid=9697AAAA-AD4B-416E-87A4-A8B154F92787&displaylang=en

regards
Nilton Pinheiro
www.mcdbabrasil.com.br

|||

Hi, Nilton,

Thanks a lot. I have tried ages to fix that problem, as you taught me tring to create a database first and then detach it, then replace its .mdf and .ldf files with my .mdf and .ldf files, then trying to attach the database again with SQL Scripts in Server management studio, but only those files created on my local host can be attached, other database files from outside of my local computer wont work. The error occured as I posted above. So what can I try to attach database files from outside of my local computer then? Really need help. Thanks a lot.

Kind regards,

|||

I am having the same exact problem and have been unable to find a resolution. Please post if/when you find something out.

Thanks,

Mike

Could anyone attach the AdventureWorksDW to their SQL Server database engine?

Hi, all here,

I got a problem when trying to attach the AdventureWorksDW sample database to the SQL Server database engine. Error occured as:could not find row in sysindexes for database ID 21, object ID 1, index ID 1, Run DBCC CHECKTABLE on sysindexes. The sample database was downloaded from

http://www.microsoft.com/downloads/details.aspx?FamilyID=e719ecf7-9f46-4312-af89-6ad8702e4e6e&DisplayLang=en.

So could anyone help me to solve this problem tho? thanks a lot for any guidance and help.

Hi Hellen,

Try isntall from scripts.. look this URL on BOL

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/7de6ceb0-be7a-4309-894b-a0963dc6c27b.htm

thx
Nilton

|||

Hi, Nilton, thanks a lot for your guidance.

My problem is: during the set up of the SQL Server 2005, the sample database was not selected to be installed, thus I actully not need to reinstall it in this way. Since currently I dont have the CD available tho.

My question is: the sample database is actually available online now, and I have got the database .mdf and .ldf files, while I cant attach the database to the SQL Server then? Thanks a lot in advance for your further guidance.

|||

Hi Helen,

Try the follow:

1. Create the AdvantureWorksDW on SQL Server with the same name and size that your .mdf and .ldf files. (note the path)
2. Detach the created database.
3. Locate files of the create database e replace it with you mdf and ldf files.
4. Try attach the database

I think that is should work

regards
Nilton Pinheiro

|||

Hi, Nilton,

thanks a lot. I have tried all the ways you taught me, but it just did not work. I tried different database files as well, but none of them could be attached to my SQL Server, it must be the problem of the Server tho. But I am not sure where is indeed the problem. Really need help.

Thanks a lot.

|||

Hi Helen,

You it applied the SP1 for the SQL Server 2005? If not, to apply and later tries again.

http://www.microsoft.com/downloads/details.aspx?familyid=CB6C71EA-D649-47FF-9176-E7CAC58FD4BC&displaylang=en

Otherwise try a previous version of sample (December 2005).

http://www.microsoft.com/downloads/details.aspx?familyid=9697AAAA-AD4B-416E-87A4-A8B154F92787&displaylang=en

regards
Nilton Pinheiro
www.mcdbabrasil.com.br

|||

Hi, Nilton,

Thanks a lot. I have tried ages to fix that problem, as you taught me tring to create a database first and then detach it, then replace its .mdf and .ldf files with my .mdf and .ldf files, then trying to attach the database again with SQL Scripts in Server management studio, but only those files created on my local host can be attached, other database files from outside of my local computer wont work. The error occured as I posted above. So what can I try to attach database files from outside of my local computer then? Really need help. Thanks a lot.

Kind regards,

|||

I am having the same exact problem and have been unable to find a resolution. Please post if/when you find something out.

Thanks,

Mike

Tuesday, February 14, 2012

Corrupted mdf

Hi Everyone,

when i am trying to attach a 'xxx.mdf' file it is showing message 'xxx.mdf' is not a primary database file.

Please suggest me what could be the reasons and what are the possible ways to recover my database.

I have lot of important data in the database.

Thanks and Regards,
ShashidharWe need substantially more information here.

What version of SQL?
What OS?

How did the file become detached in the first place (deliberate action, a download, or was it recovered from some where?)

Is is possible that the file is one of multiple files belonging to a single database?

Where is the log file?

What is the precise error message you are getting?

Did you google that error message?

And, if it's got so much valuable information, where's your backup?

Regards,

hmscott|||Go back to the server that this database was detached from. If you only copied the files, as opposed to moving them, you should be able to find all the files needed for the database. The error message means that SQL Server can not find the system tables in the file you listed first in the sp_attach_db statement. If you have multiple data files (as I strongly suspect from the error message), try changing the order of them in the sp_attach_db statement.
Lesson for the future: Always write down the order of the files BEFORE attaching them.|||I would say it's not a primary database file|||Correct me if I am wrong but isn't the mdf file always the primary database files and the ndf is secondary?|||Consider yourself corrected. The file extension is only suggested, and in no way means that a file is a primary or secondary file. You can make all of your files MDF, NDF, LDF, or even BOB.|||... or even BOB.

BOB. I like BOB. ;)

Regards,

hmscott|||I think I might prefer LongTallSally