Showing posts with label deleted. Show all posts
Showing posts with label deleted. Show all posts

Monday, March 19, 2012

Mistakenly removed dtproperties, now I can find my diagram

I am currently testing SQL Server 2000 Evaluation version.

I created a diagram with the diagraming tool, but in the process I mistakenly deleted the system table 'dtproperties'. I have a backup of the database, but the last time I restored it, I lost my diagram (and had to do it again)

What I've done to try to get it back:
I have another database with the old table schema, and I tried to enter all the values it that old database's dtproperties into the recent db's dtproperties, but that didnt' work especially since I didn't know how to copy the lvalue column.

How can I restore my diagram?I believe no chance to retrieve the diagram as you're using EEE.

Friday, March 9, 2012

missing rows problem

Hi!
Recently I have noticed some strange behaviour from SQL Server.
It seems to me that rows are being deleted some time after they are
inserted (or maybe they are unable to be read again).
I use one Trial SQL server 2000 as central server with Merge replication
and MSDE as anonymous subscription.
When I used only Trial server with no replication I didn't notice this
problem (I mean, I didn't get reports of strange behaviour of data
from users using the program).
Couple a days ago I got first report of strange behaviour of data
not being on the server. I said that he is probably mistaken and
that he didn't do something right. So I went to check log of the
data where I found out that he was right, and that SQL server
deleted three rows.
I know this because there is a log with primary key of the data
that were inserted. This log is created inside transaction after
the data is inserted. And there is no stored procedure for deleting
this data.
So he inserted that same rows again, and again for some reasons they
were also deleted after some time. Now I had two logs of the same data
being inserted and not present.
After the third time the data remained there.
Today I got a report of another problem. One row is also missing, but
this time from another table.
I have a couple of data which proves that this row was inserted and
unless using sql commands it can't be removed from database.
Users can only make changes to the data on the Trial server and then
the data are propagated to MSDE server.
I found http://support.microsoft.com/defaul...kb;en-us;826433
which could be related but I'm not sure what to do.
Any suggestions on how to approach this problem? How to detect when and
why are data being removed?From which server are they missing the publisher, subscriber or both?
Nik Marshall-Blank MCSD/MCDBA
"zapov" <zapov@.yahoo.com> wrote in message
news:dfrfef$1b5$1@.ss405.t-com.hr...
> Hi!
> Recently I have noticed some strange behaviour from SQL Server.
> It seems to me that rows are being deleted some time after they are
> inserted (or maybe they are unable to be read again).
> I use one Trial SQL server 2000 as central server with Merge replication
> and MSDE as anonymous subscription.
> When I used only Trial server with no replication I didn't notice this
> problem (I mean, I didn't get reports of strange behaviour of data
> from users using the program).
> Couple a days ago I got first report of strange behaviour of data
> not being on the server. I said that he is probably mistaken and
> that he didn't do something right. So I went to check log of the
> data where I found out that he was right, and that SQL server
> deleted three rows.
> I know this because there is a log with primary key of the data
> that were inserted. This log is created inside transaction after
> the data is inserted. And there is no stored procedure for deleting
> this data.
> So he inserted that same rows again, and again for some reasons they
> were also deleted after some time. Now I had two logs of the same data
> being inserted and not present.
> After the third time the data remained there.
> Today I got a report of another problem. One row is also missing, but
> this time from another table.
> I have a couple of data which proves that this row was inserted and unless
> using sql commands it can't be removed from database.
>
> Users can only make changes to the data on the Trial server and then
> the data are propagated to MSDE server.
> I found http://support.microsoft.com/defaul...kb;en-us;826433
> which could be related but I'm not sure what to do.
> Any suggestions on how to approach this problem? How to detect when and
> why are data being removed?|||Nik Marshall-Blank wrote:
> From which server are they missing the publisher, subscriber or both?
>
both|||After thinking about this I have one more question:
Could it be that because of referential integrity at the MSDE
server the data could be pushed back as a delete to Trial SQL
server?
Right now I have Enforce relationship for replication checked.
Should I unckeck it?|||You could try it.
Nik Marshall-Blank MCSD/MCDBA
"zapov" <zapov@.yahoo.com> wrote in message
news:dfrhnd$7qu$1@.ss405.t-com.hr...
> After thinking about this I have one more question:
> Could it be that because of referential integrity at the MSDE
> server the data could be pushed back as a delete to Trial SQL
> server?
> Right now I have Enforce relationship for replication checked.
> Should I unckeck it?|||Just read up on Merge Replications and updates at Subscribers are propogated
back to Publishers si I think this it=s your problem. Maybe you should go
for a different type of replication where subscriber changes are not
progpogated back.
Nik Marshall-Blank MCSD/MCDBA
"zapov" <zapov@.yahoo.com> wrote in message
news:dfrhnd$7qu$1@.ss405.t-com.hr...
> After thinking about this I have one more question:
> Could it be that because of referential integrity at the MSDE
> server the data could be pushed back as a delete to Trial SQL
> server?
> Right now I have Enforce relationship for replication checked.
> Should I unckeck it?

