Showing posts with label fails. Show all posts
Showing posts with label fails. Show all posts

Tuesday, March 27, 2012

Error when running sp_helpdb query

Kush
use master
go
sp_helptext 'sp_helpdb'
I think it fails to find suser_sname of the current session
"Kush" <Kush@.discussions.microsoft.com> wrote in message
news:44DAF4E9-9DCA-47FC-85A3-79234F68EFF3@.microsoft.com...
>I get the following error when running command "sp_helpdb" in Query
>Analyzer.
> Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53 Cannot
> insert the value NULL into column 'owner', table
> 'tempdb.dbo. #spdbdesc_______________________________
______________________
________________________________________
______________000100371F02';
> column does not allow nulls. INSERT fails.
> The statement has been terminated.I get the following error when running command "sp_helpdb" in Query Analyzer
.
Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53 Cannot
insert the value NULL into column 'owner', table
'tempdb.dbo. #spdbdesc_______________________________
________________________
________________________________________
____________000100371F02';
column does not allow nulls. INSERT fails.
The statement has been terminated.|||Kush
use master
go
sp_helptext 'sp_helpdb'
I think it fails to find suser_sname of the current session
"Kush" <Kush@.discussions.microsoft.com> wrote in message
news:44DAF4E9-9DCA-47FC-85A3-79234F68EFF3@.microsoft.com...
>I get the following error when running command "sp_helpdb" in Query
>Analyzer.
> Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53 Cannot
> insert the value NULL into column 'owner', table
> 'tempdb.dbo. #spdbdesc_______________________________
______________________
________________________________________
______________000100371F02';
> column does not allow nulls. INSERT fails.
> The statement has been terminated.|||Here's an URL that might explain it. Google is your friend :-)
3b5" target="_blank">http://groups.google.com/group/micr...6dd1
3b5
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Kush" <Kush@.discussions.microsoft.com> wrote in message
news:44DAF4E9-9DCA-47FC-85A3-79234F68EFF3@.microsoft.com...
>I get the following error when running command "sp_helpdb" in Query Analyze
r.
> Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53 Cannot
> insert the value NULL into column 'owner', table
> 'tempdb.dbo. #spdbdesc_______________________________
______________________
________________________________________
______________000100371F02';
> column does not allow nulls. INSERT fails.
> The statement has been terminated.|||I will try that and let you know what happens!
"Tibor Karaszi" wrote:

> Here's an URL that might explain it. Google is your friend :-)
> d13b5" target="_blank">http://groups.google.com/group/micr...6d
d13b5
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Kush" <Kush@.discussions.microsoft.com> wrote in message
> news:44DAF4E9-9DCA-47FC-85A3-79234F68EFF3@.microsoft.com...
>|||Here's an URL that might explain it. Google is your friend :-)
3b5" target="_blank">http://groups.google.com/group/micr...6dd1
3b5
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Kush" <Kush@.discussions.microsoft.com> wrote in message
news:44DAF4E9-9DCA-47FC-85A3-79234F68EFF3@.microsoft.com...
>I get the following error when running command "sp_helpdb" in Query Analyze
r.
> Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53 Cannot
> insert the value NULL into column 'owner', table
> 'tempdb.dbo. #spdbdesc_______________________________
______________________
________________________________________
______________000100371F02';
> column does not allow nulls. INSERT fails.
> The statement has been terminated.|||I will try that and let you know what happens!
"Tibor Karaszi" wrote:

> Here's an URL that might explain it. Google is your friend :-)
> d13b5" target="_blank">http://groups.google.com/group/micr...6d
d13b5
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Kush" <Kush@.discussions.microsoft.com> wrote in message
> news:44DAF4E9-9DCA-47FC-85A3-79234F68EFF3@.microsoft.com...
>

Monday, March 12, 2012

Error when changing job owner

