Showing posts with label downloaded. Show all posts
Showing posts with label downloaded. Show all posts

Friday, March 9, 2012

Error When Attaching Database

Hello Everyone,

I am very new to SQL and just completed an install of SQL 2005 Express. After install, I downloaded the Adventure Works database and attempted to attach through both the Object Browser (right-click 'Databases'>'Attach') and by running the script that is located on the SQL download page where I got the Adventure Works db.

Here's the error that I get:

"Could not find row in sysindexes for database ID 8, object ID 1, Index ID 1. Run DBCC CHECKTABLE on sysindexes."

I have attempted to go through the help files, but unfortunately the above message is too cryptic for me and I have no idea what it's telling me.

Can someone help?

Thanks!!

YOu can either use the attach method OR create the database with the scripts. There is no need to execute both, as they will end up both with a working Adventureworks database. I always prefer to execute the script as I am able to have a hand on the scripts first :-)

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Thank you for the help, Jens.

For what it's worth, I mentioned in my post that I tried both methods of attaching the database because neither of them worked. However, I have discovered why they didn't work:

When I went the Visual Studio page earlier this evening, I chose to install the SQL Server Express Tools thinking that this would give me the total installation including the SQL database engine. Apparently I was wrong. When choosing this option, what I got was the Management Studio and the Business Intelligence Development Studio. I was further led into thinking that I had everything I needed because I currently have the trial edition of SQL Server 2000 Enterprise Edition installed (the books I use in my SQL class are written in ANSI 92 so we only use 2000)...i'm sure you can imagine what happened after opening Management Studio for the first time - I get a connection to my SQL 2000 server complete with all of the databases I had installed over there. VERY CONFUSING if I do say so myself.

What I ultimately had to do was go back to the Visual Studio Express site and download the SQL 2005 Express engine and then install a new named instance. After I did this, I was able to then download the Adventure Works database and attach it successfully.

Not bad for a newbie, eh?!

I have always found SQL confusing which is why I saved it for last in my studies. This is my opinion here so take it for what it's worth - but if Microsoft wants more hobbyists and folks who are curious about IT to download SQL Express, then they need to better clarify and explain the difference between the various download options and the absolute importance of installing the SQL Express engine first. I can just imagine some people out there getting very frustrated and giving up completely.

I hope this helps some folks.

Thanks!!

|||

Hi Dear,

I got the same problem while attaching my database. Actully I received mdf and ldf file which was created in sql 2005. But I was not aware of that. Reading your post help me.

Thanks a lot.

Error When Attaching Adventure Works Database

Hello Everyone,

I am very new to SQL and just completed an install of SQL 2005 Express. After install, I downloaded the Adventure Works database and attempted to attach through both the Object Browser (right-click 'Databases'>'Attach') and by running the script that is located on the SQL download page where I got the Adventure Works db.

Here's the error that I get:

"Could not find row in sysindexes for database ID 8, object ID 1, Index ID 1. Run DBCC CHECKTABLE on sysindexes."

I have attempted to go through the help files, but unfortunately the above message is too cryptic for me and I have no idea what it's telling me.

Can someone help?

Thanks!!

YOu can either use the attach method OR create the database with the scripts. There is no need to execute both, as they will end up both with a working Adventureworks database. I always prefer to execute the script as I am able to have a hand on the scripts first :-)

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Thank you for the help, Jens.

For what it's worth, I mentioned in my post that I tried both methods of attaching the database because neither of them worked. However, I have discovered why they didn't work:

When I went the Visual Studio page earlier this evening, I chose to install the SQL Server Express Tools thinking that this would give me the total installation including the SQL database engine. Apparently I was wrong. When choosing this option, what I got was the Management Studio and the Business Intelligence Development Studio. I was further led into thinking that I had everything I needed because I currently have the trial edition of SQL Server 2000 Enterprise Edition installed (the books I use in my SQL class are written in ANSI 92 so we only use 2000)...i'm sure you can imagine what happened after opening Management Studio for the first time - I get a connection to my SQL 2000 server complete with all of the databases I had installed over there. VERY CONFUSING if I do say so myself.

What I ultimately had to do was go back to the Visual Studio Express site and download the SQL 2005 Express engine and then install a new named instance. After I did this, I was able to then download the Adventure Works database and attach it successfully.

Not bad for a newbie, eh?!

I have always found SQL confusing which is why I saved it for last in my studies. This is my opinion here so take it for what it's worth - but if Microsoft wants more hobbyists and folks who are curious about IT to download SQL Express, then they need to better clarify and explain the difference between the various download options and the absolute importance of installing the SQL Express engine first. I can just imagine some people out there getting very frustrated and giving up completely.

I hope this helps some folks.

Thanks!!

|||

Hi Dear,

I got the same problem while attaching my database. Actully I received mdf and ldf file which was created in sql 2005. But I was not aware of that. Reading your post help me.

Thanks a lot.

Error when accessing sample databases

Hey, Everyone - I have downloaded two of the sample databases and get the following error when I attempt to open them:

Unable to open the physical file "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Assets_Maintenance_log.ldf". Operating system error 2: "2(The system cannot find the file specified.)". (Microsoft SQL Server, Error: 5120)

So what am I doing wrong? The install of these sample databases is simple and straight-forward.

Thansk!

Regards,

Bob Mitchell

Hi,

The database file won't open this way, you have to go through the SQL Server Management studio, the file you are trying to open is ldf (Transaction Log file).