missing rows problem

Hi!
Recently I have noticed some strange behaviour from SQL Server.
It seems to me that rows are being deleted some time after they are
inserted (or maybe they are unable to be read again).
I use one Trial SQL server 2000 as central server with Merge replication
and MSDE as anonymous subscription.
When I used only Trial server with no replication I didn't notice this
problem (I mean, I didn't get reports of strange behaviour of data
from users using the program).
Couple a days ago I got first report of strange behaviour of data
not being on the server. I said that he is probably mistaken and
that he didn't do something right. So I went to check log of the
data where I found out that he was right, and that SQL server
deleted three rows.
I know this because there is a log with primary key of the data
that were inserted. This log is created inside transaction after
the data is inserted. And there is no stored procedure for deleting
this data.
So he inserted that same rows again, and again for some reasons they
were also deleted after some time. Now I had two logs of the same data
being inserted and not present.
After the third time the data remained there.
Today I got a report of another problem. One row is also missing, but
this time from another table.
I have a couple of data which proves that this row was inserted and
unless using sql commands it can't be removed from database.
Users can only make changes to the data on the Trial server and then
the data are propagated to MSDE server.
I found http://support.microsoft.com/default...b;en-us;826433
which could be related but I'm not sure what to do.
Any suggestions on how to approach this problem? How to detect when and
why are data being removed?
From which server are they missing the publisher, subscriber or both?
Nik Marshall-Blank MCSD/MCDBA
"zapov" <zapov@.yahoo.com> wrote in message
news:dfrfef$1b5$1@.ss405.t-com.hr...
> Hi!
> Recently I have noticed some strange behaviour from SQL Server.
> It seems to me that rows are being deleted some time after they are
> inserted (or maybe they are unable to be read again).
> I use one Trial SQL server 2000 as central server with Merge replication
> and MSDE as anonymous subscription.
> When I used only Trial server with no replication I didn't notice this
> problem (I mean, I didn't get reports of strange behaviour of data
> from users using the program).
> Couple a days ago I got first report of strange behaviour of data
> not being on the server. I said that he is probably mistaken and
> that he didn't do something right. So I went to check log of the
> data where I found out that he was right, and that SQL server
> deleted three rows.
> I know this because there is a log with primary key of the data
> that were inserted. This log is created inside transaction after
> the data is inserted. And there is no stored procedure for deleting
> this data.
> So he inserted that same rows again, and again for some reasons they
> were also deleted after some time. Now I had two logs of the same data
> being inserted and not present.
> After the third time the data remained there.
> Today I got a report of another problem. One row is also missing, but
> this time from another table.
> I have a couple of data which proves that this row was inserted and unless
> using sql commands it can't be removed from database.
>
> Users can only make changes to the data on the Trial server and then
> the data are propagated to MSDE server.
> I found http://support.microsoft.com/default...b;en-us;826433
> which could be related but I'm not sure what to do.
> Any suggestions on how to approach this problem? How to detect when and
> why are data being removed?
|||Nik Marshall-Blank wrote:
> From which server are they missing the publisher, subscriber or both?
>
both
|||After thinking about this I have one more question:
Could it be that because of referential integrity at the MSDE
server the data could be pushed back as a delete to Trial SQL
server?
Right now I have Enforce relationship for replication checked.
Should I unckeck it?
|||You could try it.
Nik Marshall-Blank MCSD/MCDBA
"zapov" <zapov@.yahoo.com> wrote in message
news:dfrhnd$7qu$1@.ss405.t-com.hr...
> After thinking about this I have one more question:
> Could it be that because of referential integrity at the MSDE
> server the data could be pushed back as a delete to Trial SQL
> server?
> Right now I have Enforce relationship for replication checked.
> Should I unckeck it?
|||Just read up on Merge Replications and updates at Subscribers are propogated
back to Publishers si I think this it=s your problem. Maybe you should go
for a different type of replication where subscriber changes are not
progpogated back.
Nik Marshall-Blank MCSD/MCDBA
"zapov" <zapov@.yahoo.com> wrote in message
news:dfrhnd$7qu$1@.ss405.t-com.hr...
> After thinking about this I have one more question:
> Could it be that because of referential integrity at the MSDE
> server the data could be pushed back as a delete to Trial SQL
> server?
> Right now I have Enforce relationship for replication checked.
> Should I unckeck it?