When I change one of my job owners on a job that does a simple select, from
sa to a domain account, the job fails giving me the following error:
Could not obtain information about Windows NT group/user 'MyDomain\ADUser'
Error 8198.
I verified this login was a part of the Pre-Windows 2000 Compatible Access
Group (kb 241643). Next I tried using xp_logininfo with this login, and I
got the same error. Then I took out the select from the xp and ran it
separately (select distinct domain+N'\'+name, sid, sidtype from
OpenRowset(NetUserGetGroups, 'mydomain\aduser') and got the same error.
When I ran the above select statement with unknow domain\login, I got the
same error.
Any help would be appreciated.
Paul
You might want to have a look at
How to troubleshoot a SQL Server 8198 error
http://support.microsoft.com/default...b;en-us;834124
and
FIX: You Receive an Error Message When the xp_logininfo Extended Stored
Procedure Runs
http://support.microsoft.com/default.aspx?kbid=830596
Also make sure you are on the latest windows service pack
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Paul Bergstedt" <Paul@.nospam.com> wrote in message
news:uLmmgm4XEHA.3664@.TK2MSFTNGP12.phx.gbl...
> When I change one of my job owners on a job that does a simple select,
from
> sa to a domain account, the job fails giving me the following error:
> Could not obtain information about Windows NT group/user 'MyDomain\ADUser'
> Error 8198.
> I verified this login was a part of the Pre-Windows 2000 Compatible Access
> Group (kb 241643). Next I tried using xp_logininfo with this login, and I
> got the same error. Then I took out the select from the xp and ran it
> separately (select distinct domain+N'\'+name, sid, sidtype from
> OpenRowset(NetUserGetGroups, 'mydomain\aduser') and got the same error.
> When I ran the above select statement with unknow domain\login, I got the
> same error.
> Any help would be appreciated.
> Paul
>
|||After trying everying under the sun, I tried putting the server name into
the Pre-Windows 2000 Access Group, and that fixed the problem. I got this
idea after noticing that the service account that the SQL Server services
ran under was the local System Account. I would imagine if I were running
the services under a domain account that it too would need to be added. I
have a case open with Microsoft on this, so I will ask them to suggest
putting this info into the KB article listed below.
Paul
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:eybsju6XEHA.1764@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> You might want to have a look at
> How to troubleshoot a SQL Server 8198 error
> http://support.microsoft.com/default...b;en-us;834124
> and
> FIX: You Receive an Error Message When the xp_logininfo Extended Stored
> Procedure Runs
> http://support.microsoft.com/default.aspx?kbid=830596
> Also make sure you are on the latest windows service pack
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Paul Bergstedt" <Paul@.nospam.com> wrote in message
> news:uLmmgm4XEHA.3664@.TK2MSFTNGP12.phx.gbl...
> from
'MyDomain\ADUser'[vbcol=seagreen]
Access[vbcol=seagreen]
I[vbcol=seagreen]
the
>

Error when changing job owner

When I change one of my job owners on a job that does a simple select, from
sa to a domain account, the job fails giving me the following error:
Could not obtain information about Windows NT group/user 'MyDomain\ADUser'
Error 8198.
I verified this login was a part of the Pre-Windows 2000 Compatible Access
Group (kb 241643). Next I tried using xp_logininfo with this login, and I
got the same error. Then I took out the select from the xp and ran it
separately (select distinct domain+N'\'+name, sid, sidtype from
OpenRowset(NetUserGetGroups, 'mydomain\aduser') and got the same error.
When I ran the above select statement with unknow domain\login, I got the
same error.
Any help would be appreciated.
PaulYou might want to have a look at
How to troubleshoot a SQL Server 8198 error
http://support.microsoft.com/default.aspx?scid=kb;en-us;834124
and
FIX: You Receive an Error Message When the xp_logininfo Extended Stored
Procedure Runs
http://support.microsoft.com/default.aspx?kbid=830596
Also make sure you are on the latest windows service pack
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Paul Bergstedt" <Paul@.nospam.com> wrote in message
news:uLmmgm4XEHA.3664@.TK2MSFTNGP12.phx.gbl...
> When I change one of my job owners on a job that does a simple select,
from
> sa to a domain account, the job fails giving me the following error:
> Could not obtain information about Windows NT group/user 'MyDomain\ADUser'
> Error 8198.
> I verified this login was a part of the Pre-Windows 2000 Compatible Access
> Group (kb 241643). Next I tried using xp_logininfo with this login, and I
> got the same error. Then I took out the select from the xp and ran it
> separately (select distinct domain+N'\'+name, sid, sidtype from
> OpenRowset(NetUserGetGroups, 'mydomain\aduser') and got the same error.
> When I ran the above select statement with unknow domain\login, I got the
> same error.
> Any help would be appreciated.
> Paul
>|||After trying everying under the sun, I tried putting the server name into
the Pre-Windows 2000 Access Group, and that fixed the problem. I got this
idea after noticing that the service account that the SQL Server services
ran under was the local System Account. I would imagine if I were running
the services under a domain account that it too would need to be added. I
have a case open with Microsoft on this, so I will ask them to suggest
putting this info into the KB article listed below.
Paul
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:eybsju6XEHA.1764@.TK2MSFTNGP10.phx.gbl...
> You might want to have a look at
> How to troubleshoot a SQL Server 8198 error
> http://support.microsoft.com/default.aspx?scid=kb;en-us;834124
> and
> FIX: You Receive an Error Message When the xp_logininfo Extended Stored
> Procedure Runs
> http://support.microsoft.com/default.aspx?kbid=830596
> Also make sure you are on the latest windows service pack
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Paul Bergstedt" <Paul@.nospam.com> wrote in message
> news:uLmmgm4XEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > When I change one of my job owners on a job that does a simple select,
> from
> > sa to a domain account, the job fails giving me the following error:
> >
> > Could not obtain information about Windows NT group/user
'MyDomain\ADUser'
> > Error 8198.
> >
> > I verified this login was a part of the Pre-Windows 2000 Compatible
Access
> > Group (kb 241643). Next I tried using xp_logininfo with this login, and
I
> > got the same error. Then I took out the select from the xp and ran it
> > separately (select distinct domain+N'\'+name, sid, sidtype from
> > OpenRowset(NetUserGetGroups, 'mydomain\aduser') and got the same error.
> > When I ran the above select statement with unknow domain\login, I got
the
> > same error.
> >
> > Any help would be appreciated.
> >
> > Paul
> >
> >
>

Error when changing job owner

When I change one of my job owners on a job that does a simple select, from
sa to a domain account, the job fails giving me the following error:
Could not obtain information about Windows NT group/user 'MyDomain\ADUser'
Error 8198.
I verified this login was a part of the Pre-Windows 2000 Compatible Access
Group (kb 241643). Next I tried using xp_logininfo with this login, and I
got the same error. Then I took out the select from the xp and ran it
separately (select distinct domain+N'\'+name, sid, sidtype from
OpenRowset(NetUserGetGroups, 'mydomain\aduser') and got the same error.
When I ran the above select statement with unknow domain\login, I got the
same error.
Any help would be appreciated.
PaulYou might want to have a look at
How to troubleshoot a SQL Server 8198 error
http://support.microsoft.com/defaul...kb;en-us;834124
and
FIX: You Receive an Error Message When the xp_logininfo Extended Stored
Procedure Runs
http://support.microsoft.com/default.aspx?kbid=830596
Also make sure you are on the latest windows service pack
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Paul Bergstedt" <Paul@.nospam.com> wrote in message
news:uLmmgm4XEHA.3664@.TK2MSFTNGP12.phx.gbl...
> When I change one of my job owners on a job that does a simple select,
from
> sa to a domain account, the job fails giving me the following error:
> Could not obtain information about Windows NT group/user 'MyDomain\ADUser'
> Error 8198.
> I verified this login was a part of the Pre-Windows 2000 Compatible Access
> Group (kb 241643). Next I tried using xp_logininfo with this login, and I
> got the same error. Then I took out the select from the xp and ran it
> separately (select distinct domain+N''+name, sid, sidtype from
> OpenRowset(NetUserGetGroups, 'mydomain\aduser') and got the same error.
> When I ran the above select statement with unknow domain\login, I got the
> same error.
> Any help would be appreciated.
> Paul
>|||After trying everying under the sun, I tried putting the server name into
the Pre-Windows 2000 Access Group, and that fixed the problem. I got this
idea after noticing that the service account that the SQL Server services
ran under was the local System Account. I would imagine if I were running
the services under a domain account that it too would need to be added. I
have a case open with Microsoft on this, so I will ask them to suggest
putting this info into the KB article listed below.
Paul
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:eybsju6XEHA.1764@.TK2MSFTNGP10.phx.gbl...
> You might want to have a look at
> How to troubleshoot a SQL Server 8198 error
> http://support.microsoft.com/defaul...kb;en-us;834124
> and
> FIX: You Receive an Error Message When the xp_logininfo Extended Stored
> Procedure Runs
> http://support.microsoft.com/default.aspx?kbid=830596
> Also make sure you are on the latest windows service pack
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Paul Bergstedt" <Paul@.nospam.com> wrote in message
> news:uLmmgm4XEHA.3664@.TK2MSFTNGP12.phx.gbl...
> from
'MyDomain\ADUser'[vbcol=seagreen]
Access[vbcol=seagreen]
I[vbcol=seagreen]
the[vbcol=seagreen]
>

Error when calling stored procedure

Tongue TiedI am trying to execute a store procedure from ASP/VB but it fails with the message:

Incorrect syntax near 'InitProject'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Incorrect syntax near 'InitProject'.

Source Error:

Line 24: cmd.Parameters("@.ProjectId").Value = 3Line 25: cn.Open()Line 26: cmd.ExecuteNonQuery()Line 27: cn.Close()Line 28: End Sub

Here is my code:

'Execute the InitProject stored procedure
'Create the connection from the string in the web.config file
Dim cn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("SMARTConnectionString").ConnectionString)
'I want to execute InitProject stored procedure
Dim cmd As SqlCommand = New SqlCommand("InitProject", cn)
'With the parameter @.ProjectId = 3
cmd.Parameters.Add(New SqlParameter("@.ProjectId", Data.SqlDbType.Int))
cmd.Parameters("@.ProjectId").Direction = Data.ParameterDirection.Input
cmd.Parameters("@.ProjectId").Value = 3
cn.Open()
'But this fails
cmd.ExecuteNonQuery()
cn.Close()

And my stored procedure is defined as:

[dbo].[InitProject] @.ProjectId int
-- Add the parameters for the stored procedure here
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
insert into MATERIAL ( PROJECT_ID, SECTION_ID, CATEGORY_ID, ROOM_ID, ITEM_ID )
select @.ProjectId, SECTION_ID, CATEGORY_ID, ROOM_ID, ITEM_ID
from MATERIAL_TEMPLATE
END

The store procedure works fine when I do

exec InitProject 3

in sql query.

I have been away from .NET but try putting commandtype = storedproc. I dont remember the syntax but you could figure it out. It would go before adding the parameters.|||

Like this:

Dim cmd As SqlCommand = New SqlCommand("InitProject", cn)

cmd.CommandType = CommandType.StoredProcedure

.....

|||

Thank you very much for your help. It works like this:

'I want to execute InitProject stored procedure
Dim cmd As SqlCommand = New SqlCommand("InitProject", cn)
cmd.CommandType = Data.CommandType.StoredProcedure
'With the parameter @.ProjectId = 3
cmd.Parameters.Add(New SqlParameter("@.ProjectId", Data.SqlDbType.Int))
cmd.Parameters("@.ProjectId").Direction = Data.ParameterDirection.Input
cmd.Parameters("@.ProjectId").Value = 3
cn.Open()
'Now it works
cmd.ExecuteNonQuery()
cn.Close()

I don't understand why I need to prefix withData. when othersSmile don't need.

|||

Hi

Hierarchy : System.Data.CommandType.StoredProcedure

You just import namespace System so you need to prefix with Data

If you import namespace System.Data you don't need that.

Hope it helps.

Friday, March 9, 2012

Error Violation of Primary Key While Attaching Database

Hello all,
I have been trying to attach a database but it fails because of
duplicate rows (Error 2627).
I searched in the Internet for removing duplicate records but it can
only work if I manage to attach the database first (correct me if I'm
wrong). So without having the database attached to the SQL server, I
will not manage to remove the duplicate rows. But when I tried to
attach, it checks for duplicate records automatically and fail to
attach.
Is there any workaround for my case?
Thanks in advance.
Regards,
Garreth Goh
BTW, it is SQL 2000 with SP3.
Regards,
Garreth Goh
On Dec 18, 10:02 am, gohtiamt...@.gmail.com wrote:
> Hello all,
> I have been trying to attach a database but it fails because of
> duplicate rows (Error 2627).
> I searched in the Internet for removing duplicate records but it can
> only work if I manage to attach the database first (correct me if I'm
> wrong). So without having the database attached to the SQL server, I
> will not manage to remove the duplicate rows. But when I tried to
> attach, it checks for duplicate records automatically and fail to
> attach.
> Is there any workaround for my case?
> Thanks in advance.
> Regards,
> Garreth Goh
|||Hi,
More updates after several attempts (with separate SQL server 2000
SP4).
01. I move the MDF and LDF files to another folders. I have two MDF
and two LDF files for one database.
02. I attach the same but blank backup database to my SQL server with
a new database name.
03. Back it up.
04. Restore the backup with the original database name in the initial
folder where the corrupted files were.
05. Detach the new restored (but empty) database.
06. Move the new created MDF and LDF files to another folder.
07. Copy the original corrupted MDF and LDF files back to the original
folder.
08. Attach the database. Got "Suspect" message.
09. Update "sysdatabases" to set the database into Emergency Mode.
10. Attach the database back. I got Emergency Mode.
11. Run "DBCC CHECKDB WITH NO_INFOMSGS" tells me to do
"REPAIR_ALLOW_DATA_LOSS".
12. Stop SQL services and run in Command Prompt "SQLSERVR -c -m" cause
it tells me to have Single-User mode when trying to run "DBCC
CHECKDB ...REPAIR_ALLOW_DATA_LOSS".
13. When I try to run "DBCC CHECKDB ...REPAIR_ALLOW_DATA_LOSS" in
this Single-Mode, it tells me "Could not run BEGIN TRANSACTION in
database 'MyDB' because the database is in bypass recovery mode."
I am stuck here. Could anyone here help, please?
I may have incorrectly listed down the sequence from point 8 to 11 but
my current status is at point 13.
Regards,
Garreth Goh
On Dec 18, 10:58 am, gohtiamt...@.gmail.com wrote:
> BTW, it is SQL 2000 with SP3.
> Regards,
> Garreth Goh
|||Or get Microsoft Technical Support on the phone.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
kgboles a earthlink dt net
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:261F6FD2-B073-42F2-A218-B3B6AFE3750D@.microsoft.com...
> The error pretty much speak for itself. My guess is that you have to try
> to export the data to a clean database, using some combination of script
> objects (unless you have DDL files to re-create them) and for the data
> SELECT INTO., INSERT SELECT, BCP etc.
> I would bring in an expert if above doesn't feel comfortable to you...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> <gohtiamtjai@.gmail.com> wrote in message
> news:078e33bc-1d03-4d24-a65b-96367d382dde@.a35g2000prf.googlegroups.com...
>

Error Violation of Primary Key While Attaching Database

Hello all,
I have been trying to attach a database but it fails because of
duplicate rows (Error 2627).
I searched in the Internet for removing duplicate records but it can
only work if I manage to attach the database first (correct me if I'm
wrong). So without having the database attached to the SQL server, I
will not manage to remove the duplicate rows. But when I tried to
attach, it checks for duplicate records automatically and fail to
attach.
Is there any workaround for my case?
Thanks in advance.
Regards,
Garreth GohBTW, it is SQL 2000 with SP3.
Regards,
Garreth Goh
On Dec 18, 10:02 am, gohtiamt...@.gmail.com wrote:
> Hello all,
> I have been trying to attach a database but it fails because of
> duplicate rows (Error 2627).
> I searched in the Internet for removing duplicate records but it can
> only work if I manage to attach the database first (correct me if I'm
> wrong). So without having the database attached to the SQL server, I
> will not manage to remove the duplicate rows. But when I tried to
> attach, it checks for duplicate records automatically and fail to
> attach.
> Is there any workaround for my case?
> Thanks in advance.
> Regards,
> Garreth Goh|||Hi,
More updates after several attempts (with separate SQL server 2000
SP4).
01. I move the MDF and LDF files to another folders. I have two MDF
and two LDF files for one database.
02. I attach the same but blank backup database to my SQL server with
a new database name.
03. Back it up.
04. Restore the backup with the original database name in the initial
folder where the corrupted files were.
05. Detach the new restored (but empty) database.
06. Move the new created MDF and LDF files to another folder.
07. Copy the original corrupted MDF and LDF files back to the original
folder.
08. Attach the database. Got "Suspect" message.
09. Update "sysdatabases" to set the database into Emergency Mode.
10. Attach the database back. I got Emergency Mode.
11. Run "DBCC CHECKDB WITH NO_INFOMSGS" tells me to do
"REPAIR_ALLOW_DATA_LOSS".
12. Stop SQL services and run in Command Prompt "SQLSERVR -c -m" cause
it tells me to have Single-User mode when trying to run "DBCC
CHECKDB ...REPAIR_ALLOW_DATA_LOSS".
13. When I try to run "DBCC CHECKDB ...REPAIR_ALLOW_DATA_LOSS" in
this Single-Mode, it tells me "Could not run BEGIN TRANSACTION in
database 'MyDB' because the database is in bypass recovery mode."
I am stuck here. Could anyone here help, please?
I may have incorrectly listed down the sequence from point 8 to 11 but
my current status is at point 13.
Regards,
Garreth Goh
On Dec 18, 10:58 am, gohtiamt...@.gmail.com wrote:
> BTW, it is SQL 2000 with SP3.
> Regards,
> Garreth Goh|||The error pretty much speak for itself. My guess is that you have to try to
export the data to a
clean database, using some combination of script objects (unless you have DD
L files to re-create
them) and for the data SELECT INTO., INSERT SELECT, BCP etc.
I would bring in an expert if above doesn't feel comfortable to you...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<gohtiamtjai@.gmail.com> wrote in message
news:078e33bc-1d03-4d24-a65b-96367d382dde@.a35g2000prf.googlegroups.com...[vbcol=seagreen]
> Hi,
> More updates after several attempts (with separate SQL server 2000
> SP4).
> 01. I move the MDF and LDF files to another folders. I have two MDF
> and two LDF files for one database.
> 02. I attach the same but blank backup database to my SQL server with
> a new database name.
> 03. Back it up.
> 04. Restore the backup with the original database name in the initial
> folder where the corrupted files were.
> 05. Detach the new restored (but empty) database.
> 06. Move the new created MDF and LDF files to another folder.
> 07. Copy the original corrupted MDF and LDF files back to the original
> folder.
> 08. Attach the database. Got "Suspect" message.
> 09. Update "sysdatabases" to set the database into Emergency Mode.
> 10. Attach the database back. I got Emergency Mode.
> 11. Run "DBCC CHECKDB WITH NO_INFOMSGS" tells me to do
> "REPAIR_ALLOW_DATA_LOSS".
> 12. Stop SQL services and run in Command Prompt "SQLSERVR -c -m" cause
> it tells me to have Single-User mode when trying to run "DBCC
> CHECKDB ...REPAIR_ALLOW_DATA_LOSS".
> 13. When I try to run "DBCC CHECKDB ...REPAIR_ALLOW_DATA_LOSS" in
> this Single-Mode, it tells me "Could not run BEGIN TRANSACTION in
> database 'MyDB' because the database is in bypass recovery mode."
> I am stuck here. Could anyone here help, please?
> I may have incorrectly listed down the sequence from point 8 to 11 but
> my current status is at point 13.
>
> Regards,
> Garreth Goh
>
> On Dec 18, 10:58 am, gohtiamt...@.gmail.com wrote:|||Or get Microsoft Technical Support on the phone.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
kgboles a earthlink dt net
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:261F6FD2-B073-42F2-A218-B3B6AFE3750D@.microsoft.com...
> The error pretty much speak for itself. My guess is that you have to try
> to export the data to a clean database, using some combination of script
> objects (unless you have DDL files to re-create them) and for the data
> SELECT INTO., INSERT SELECT, BCP etc.
> I would bring in an expert if above doesn't feel comfortable to you...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> <gohtiamtjai@.gmail.com> wrote in message
> news:078e33bc-1d03-4d24-a65b-96367d382dde@.a35g2000prf.googlegroups.com...
>

Error Violation of Primary Key While Attaching Database

Hello all,
I have been trying to attach a database but it fails because of
duplicate rows (Error 2627).
I searched in the Internet for removing duplicate records but it can
only work if I manage to attach the database first (correct me if I'm
wrong). So without having the database attached to the SQL server, I
will not manage to remove the duplicate rows. But when I tried to
attach, it checks for duplicate records automatically and fail to
attach.
Is there any workaround for my case?
Thanks in advance.
Regards,
Garreth GohBTW, it is SQL 2000 with SP3.
Regards,
Garreth Goh
On Dec 18, 10:02 am, gohtiamt...@.gmail.com wrote:
> Hello all,
> I have been trying to attach a database but it fails because of
> duplicate rows (Error 2627).
> I searched in the Internet for removing duplicate records but it can
> only work if I manage to attach the database first (correct me if I'm
> wrong). So without having the database attached to the SQL server, I
> will not manage to remove the duplicate rows. But when I tried to
> attach, it checks for duplicate records automatically and fail to
> attach.
> Is there any workaround for my case?
> Thanks in advance.
> Regards,
> Garreth Goh|||Hi,
More updates after several attempts (with separate SQL server 2000
SP4).
01. I move the MDF and LDF files to another folders. I have two MDF
and two LDF files for one database.
02. I attach the same but blank backup database to my SQL server with
a new database name.
03. Back it up.
04. Restore the backup with the original database name in the initial
folder where the corrupted files were.
05. Detach the new restored (but empty) database.
06. Move the new created MDF and LDF files to another folder.
07. Copy the original corrupted MDF and LDF files back to the original
folder.
08. Attach the database. Got "Suspect" message.
09. Update "sysdatabases" to set the database into Emergency Mode.
10. Attach the database back. I got Emergency Mode.
11. Run "DBCC CHECKDB WITH NO_INFOMSGS" tells me to do
"REPAIR_ALLOW_DATA_LOSS".
12. Stop SQL services and run in Command Prompt "SQLSERVR -c -m" cause
it tells me to have Single-User mode when trying to run "DBCC
CHECKDB ...REPAIR_ALLOW_DATA_LOSS".
13. When I try to run "DBCC CHECKDB ...REPAIR_ALLOW_DATA_LOSS" in
this Single-Mode, it tells me "Could not run BEGIN TRANSACTION in
database 'MyDB' because the database is in bypass recovery mode."
I am stuck here. Could anyone here help, please?
I may have incorrectly listed down the sequence from point 8 to 11 but
my current status is at point 13.
Regards,
Garreth Goh
On Dec 18, 10:58 am, gohtiamt...@.gmail.com wrote:
> BTW, it is SQL 2000 with SP3.
> Regards,
> Garreth Goh|||The error pretty much speak for itself. My guess is that you have to try to export the data to a
clean database, using some combination of script objects (unless you have DDL files to re-create
them) and for the data SELECT INTO., INSERT SELECT, BCP etc.
I would bring in an expert if above doesn't feel comfortable to you...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<gohtiamtjai@.gmail.com> wrote in message
news:078e33bc-1d03-4d24-a65b-96367d382dde@.a35g2000prf.googlegroups.com...
> Hi,
> More updates after several attempts (with separate SQL server 2000
> SP4).
> 01. I move the MDF and LDF files to another folders. I have two MDF
> and two LDF files for one database.
> 02. I attach the same but blank backup database to my SQL server with
> a new database name.
> 03. Back it up.
> 04. Restore the backup with the original database name in the initial
> folder where the corrupted files were.
> 05. Detach the new restored (but empty) database.
> 06. Move the new created MDF and LDF files to another folder.
> 07. Copy the original corrupted MDF and LDF files back to the original
> folder.
> 08. Attach the database. Got "Suspect" message.
> 09. Update "sysdatabases" to set the database into Emergency Mode.
> 10. Attach the database back. I got Emergency Mode.
> 11. Run "DBCC CHECKDB WITH NO_INFOMSGS" tells me to do
> "REPAIR_ALLOW_DATA_LOSS".
> 12. Stop SQL services and run in Command Prompt "SQLSERVR -c -m" cause
> it tells me to have Single-User mode when trying to run "DBCC
> CHECKDB ...REPAIR_ALLOW_DATA_LOSS".
> 13. When I try to run "DBCC CHECKDB ...REPAIR_ALLOW_DATA_LOSS" in
> this Single-Mode, it tells me "Could not run BEGIN TRANSACTION in
> database 'MyDB' because the database is in bypass recovery mode."
> I am stuck here. Could anyone here help, please?
> I may have incorrectly listed down the sequence from point 8 to 11 but
> my current status is at point 13.
>
> Regards,
> Garreth Goh
>
> On Dec 18, 10:58 am, gohtiamt...@.gmail.com wrote:
>> BTW, it is SQL 2000 with SP3.
>> Regards,
>> Garreth Goh|||Or get Microsoft Technical Support on the phone.
--
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
kgboles a earthlink dt net
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:261F6FD2-B073-42F2-A218-B3B6AFE3750D@.microsoft.com...
> The error pretty much speak for itself. My guess is that you have to try
> to export the data to a clean database, using some combination of script
> objects (unless you have DDL files to re-create them) and for the data
> SELECT INTO., INSERT SELECT, BCP etc.
> I would bring in an expert if above doesn't feel comfortable to you...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> <gohtiamtjai@.gmail.com> wrote in message
> news:078e33bc-1d03-4d24-a65b-96367d382dde@.a35g2000prf.googlegroups.com...
>> Hi,
>> More updates after several attempts (with separate SQL server 2000
>> SP4).
>> 01. I move the MDF and LDF files to another folders. I have two MDF
>> and two LDF files for one database.
>> 02. I attach the same but blank backup database to my SQL server with
>> a new database name.
>> 03. Back it up.
>> 04. Restore the backup with the original database name in the initial
>> folder where the corrupted files were.
>> 05. Detach the new restored (but empty) database.
>> 06. Move the new created MDF and LDF files to another folder.
>> 07. Copy the original corrupted MDF and LDF files back to the original
>> folder.
>> 08. Attach the database. Got "Suspect" message.
>> 09. Update "sysdatabases" to set the database into Emergency Mode.
>> 10. Attach the database back. I got Emergency Mode.
>> 11. Run "DBCC CHECKDB WITH NO_INFOMSGS" tells me to do
>> "REPAIR_ALLOW_DATA_LOSS".
>> 12. Stop SQL services and run in Command Prompt "SQLSERVR -c -m" cause
>> it tells me to have Single-User mode when trying to run "DBCC
>> CHECKDB ...REPAIR_ALLOW_DATA_LOSS".
>> 13. When I try to run "DBCC CHECKDB ...REPAIR_ALLOW_DATA_LOSS" in
>> this Single-Mode, it tells me "Could not run BEGIN TRANSACTION in
>> database 'MyDB' because the database is in bypass recovery mode."
>> I am stuck here. Could anyone here help, please?
>> I may have incorrectly listed down the sequence from point 8 to 11 but
>> my current status is at point 13.
>>
>> Regards,
>> Garreth Goh
>>
>> On Dec 18, 10:58 am, gohtiamt...@.gmail.com wrote:
>> BTW, it is SQL 2000 with SP3.
>> Regards,
>> Garreth Goh
>