If you have just copied/extracted .mdf and .ldf files then you need to attach them using your SQL Server Management Studio, to do this

Open your SQL Server Management Studio -> Login to your Server -> Expand your server-> Expand Database Folder -> right click on Database folder -> click on attach-> select the .mdf file from the location you copied/extracted database files-> ok

this will attach database to your server, then you need to query it through query analyzer window or you may browse/open table from management studio.

Feel free to ask if you have more doubts

HTH

|||

refer this link

Running Setup to Install AdventureWorks Sample Databases and Samples :

http://msdn2.microsoft.com/en-us/library/ms143804.aspx

Madhu

|||

Thanks for the quick replies! Unfortunately, I'm still having the same problem.

I download the database executable, sse-dm_01.EXE and run it. I select my H drive for the install. The executable extracts 5 files to the folder I have chosen. None of them is a *.ldf file.

When I go to attach the database, I get the error that file c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Assets_Maintenance_log.ldf cannot be found.

What I find confusing is that no *.ldf file is even extracted so even if I were able to point the attach to the H drive for the ldf file, it still would not find it.

Still need some help!!!

Thanks!

Regards,

Bob Mitchell

|||

Bob,

Have you found a solution to this problem?

I have been struggling with this same problem for a long time tonight, but I finally found the solution.

On the list of files at the bottom of the Attach Database screen delete the reference to the xxxxxxxx-log.ldf file that is listed as "Not Found." You can delete the reference to the file by selecting it and then pressing the Remove button. Once you have deleted the file then go ahead and click OK to complete the attachment to the database.

Hope this helps. It worked on the couple of samples I downloaded.

-eric

Error when accessing sample databases

Hey, Everyone - I have downloaded two of the sample databases and get the following error when I attempt to open them:

Unable to open the physical file "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Assets_Maintenance_log.ldf". Operating system error 2: "2(The system cannot find the file specified.)". (Microsoft SQL Server, Error: 5120)

So what am I doing wrong? The install of these sample databases is simple and straight-forward.

Thansk!

Regards,

Bob Mitchell

Hi,

The database file won't open this way, you have to go through the SQL Server Management studio, the file you are trying to open is ldf (Transaction Log file).

If you have just copied/extracted .mdf and .ldf files then you need to attach them using your SQL Server Management Studio, to do this

Open your SQL Server Management Studio -> Login to your Server -> Expand your server-> Expand Database Folder -> right click on Database folder -> click on attach-> select the .mdf file from the location you copied/extracted database files-> ok

this will attach database to your server, then you need to query it through query analyzer window or you may browse/open table from management studio.

Feel free to ask if you have more doubts

HTH

|||

refer this link

Running Setup to Install AdventureWorks Sample Databases and Samples :

http://msdn2.microsoft.com/en-us/library/ms143804.aspx

Madhu

|||

Thanks for the quick replies! Unfortunately, I'm still having the same problem.

I download the database executable, sse-dm_01.EXE and run it. I select my H drive for the install. The executable extracts 5 files to the folder I have chosen. None of them is a *.ldf file.

When I go to attach the database, I get the error that file c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Assets_Maintenance_log.ldf cannot be found.

What I find confusing is that no *.ldf file is even extracted so even if I were able to point the attach to the H drive for the ldf file, it still would not find it.

Still need some help!!!

Thanks!

Regards,

Bob Mitchell

|||

Bob,

Have you found a solution to this problem?

I have been struggling with this same problem for a long time tonight, but I finally found the solution.

On the list of files at the bottom of the Attach Database screen delete the reference to the xxxxxxxx-log.ldf file that is listed as "Not Found." You can delete the reference to the file by selecting it and then pressing the Remove button. Once you have deleted the file then go ahead and click OK to complete the attachment to the database.

Hope this helps. It worked on the couple of samples I downloaded.

-eric

Wednesday, February 15, 2012

error running sp_stored_procedures

I downloaded the code example "Running Stored Procedures with ASP.NET" (http://www.dotnetjunkies.com/Tutorial/9AE62C44-3841-4687-B906-2F6D4A5A4622.dcik)
and I'm having trouble filtering the sp's that are populating the drop down box. Here's my code: (all I did was add the one parameter)

Dim ds As New DataSet

Dim conn As New SqlConnection( _
Data source=" & DatabaseServer.Text & _
";User id=" & Userid.text & _
";Password=" & Password.Text & _
";Initial catalog=" & Database.Text)

Dim cmd As New SqlCommand("sp_stored_procedures", conn)
Dim adpt As New SqlDataAdapter(cmd)
Try
cmd.Parameters.Add("@.sp_name", SqlDbType.NVarchar, 390).Value = CType("my%", String)

so if I comment out the cmd.Parameters.Add ... line it all works fine and I get every sp, but if I uncomment it I get " Incorrect syntax near 'sp_stored_procedures'" every time no matter what i put in the string.

I have a feeling I'm doing something stupid :) Anyone have any ideas? The query works fine in query analyzer with the same arguments that I'm trying in the code.Add:

cmd.CommandType=CommandType.StoredProcedure|||...and you shouldn't begin the name of your stored procedures with the sp_ prefix. This prefix should always be reserved only for system stored procedures.|||"
...and you shouldn't begin the name of your stored procedures with the sp_ prefix. This prefix should always be reserved only for system stored procedures.

"

It IS a system stored procedure.|||"
Add:

cmd.CommandType=CommandType.StoredProcedure
"

Doh!

Thanks!