missing rows problem

Hi!
Recently I have noticed some strange behaviour from SQL Server.
It seems to me that rows are being deleted some time after they are
inserted (or maybe they are unable to be read again).
I use one Trial SQL server 2000 as central server with Merge replication
and MSDE as anonymous subscription.
When I used only Trial server with no replication I didn't notice this
problem (I mean, I didn't get reports of strange behaviour of data
from users using the program).
Couple a days ago I got first report of strange behaviour of data
not being on the server. I said that he is probably mistaken and
that he didn't do something right. So I went to check log of the
data where I found out that he was right, and that SQL server
deleted three rows.
I know this because there is a log with primary key of the data
that were inserted. This log is created inside transaction after
the data is inserted. And there is no stored procedure for deleting
this data.
So he inserted that same rows again, and again for some reasons they
were also deleted after some time. Now I had two logs of the same data
being inserted and not present.
After the third time the data remained there.
Today I got a report of another problem. One row is also missing, but
this time from another table.
I have a couple of data which proves that this row was inserted and
unless using sql commands it can't be removed from database.
Users can only make changes to the data on the Trial server and then
the data are propagated to MSDE server.
I found http://support.microsoft.com/default.aspx?scid=kb;en-us;826433
which could be related but I'm not sure what to do.
Any suggestions on how to approach this problem? How to detect when and
why are data being removed?From which server are they missing the publisher, subscriber or both?
--
Nik Marshall-Blank MCSD/MCDBA
"zapov" <zapov@.yahoo.com> wrote in message
news:dfrfef$1b5$1@.ss405.t-com.hr...
> Hi!
> Recently I have noticed some strange behaviour from SQL Server.
> It seems to me that rows are being deleted some time after they are
> inserted (or maybe they are unable to be read again).
> I use one Trial SQL server 2000 as central server with Merge replication
> and MSDE as anonymous subscription.
> When I used only Trial server with no replication I didn't notice this
> problem (I mean, I didn't get reports of strange behaviour of data
> from users using the program).
> Couple a days ago I got first report of strange behaviour of data
> not being on the server. I said that he is probably mistaken and
> that he didn't do something right. So I went to check log of the
> data where I found out that he was right, and that SQL server
> deleted three rows.
> I know this because there is a log with primary key of the data
> that were inserted. This log is created inside transaction after
> the data is inserted. And there is no stored procedure for deleting
> this data.
> So he inserted that same rows again, and again for some reasons they
> were also deleted after some time. Now I had two logs of the same data
> being inserted and not present.
> After the third time the data remained there.
> Today I got a report of another problem. One row is also missing, but
> this time from another table.
> I have a couple of data which proves that this row was inserted and unless
> using sql commands it can't be removed from database.
>
> Users can only make changes to the data on the Trial server and then
> the data are propagated to MSDE server.
> I found http://support.microsoft.com/default.aspx?scid=kb;en-us;826433
> which could be related but I'm not sure what to do.
> Any suggestions on how to approach this problem? How to detect when and
> why are data being removed?|||Nik Marshall-Blank wrote:
> From which server are they missing the publisher, subscriber or both?
>
both|||After thinking about this I have one more question:
Could it be that because of referential integrity at the MSDE
server the data could be pushed back as a delete to Trial SQL
server?
Right now I have Enforce relationship for replication checked.
Should I unckeck it?|||You could try it.
--
Nik Marshall-Blank MCSD/MCDBA
"zapov" <zapov@.yahoo.com> wrote in message
news:dfrhnd$7qu$1@.ss405.t-com.hr...
> After thinking about this I have one more question:
> Could it be that because of referential integrity at the MSDE
> server the data could be pushed back as a delete to Trial SQL
> server?
> Right now I have Enforce relationship for replication checked.
> Should I unckeck it?|||Just read up on Merge Replications and updates at Subscribers are propogated
back to Publishers si I think this it=s your problem. Maybe you should go
for a different type of replication where subscriber changes are not
progpogated back.
--
Nik Marshall-Blank MCSD/MCDBA
"zapov" <zapov@.yahoo.com> wrote in message
news:dfrhnd$7qu$1@.ss405.t-com.hr...
> After thinking about this I have one more question:
> Could it be that because of referential integrity at the MSDE
> server the data could be pushed back as a delete to Trial SQL
> server?
> Right now I have Enforce relationship for replication checked.
> Should I unckeck it?

