473,405 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

TSQL to run DBCC rebuild_repair on an MSDE 2000-hosted DB

Hi All

Bit of confirmation needed really, as I've just come home and found that my
PC is only running SQL 7.0, when I know the below code only works in SQL
2000 (I think!!!).

What I want to do is put a particular DB in single user mode, do a DBCC
repair_rebuild then put it back to how it was all from a text file that is
executed via osql (MSDE's isql equivalent). Will the below do it?

alter database AccountsData
set single_user
with rollback immediate
go

dbcc checkdb('AccountsData',repair_rebuild)
go

alter database AccountsData
set multi_user
go

Do I need anything else, like use Master or something bearing in mind the
text file/osql method that I have to use?

Thanks

Laphan


Jul 20 '05 #1
2 6629
hi Laphan,
"Laphan" <ne**@DoNotEmailMe.co.uk> ha scritto nel messaggio
news:40********@127.0.0.1...
Hi All

Bit of confirmation needed really, as I've just come home and found that my PC is only running SQL 7.0, when I know the below code only works in SQL
2000 (I think!!!).

What I want to do is put a particular DB in single user mode, do a DBCC
repair_rebuild then put it back to how it was all from a text file that is
executed via osql (MSDE's isql equivalent). Will the below do it?

alter database AccountsData
set single_user
with rollback immediate
go


on SQL Server 7.0 that syntax si not supported... you have to execute
EXEC sp_dboption 'dbnam', 'single user' , 'TRUE'
to put the database in single user mode
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.7.0 - DbaMgr ver 0.53.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--------- remove DMO to reply

Jul 20 '05 #2
Many thanks Andrea
Andrea Montanari <an***********@virgilio.it> wrote in message
news:2g************@uni-berlin.de...
hi Laphan,
"Laphan" <ne**@DoNotEmailMe.co.uk> ha scritto nel messaggio
news:40********@127.0.0.1...
Hi All

Bit of confirmation needed really, as I've just come home and found that my PC is only running SQL 7.0, when I know the below code only works in SQL
2000 (I think!!!).

What I want to do is put a particular DB in single user mode, do a DBCC
repair_rebuild then put it back to how it was all from a text file that is
executed via osql (MSDE's isql equivalent). Will the below do it?

alter database AccountsData
set single_user
with rollback immediate
go


on SQL Server 7.0 that syntax si not supported... you have to execute
EXEC sp_dboption 'dbnam', 'single user' , 'TRUE'
to put the database in single user mode
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.7.0 - DbaMgr ver 0.53.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--------- remove DMO to reply

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Craig HB | last post by:
I have a distributed inventory control database that I am going to migrate from Access to SQL Server. I am going to use SQL Server Replication to keep the data current. There will one SQL Server...
1
by: Mike N. | last post by:
I am writing a database app which will run under MSDE on the user's systems. Other than limitations as to the number of concurrent users, are there any issues that I need to be aware of when...
1
by: izzy | last post by:
I was wondering if any of you guys can kindly help me in finding all the different versions of MSDE 2000 that came out since it's first release. I expected to find something similar like Sun's...
5
by: Igor Solodovnikov | last post by:
Hi. I am trying to automatically backup transaction log when error 9002 happened. So i have created appropriate job and alert to catch this error. I have two instances of sql server under Windows...
10
by: noname | last post by:
MSDE 2000 Release A installed under windows 2000 pro will not communicate with SQL Server Manager nor MS Access on peer computer. Can someone help? Have set DISABLENETWORKPROTOCOLS=0 at install...
1
by: Diana Finley | last post by:
Hi all, I just got SQL Server 2000, but I already have MSDE installed. Is there any reason I would want to keep MSDE around on my computer if I install SQL Server 2000? I use MS Visual Studio...
7
by: Mike Watson | last post by:
I've got MSDE, SQL Server 7.0, installed. I want to handle an .mdf developed by someone else so I loaded the .mdf into my /DATA folder. But, MSDE/ODBC can't see the database. I subsequently...
1
by: smahler | last post by:
Hi all, Here is my situation. I have an application that uses SQL 2000. The client has a program that uses MSDE. The client MUST have the MSDE version of the Database. What I have done is to...
3
by: Raziq Shekha | last post by:
Hi Folks, SQL Server 2000 SP3 on Windows 2000. I have a database on which I ran the command : dbcc dbreindex ('tablename') go for all tables in the database. Then I compared the dbcc...
11
by: HC | last post by:
I posted this in one of the VB forums but I'm starting to think it might be more appropriate to have it here, since it really seems to be a SQL server (MSDE/Express 2005) problem: Hey, all, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.