Click here to Skip to main content
15,913,610 members
Home / Discussions / Database
   

Database

 
GeneralRe: ithout image an messageIMages Pin
Colin Angus Mackay20-Jun-06 22:44
Colin Angus Mackay20-Jun-06 22:44 
GeneralRe: ithout image an messageIMages Pin
Colin Angus Mackay21-Jun-06 1:35
Colin Angus Mackay21-Jun-06 1:35 
QuestionProblem using EntLib DAAB for .NET 2.0 Pin
supD20-Jun-06 9:30
supD20-Jun-06 9:30 
AnswerRe: Problem using EntLib DAAB for .NET 2.0 Pin
Colin Angus Mackay20-Jun-06 10:48
Colin Angus Mackay20-Jun-06 10:48 
AnswerRe: Problem using EntLib DAAB for .NET 2.0 Pin
Not Active21-Jun-06 9:34
mentorNot Active21-Jun-06 9:34 
QuestionHow do I reattach a database file that was not detached? Pin
Jesse Evans20-Jun-06 8:55
Jesse Evans20-Jun-06 8:55 
AnswerRe: How do I reattach a database file that was not detached? Pin
Eric Dahlvang20-Jun-06 12:14
Eric Dahlvang20-Jun-06 12:14 
GeneralRe: How do I reattach a database file that was not detached? Pin
Jesse Evans20-Jun-06 12:26
Jesse Evans20-Jun-06 12:26 
EricDV wrote:
Actually, it is an .mdf file

Sorry, my bad...


EricDV wrote:
You can use sp_attach_db, sp_attach_single_file_db


Per MSDN:
Remarks<br />
sp_attach_db should only be executed on databases that were previously detached from the database server using an explicit sp_detach_db operation.


As I mentioned in my post, the file(s) were not previously detached.

Here's what we've tried so far...
<br />
Attempt 1 (Strike 1): TRIED TO EXECUTE IN QUERY ANALYZER<br />
EXEC sp_attach_db @dbname = 'NewDatabase', <br />
 @filename1 = 'c:\mssql7\data\ArchiveData.mdf', <br />
 @filename2 = 'c:\mssql7\data\ArchiveLog.ldf'<br />
 <br />
SERVER MESSAGES:<br />
Server: Msg 9004, Level 21, State 3, Line 1<br />
The log for database 'NewDatabase' is corrupt.<br />
Connection Broken<br />
 <br />
(Continued) ISSUE:<br />
The log file is corrupt, so I tried to attach the mdf file to a new database using the single file attach method.<br />
 <br />
Attempt 2 (Strike 2):TRIED TO EXECUTE IN QUERY ANALYZER<br />
EXEC sp_attach_single_file_db @dbname = 'NewDatabase', <br />
 @physname = 'c:\mssql7\data\ArchiveData.mdf'<br />
 <br />
SERVER MESSAGES:<br />
Server: Msg 945, Level 14, State 2, Line 1<br />
Database 'NewDatabase' cannot be opened because some of the files could not be activated.<br />
Server: Msg 1813, Level 16, State 2, Line 1<br />
Could not open new database 'NewDatabase'. CREATE DATABASE is aborted.<br />
 <br />
Attempt 3 (Strike 3 --- Struck OUT): tried to fool SQL Server by switch mdf files. <br />
I created a brand new database called Archive.<br />
I detached the database.<br />
I renamed the Archive_Data.mdf to Archive_DataOld.mdf<br />
I applied the switch by renaming the AchiveData.mdf  to Archive_Data.mdf <br />
I left the brand new log file alone.<br />
I attempted to attach the database<br />
 <br />
EXEC sp_attach_db @dbname = 'Archive', <br />
 @filename1 = 'c:\mssql7\data\Archive_Data.mdf', <br />
 @filename2 = 'c:\mssql7\data\Archive_Log.ldf'<br />
 <br />
 <br />
also tried<br />
 <br />
EXEC sp_attach_db @dbname = 'NewDatabase', <br />
 @filename1 = 'c:\mssql7\data\Archive_Data.mdf', <br />
 @filename2 = 'c:\mssql7\data\Archive_Log.ldf'<br />
 <br />
SERVER MESSAGES:<br />
Changed language setting to us_english.<br />
Server: Msg 5173, Level 16, State 2, Line 1<br />
Cannot associate files with different databases.<br />


'til next we type...
HAVE FUN!! -- Jesse
QuestionDatagrid showing bogus data [modified] Pin
leckey20-Jun-06 7:41
leckey20-Jun-06 7:41 
AnswerRe: Datagrid showing bogus data Pin
Edbert P20-Jun-06 19:22
Edbert P20-Jun-06 19:22 
GeneralRe: Datagrid showing bogus data Pin
leckey21-Jun-06 3:12
leckey21-Jun-06 3:12 
GeneralRe: Datagrid showing bogus data Pin
Edbert P21-Jun-06 14:01
Edbert P21-Jun-06 14:01 
QuestionLooking for Book Recommendation ... Pin
David Patrick20-Jun-06 6:54
David Patrick20-Jun-06 6:54 
AnswerRe: Looking for Book Recommendation ... Pin
Eric Dahlvang22-Jun-06 9:19
Eric Dahlvang22-Jun-06 9:19 
QuestionExtract column name of a table Pin
bony_baba20-Jun-06 1:55
bony_baba20-Jun-06 1:55 
AnswerRe: Extract column name of a table Pin
Colin Angus Mackay20-Jun-06 2:10
Colin Angus Mackay20-Jun-06 2:10 
GeneralRe: Extract column name of a table Pin
bony_baba20-Jun-06 2:55
bony_baba20-Jun-06 2:55 
GeneralRe: Extract column name of a table Pin
vivek-g20-Jun-06 23:16
vivek-g20-Jun-06 23:16 
GeneralRe: Extract column name of a table Pin
Colin Angus Mackay21-Jun-06 8:35
Colin Angus Mackay21-Jun-06 8:35 
QuestionConnecting to Oracle DB through webservice Pin
mew_lobo20-Jun-06 0:53
mew_lobo20-Jun-06 0:53 
AnswerRe: Connecting to Oracle DB through webservice Pin
Frank Kerrigan20-Jun-06 4:48
Frank Kerrigan20-Jun-06 4:48 
GeneralRe: Connecting to Oracle DB through webservice Pin
mew_lobo20-Jun-06 21:33
mew_lobo20-Jun-06 21:33 
AnswerRe: Connecting to Oracle DB through webservice Pin
Chris Meech20-Jun-06 6:19
Chris Meech20-Jun-06 6:19 
GeneralRe: Connecting to Oracle DB through webservice Pin
mew_lobo21-Jun-06 0:43
mew_lobo21-Jun-06 0:43 
GeneralRe: Connecting to Oracle DB through webservice Pin
Chris Meech21-Jun-06 3:20
Chris Meech21-Jun-06 3:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.