Saturday, February 25, 2012

Missing log file...

Hi,
OK - I did stupid thing but... ;-)
I put database offline and then I deleted log file.
Then I was surprised that database do not want to
go into on-line status...
I am interested in object of this db not in data.
Is there any hope?
(I know - for me - not, but for this database? ;-)
Radek
Hi,
You might loose the consistency if you delete the LDF file directly.. Since
you are not that bothered bothered about data you could try
1. Try to attach the database using
EXEC sp_attach_single_file_db @.dbname = 'pubs', @.physname =
'D:\MSSQL\data\dbname.mdf'
This will attach the database with MDF file and will create a new LDF file.
This command will fail some times, since you have not detached the database
properly.. in that use the below method
2.
1. Create a new database with the same name and same MDF and LDF files
2. Stop sql server and rename the existing MDF to a new one and copy the
original MDF to this location and delete the LDF files.
3. Start SQL Server
4. Now your database will be marked suspect
5. Update the sysdatabases to update to Emergency mode. This will not use
LOG files in start up
Sp_configure "allow updates", 1
go
Reconfigure with override
GO
Update sysdatabases set status = 32768 where name = "BadDbName"
go
Sp_configure "allow updates", 0
go
Reconfigure with override
GO
6. Restart sql server. now the database will be in emergency mode ( You
could access the database)
7. Use enterprise manager to script all your objects
Thanks
Hari
MCDBA
"Radek" <radek@.obecniezwarszawy.pl> wrote in message
news:cfv1kb$4r3$1@.nemesis.news.tpi.pl...
> Hi,
> OK - I did stupid thing but... ;-)
> I put database offline and then I deleted log file.
> Then I was surprised that database do not want to
> go into on-line status...
> I am interested in object of this db not in data.
> Is there any hope?
> (I know - for me - not, but for this database? ;-)
> Radek
>
|||Before you do Hari's 2nd option make sure you copy off your original MDF
first...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Radek" <radek@.obecniezwarszawy.pl> wrote in message
news:cfv1kb$4r3$1@.nemesis.news.tpi.pl...
> Hi,
> OK - I did stupid thing but... ;-)
> I put database offline and then I deleted log file.
> Then I was surprised that database do not want to
> go into on-line status...
> I am interested in object of this db not in data.
> Is there any hope?
> (I know - for me - not, but for this database? ;-)
> Radek
>
|||I agree with Wayne...Thanks for pointing out.
Thanks
Hari
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:OOIrMERhEHA.3964@.TK2MSFTNGP12.phx.gbl...
> Before you do Hari's 2nd option make sure you copy off your original MDF
> first...
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Radek" <radek@.obecniezwarszawy.pl> wrote in message
> news:cfv1kb$4r3$1@.nemesis.news.tpi.pl...
>
|||> 1. Try to attach the database using
> EXEC sp_attach_single_file_db @.dbname = 'pubs', @.physname =
> 'D:\MSSQL\data\dbname.mdf'
>
It works
I was sure that something like this command should exist
... but I couldn't find it in manuals.
Thank You
Radek

