By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,265 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,265 IT Pros & Developers. It's quick & easy.

Truncate Database Statement help

P: n/a

Hello,

I hope you can help me.
We have a SQL Server 2000 database at work, (which works with a VB6
frontend) which grew to a considerable size, so one of my past colleagues
sent me this truncate statement to use on the database.
I ran it like this, and all appeared to be well, it shrank the database,
Shortly afterwards, after I ran this I noticed something not quite right.
for example, one of the tables we keep is a User_Admin table which has 50
records in there, when I accessed this using the frontend it only showed 1
record, and this happened with every table in the database accessed by the
frontend.

The data in the tables is still there, but only shows one record through the
frontend.
Can anyone help me, and check this statement I ran, as its weird that all
this happened after I ran this statement.

Thanks,

Jayne Heger

sp_dboption PBTDEV,'trunc. log on chkpt.', true
checkpoint
--sp_dboption sadev,'trunc. log on chkpt.', false
sp_dboption PBTDEV,'autoshrink', true
--sp_dboption sadev,'autoshrink', false

DBCC SHRINKDATABASE (PBTDEV, NOTRUNCATE)
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi

It is unlikely that your error is caused by this, although you may want to
run DBCC CHECKDB on the database. If you know the statement that you are
running (or use profiler to get it) you may find that you have deleted some
data that it is dependent on to get the expected results.

John

"Little PussyCat" <SP******@NOSPAM.com> wrote in message
news:f9************@tiger.sphynx...

Hello,

I hope you can help me.
We have a SQL Server 2000 database at work, (which works with a VB6
frontend) which grew to a considerable size, so one of my past colleagues
sent me this truncate statement to use on the database.
I ran it like this, and all appeared to be well, it shrank the database,
Shortly afterwards, after I ran this I noticed something not quite right.
for example, one of the tables we keep is a User_Admin table which has 50
records in there, when I accessed this using the frontend it only showed 1
record, and this happened with every table in the database accessed by the
frontend.

The data in the tables is still there, but only shows one record through
the
frontend.
Can anyone help me, and check this statement I ran, as its weird that all
this happened after I ran this statement.

Thanks,

Jayne Heger

sp_dboption PBTDEV,'trunc. log on chkpt.', true
checkpoint
--sp_dboption sadev,'trunc. log on chkpt.', false
sp_dboption PBTDEV,'autoshrink', true
--sp_dboption sadev,'autoshrink', false

DBCC SHRINKDATABASE (PBTDEV, NOTRUNCATE)

Jul 23 '05 #2

P: n/a
I agree, the error is probably coming from the application or the sp which the
application runs.

Hi

It is unlikely that your error is caused by this, although you may want to
run DBCC CHECKDB on the database. If you know the statement that you are
running (or use profiler to get it) you may find that you have deleted some
data that it is dependent on to get the expected results.

John

"Little PussyCat" <SP******@NOSPAM.com> wrote in message
news:f9************@tiger.sphynx...

Hello,

I hope you can help me.
We have a SQL Server 2000 database at work, (which works with a VB6
frontend) which grew to a considerable size, so one of my past colleagues
sent me this truncate statement to use on the database.
I ran it like this, and all appeared to be well, it shrank the database,
Shortly afterwards, after I ran this I noticed something not quite right.
for example, one of the tables we keep is a User_Admin table which has 50
records in there, when I accessed this using the frontend it only showed 1
record, and this happened with every table in the database accessed by the
frontend.

The data in the tables is still there, but only shows one record through
the
frontend.
Can anyone help me, and check this statement I ran, as its weird that all
this happened after I ran this statement.

Thanks,

Jayne Heger

sp_dboption PBTDEV,'trunc. log on chkpt.', true
checkpoint
--sp_dboption sadev,'trunc. log on chkpt.', false
sp_dboption PBTDEV,'autoshrink', true
--sp_dboption sadev,'autoshrink', false

DBCC SHRINKDATABASE (PBTDEV, NOTRUNCATE)




Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.