Missing log file...

Hi,
OK - I did stupid thing but... ;-)
I put database offline and then I deleted log file.
Then I was surprised that database do not want to
go into on-line status...
I am interested in object of this db not in data.
Is there any hope?
(I know - for me - not, but for this database? ;-)
RadekHi,
You might loose the consistency if you delete the LDF file directly.. Since
you are not that bothered bothered about data you could try
1. Try to attach the database using
EXEC sp_attach_single_file_db @.dbname = 'pubs', @.physname =
'D:\MSSQL\data\dbname.mdf'
This will attach the database with MDF file and will create a new LDF file.
This command will fail some times, since you have not detached the database
properly.. in that use the below method
2.
1. Create a new database with the same name and same MDF and LDF files
2. Stop sql server and rename the existing MDF to a new one and copy the
original MDF to this location and delete the LDF files.
3. Start SQL Server
4. Now your database will be marked suspect
5. Update the sysdatabases to update to Emergency mode. This will not use
LOG files in start up
Sp_configure "allow updates", 1
go
Reconfigure with override
GO
Update sysdatabases set status = 32768 where name = "BadDbName"
go
Sp_configure "allow updates", 0
go
Reconfigure with override
GO
6. Restart sql server. now the database will be in emergency mode ( You
could access the database)
7. Use enterprise manager to script all your objects
Thanks
Hari
MCDBA
"Radek" <radek@.obecniezwarszawy.pl> wrote in message
news:cfv1kb$4r3$1@.nemesis.news.tpi.pl...
> Hi,
> OK - I did stupid thing but... ;-)
> I put database offline and then I deleted log file.
> Then I was surprised that database do not want to
> go into on-line status...
> I am interested in object of this db not in data.
> Is there any hope?
> (I know - for me - not, but for this database? ;-)
> Radek
>|||Before you do Hari's 2nd option make sure you copy off your original MDF
first...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Radek" <radek@.obecniezwarszawy.pl> wrote in message
news:cfv1kb$4r3$1@.nemesis.news.tpi.pl...
> Hi,
> OK - I did stupid thing but... ;-)
> I put database offline and then I deleted log file.
> Then I was surprised that database do not want to
> go into on-line status...
> I am interested in object of this db not in data.
> Is there any hope?
> (I know - for me - not, but for this database? ;-)
> Radek
>|||I agree with Wayne...Thanks for pointing out.
Thanks
Hari
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:OOIrMERhEHA.3964@.TK2MSFTNGP12.phx.gbl...
> Before you do Hari's 2nd option make sure you copy off your original MDF
> first...
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Radek" <radek@.obecniezwarszawy.pl> wrote in message
> news:cfv1kb$4r3$1@.nemesis.news.tpi.pl...
>|||> 1. Try to attach the database using
> EXEC sp_attach_single_file_db @.dbname = 'pubs', @.physname =
> 'D:\MSSQL\data\dbname.mdf'
>
It works
I was sure that something like this command should exist
... but I couldn't find it in manuals.
Thank You
Radek

Missing log file...

Hi,
OK - I did stupid thing but... ;-)
I put database offline and then I deleted log file.
Then I was surprised that database do not want to
go into on-line status...
I am interested in object of this db not in data.
Is there any hope?
(I know - for me - not, but for this database? ;-)
RadekHi,
You might loose the consistency if you delete the LDF file directly.. Since
you are not that bothered bothered about data you could try
1. Try to attach the database using
EXEC sp_attach_single_file_db @.dbname = 'pubs', @.physname ='D:\MSSQL\data\dbname.mdf'
This will attach the database with MDF file and will create a new LDF file.
This command will fail some times, since you have not detached the database
properly.. in that use the below method
2.
1. Create a new database with the same name and same MDF and LDF files
2. Stop sql server and rename the existing MDF to a new one and copy the
original MDF to this location and delete the LDF files.
3. Start SQL Server
4. Now your database will be marked suspect
5. Update the sysdatabases to update to Emergency mode. This will not use
LOG files in start up
Sp_configure "allow updates", 1
go
Reconfigure with override
GO
Update sysdatabases set status = 32768 where name = "BadDbName"
go
Sp_configure "allow updates", 0
go
Reconfigure with override
GO
6. Restart sql server. now the database will be in emergency mode ( You
could access the database)
7. Use enterprise manager to script all your objects
Thanks
Hari
MCDBA
"Radek" <radek@.obecniezwarszawy.pl> wrote in message
news:cfv1kb$4r3$1@.nemesis.news.tpi.pl...
> Hi,
> OK - I did stupid thing but... ;-)
> I put database offline and then I deleted log file.
> Then I was surprised that database do not want to
> go into on-line status...
> I am interested in object of this db not in data.
> Is there any hope?
> (I know - for me - not, but for this database? ;-)
> Radek
>|||Before you do Hari's 2nd option make sure you copy off your original MDF
first...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Radek" <radek@.obecniezwarszawy.pl> wrote in message
news:cfv1kb$4r3$1@.nemesis.news.tpi.pl...
> Hi,
> OK - I did stupid thing but... ;-)
> I put database offline and then I deleted log file.
> Then I was surprised that database do not want to
> go into on-line status...
> I am interested in object of this db not in data.
> Is there any hope?
> (I know - for me - not, but for this database? ;-)
> Radek
>|||I agree with Wayne...Thanks for pointing out.
Thanks
Hari
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:OOIrMERhEHA.3964@.TK2MSFTNGP12.phx.gbl...
> Before you do Hari's 2nd option make sure you copy off your original MDF
> first...
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Radek" <radek@.obecniezwarszawy.pl> wrote in message
> news:cfv1kb$4r3$1@.nemesis.news.tpi.pl...
> > Hi,
> >
> > OK - I did stupid thing but... ;-)
> > I put database offline and then I deleted log file.
> > Then I was surprised that database do not want to
> > go into on-line status...
> > I am interested in object of this db not in data.
> > Is there any hope?
> > (I know - for me - not, but for this database? ;-)
> >
> > Radek
> >
> >
>|||> 1. Try to attach the database using
> EXEC sp_attach_single_file_db @.dbname = 'pubs', @.physname => 'D:\MSSQL\data\dbname.mdf'
>
It works :)
I was sure that something like this command should exist
... but I couldn't find it in manuals.
Thank You
Radek