sql2k sp3a
Is there a way for me to create db corruption to do some testing?
TIA, Chris
Manually delete a row from sysindexes (but don't delete anything with id <
100).
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <noemail@.bla.com> wrote in message
news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
> sql2k sp3a
> Is there a way for me to create db corruption to do some testing?
> TIA, Chris
>
|||Thanks Randal, but this doesn't return an error, which is really what I
need. (@.@.Error still = 0) Heres what I'm trying to do.
alter procedure admin_DBCCCheckDB
as
declare @.Exec varchar(256)
declare @.Error int
declare @.rc int
declare @.ServerName varchar(256)
declare @.DBName varchar(128)
declare @.Subject varchar(128)
set @.ServerName = (select @.@.ServerName)
set @.DBName = (select db_name())
SET @.Exec = 'dbcc checkdb(''' + @.DBName + ''')' + 'WITH NO_INFOMSGS'
set @.Subject = 'Database corruption in the ' +@.DBName+ ' database!!!'
EXEC (@.Exec)
SELECT @.Error = @.@.error
print @.Error
IF @.Error <> 0
exec @.rc = master.dbo.xp_smtp_sendmail
@.FROM = @.ServerName
,@.TO = 'SQLAdmins@.Bla.com'
,@.Subject = @.Subject
,@.server = N'255.255.255.255'
,@.Port = 25
"Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
news:usgrpPulFHA.3828@.TK2MSFTNGP12.phx.gbl...
> Manually delete a row from sysindexes (but don't delete anything with id <
> 100).
> --
> Paul Randal
> Dev Lead, Microsoft SQL Server Storage Engine
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "ChrisR" <noemail@.bla.com> wrote in message
> news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
>
Showing posts with label corruption. Show all posts
Showing posts with label corruption. Show all posts
Tuesday, February 14, 2012
create corruption
create corruption
Is there a way to create db corruption without deleting a row from
sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
allocation errors and 0 consistency errors in database bla" and I want it to
return an error.
TIA,
ChrisR
Ugh! I'm trying to get rid of it and you're trying to create it! ;-)
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:8CEFC956-B85C-4A1C-9AF4-D793C14FADB8@.microsoft.com...
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found
> 0
> allocation errors and 0 consistency errors in database bla" and I want it
> to
> return an error.
> --
> TIA,
> ChrisR
|||Hi,
you could edit the .mdf file with a editor and enter some char's on the file.
I never done it but i think it could work : )
CC
"ChrisR" wrote:
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
> allocation errors and 0 consistency errors in database bla" and I want it to
> return an error.
> --
> TIA,
> ChrisR
|||That would leave it suspect, not corrupted. Thanks though.
TIA,
ChrisR
"CC" wrote:
[vbcol=seagreen]
> Hi,
> you could edit the .mdf file with a editor and enter some char's on the file.
> I never done it but i think it could work : )
> CC
> "ChrisR" wrote:
|||No - it would only leave it suspect if recovery runs across the page you
corrupted. Your best bet is to delete a row from sysindexes. Instead of the
script you posted in a previous thread, its far easier to create a single
non-clustered index, insert a few rows and then
delete * from sysindexes
where indid=2 and
id=object_id ('mytable')
You should get a variety of errors from CHECKDB.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:A16120B3-C62D-4355-A402-5F858AFEA293@.microsoft.com...[vbcol=seagreen]
> That would leave it suspect, not corrupted. Thanks though.
> --
> TIA,
> ChrisR
>
> "CC" wrote:
sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
allocation errors and 0 consistency errors in database bla" and I want it to
return an error.
TIA,
ChrisR
Ugh! I'm trying to get rid of it and you're trying to create it! ;-)
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:8CEFC956-B85C-4A1C-9AF4-D793C14FADB8@.microsoft.com...
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found
> 0
> allocation errors and 0 consistency errors in database bla" and I want it
> to
> return an error.
> --
> TIA,
> ChrisR
|||Hi,
you could edit the .mdf file with a editor and enter some char's on the file.
I never done it but i think it could work : )
CC
"ChrisR" wrote:
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
> allocation errors and 0 consistency errors in database bla" and I want it to
> return an error.
> --
> TIA,
> ChrisR
|||That would leave it suspect, not corrupted. Thanks though.
TIA,
ChrisR
"CC" wrote:
[vbcol=seagreen]
> Hi,
> you could edit the .mdf file with a editor and enter some char's on the file.
> I never done it but i think it could work : )
> CC
> "ChrisR" wrote:
|||No - it would only leave it suspect if recovery runs across the page you
corrupted. Your best bet is to delete a row from sysindexes. Instead of the
script you posted in a previous thread, its far easier to create a single
non-clustered index, insert a few rows and then
delete * from sysindexes
where indid=2 and
id=object_id ('mytable')
You should get a variety of errors from CHECKDB.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:A16120B3-C62D-4355-A402-5F858AFEA293@.microsoft.com...[vbcol=seagreen]
> That would leave it suspect, not corrupted. Thanks though.
> --
> TIA,
> ChrisR
>
> "CC" wrote:
create corruption
sql2k sp3a
Is there a way for me to create db corruption to do some testing?
TIA, ChrisManually delete a row from sysindexes (but don't delete anything with id <
100).
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <noemail@.bla.com> wrote in message
news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
> sql2k sp3a
> Is there a way for me to create db corruption to do some testing?
> TIA, Chris
>|||Thanks Randal, but this doesn't return an error, which is really what I
need. (@.@.Error still = 0) Heres what I'm trying to do.
alter procedure admin_DBCCCheckDB
as
declare @.Exec varchar(256)
declare @.Error int
declare @.rc int
declare @.ServerName varchar(256)
declare @.DBName varchar(128)
declare @.Subject varchar(128)
set @.ServerName = (select @.@.ServerName)
set @.DBName = (select db_name())
SET @.Exec = 'dbcc checkdb(''' + @.DBName + ''')' + 'WITH NO_INFOMSGS'
set @.Subject = 'Database corruption in the ' +@.DBName+ ' database!!!'
EXEC (@.Exec)
SELECT @.Error = @.@.error
print @.Error
IF @.Error <> 0
exec @.rc = master.dbo.xp_smtp_sendmail
@.FROM = @.ServerName
,@.TO = 'SQLAdmins@.Bla.com'
,@.Subject = @.Subject
,@.server = N'255.255.255.255'
,@.Port = 25
"Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
news:usgrpPulFHA.3828@.TK2MSFTNGP12.phx.gbl...
> Manually delete a row from sysindexes (but don't delete anything with id <
> 100).
> --
> Paul Randal
> Dev Lead, Microsoft SQL Server Storage Engine
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "ChrisR" <noemail@.bla.com> wrote in message
> news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
>
Is there a way for me to create db corruption to do some testing?
TIA, ChrisManually delete a row from sysindexes (but don't delete anything with id <
100).
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <noemail@.bla.com> wrote in message
news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
> sql2k sp3a
> Is there a way for me to create db corruption to do some testing?
> TIA, Chris
>|||Thanks Randal, but this doesn't return an error, which is really what I
need. (@.@.Error still = 0) Heres what I'm trying to do.
alter procedure admin_DBCCCheckDB
as
declare @.Exec varchar(256)
declare @.Error int
declare @.rc int
declare @.ServerName varchar(256)
declare @.DBName varchar(128)
declare @.Subject varchar(128)
set @.ServerName = (select @.@.ServerName)
set @.DBName = (select db_name())
SET @.Exec = 'dbcc checkdb(''' + @.DBName + ''')' + 'WITH NO_INFOMSGS'
set @.Subject = 'Database corruption in the ' +@.DBName+ ' database!!!'
EXEC (@.Exec)
SELECT @.Error = @.@.error
print @.Error
IF @.Error <> 0
exec @.rc = master.dbo.xp_smtp_sendmail
@.FROM = @.ServerName
,@.TO = 'SQLAdmins@.Bla.com'
,@.Subject = @.Subject
,@.server = N'255.255.255.255'
,@.Port = 25
"Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
news:usgrpPulFHA.3828@.TK2MSFTNGP12.phx.gbl...
> Manually delete a row from sysindexes (but don't delete anything with id <
> 100).
> --
> Paul Randal
> Dev Lead, Microsoft SQL Server Storage Engine
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "ChrisR" <noemail@.bla.com> wrote in message
> news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
>
create corruption
Is there a way to create db corruption without deleting a row from
sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
allocation errors and 0 consistency errors in database bla" and I want it to
return an error.
--
TIA,
ChrisRUgh! I'm trying to get rid of it and you're trying to create it! ;-)
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:8CEFC956-B85C-4A1C-9AF4-D793C14FADB8@.microsoft.com...
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found
> 0
> allocation errors and 0 consistency errors in database bla" and I want it
> to
> return an error.
> --
> TIA,
> ChrisR|||Hi,
you could edit the .mdf file with a editor and enter some char's on the file
.
I never done it but i think it could work : )
CC
"ChrisR" wrote:
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found
0
> allocation errors and 0 consistency errors in database bla" and I want it
to
> return an error.
> --
> TIA,
> ChrisR|||That would leave it suspect, not corrupted. Thanks though.
--
TIA,
ChrisR
"CC" wrote:
[vbcol=seagreen]
> Hi,
> you could edit the .mdf file with a editor and enter some char's on the fi
le.
> I never done it but i think it could work : )
> CC
> "ChrisR" wrote:
>|||No - it would only leave it suspect if recovery runs across the page you
corrupted. Your best bet is to delete a row from sysindexes. Instead of the
script you posted in a previous thread, its far easier to create a single
non-clustered index, insert a few rows and then
delete * from sysindexes
where indid=2 and
id=object_id ('mytable')
You should get a variety of errors from CHECKDB.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:A16120B3-C62D-4355-A402-5F858AFEA293@.microsoft.com...[vbcol=seagreen]
> That would leave it suspect, not corrupted. Thanks though.
> --
> TIA,
> ChrisR
>
> "CC" wrote:
>
sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
allocation errors and 0 consistency errors in database bla" and I want it to
return an error.
--
TIA,
ChrisRUgh! I'm trying to get rid of it and you're trying to create it! ;-)
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:8CEFC956-B85C-4A1C-9AF4-D793C14FADB8@.microsoft.com...
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found
> 0
> allocation errors and 0 consistency errors in database bla" and I want it
> to
> return an error.
> --
> TIA,
> ChrisR|||Hi,
you could edit the .mdf file with a editor and enter some char's on the file
.
I never done it but i think it could work : )
CC
"ChrisR" wrote:
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found
0
> allocation errors and 0 consistency errors in database bla" and I want it
to
> return an error.
> --
> TIA,
> ChrisR|||That would leave it suspect, not corrupted. Thanks though.
--
TIA,
ChrisR
"CC" wrote:
[vbcol=seagreen]
> Hi,
> you could edit the .mdf file with a editor and enter some char's on the fi
le.
> I never done it but i think it could work : )
> CC
> "ChrisR" wrote:
>|||No - it would only leave it suspect if recovery runs across the page you
corrupted. Your best bet is to delete a row from sysindexes. Instead of the
script you posted in a previous thread, its far easier to create a single
non-clustered index, insert a few rows and then
delete * from sysindexes
where indid=2 and
id=object_id ('mytable')
You should get a variety of errors from CHECKDB.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:A16120B3-C62D-4355-A402-5F858AFEA293@.microsoft.com...[vbcol=seagreen]
> That would leave it suspect, not corrupted. Thanks though.
> --
> TIA,
> ChrisR
>
> "CC" wrote:
>
create corruption
Is there a way to create db corruption without deleting a row from
sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
allocation errors and 0 consistency errors in database bla" and I want it to
return an error.
--
TIA,
ChrisRUgh! I'm trying to get rid of it and you're trying to create it! ;-)
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:8CEFC956-B85C-4A1C-9AF4-D793C14FADB8@.microsoft.com...
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found
> 0
> allocation errors and 0 consistency errors in database bla" and I want it
> to
> return an error.
> --
> TIA,
> ChrisR|||Hi,
you could edit the .mdf file with a editor and enter some char's on the file.
I never done it but i think it could work : )
CC
"ChrisR" wrote:
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
> allocation errors and 0 consistency errors in database bla" and I want it to
> return an error.
> --
> TIA,
> ChrisR|||That would leave it suspect, not corrupted. Thanks though.
--
TIA,
ChrisR
"CC" wrote:
> Hi,
> you could edit the .mdf file with a editor and enter some char's on the file.
> I never done it but i think it could work : )
> CC
> "ChrisR" wrote:
> > Is there a way to create db corruption without deleting a row from
> > sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
> > allocation errors and 0 consistency errors in database bla" and I want it to
> > return an error.
> > --
> > TIA,
> > ChrisR|||No - it would only leave it suspect if recovery runs across the page you
corrupted. Your best bet is to delete a row from sysindexes. Instead of the
script you posted in a previous thread, its far easier to create a single
non-clustered index, insert a few rows and then
delete * from sysindexes
where indid=2 and
id=object_id ('mytable')
You should get a variety of errors from CHECKDB.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:A16120B3-C62D-4355-A402-5F858AFEA293@.microsoft.com...
> That would leave it suspect, not corrupted. Thanks though.
> --
> TIA,
> ChrisR
>
> "CC" wrote:
>> Hi,
>> you could edit the .mdf file with a editor and enter some char's on the
>> file.
>> I never done it but i think it could work : )
>> CC
>> "ChrisR" wrote:
>> > Is there a way to create db corruption without deleting a row from
>> > sysIndexes? That method still allows dbcc checkdb to return "CHECKDB
>> > found 0
>> > allocation errors and 0 consistency errors in database bla" and I want
>> > it to
>> > return an error.
>> > --
>> > TIA,
>> > ChrisR
sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
allocation errors and 0 consistency errors in database bla" and I want it to
return an error.
--
TIA,
ChrisRUgh! I'm trying to get rid of it and you're trying to create it! ;-)
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:8CEFC956-B85C-4A1C-9AF4-D793C14FADB8@.microsoft.com...
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found
> 0
> allocation errors and 0 consistency errors in database bla" and I want it
> to
> return an error.
> --
> TIA,
> ChrisR|||Hi,
you could edit the .mdf file with a editor and enter some char's on the file.
I never done it but i think it could work : )
CC
"ChrisR" wrote:
> Is there a way to create db corruption without deleting a row from
> sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
> allocation errors and 0 consistency errors in database bla" and I want it to
> return an error.
> --
> TIA,
> ChrisR|||That would leave it suspect, not corrupted. Thanks though.
--
TIA,
ChrisR
"CC" wrote:
> Hi,
> you could edit the .mdf file with a editor and enter some char's on the file.
> I never done it but i think it could work : )
> CC
> "ChrisR" wrote:
> > Is there a way to create db corruption without deleting a row from
> > sysIndexes? That method still allows dbcc checkdb to return "CHECKDB found 0
> > allocation errors and 0 consistency errors in database bla" and I want it to
> > return an error.
> > --
> > TIA,
> > ChrisR|||No - it would only leave it suspect if recovery runs across the page you
corrupted. Your best bet is to delete a row from sysindexes. Instead of the
script you posted in a previous thread, its far easier to create a single
non-clustered index, insert a few rows and then
delete * from sysindexes
where indid=2 and
id=object_id ('mytable')
You should get a variety of errors from CHECKDB.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:A16120B3-C62D-4355-A402-5F858AFEA293@.microsoft.com...
> That would leave it suspect, not corrupted. Thanks though.
> --
> TIA,
> ChrisR
>
> "CC" wrote:
>> Hi,
>> you could edit the .mdf file with a editor and enter some char's on the
>> file.
>> I never done it but i think it could work : )
>> CC
>> "ChrisR" wrote:
>> > Is there a way to create db corruption without deleting a row from
>> > sysIndexes? That method still allows dbcc checkdb to return "CHECKDB
>> > found 0
>> > allocation errors and 0 consistency errors in database bla" and I want
>> > it to
>> > return an error.
>> > --
>> > TIA,
>> > ChrisR
create corruption
sql2k sp3a
Is there a way for me to create db corruption to do some testing?
TIA, ChrisManually delete a row from sysindexes (but don't delete anything with id <
100).
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <noemail@.bla.com> wrote in message
news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
> sql2k sp3a
> Is there a way for me to create db corruption to do some testing?
> TIA, Chris
>|||Thanks Randal, but this doesn't return an error, which is really what I
need. (@.@.Error still = 0) Heres what I'm trying to do.
alter procedure admin_DBCCCheckDB
as
declare @.Exec varchar(256)
declare @.Error int
declare @.rc int
declare @.ServerName varchar(256)
declare @.DBName varchar(128)
declare @.Subject varchar(128)
set @.ServerName = (select @.@.ServerName)
set @.DBName = (select db_name())
SET @.Exec = 'dbcc checkdb(''' + @.DBName + ''')' + 'WITH NO_INFOMSGS'
set @.Subject = 'Database corruption in the ' +@.DBName+ ' database!!!'
EXEC (@.Exec)
SELECT @.Error = @.@.error
print @.Error
IF @.Error <> 0
exec @.rc = master.dbo.xp_smtp_sendmail
@.FROM = @.ServerName
,@.TO = 'SQLAdmins@.Bla.com'
,@.Subject = @.Subject
,@.server = N'255.255.255.255'
,@.Port = 25
"Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
news:usgrpPulFHA.3828@.TK2MSFTNGP12.phx.gbl...
> Manually delete a row from sysindexes (but don't delete anything with id <
> 100).
> --
> Paul Randal
> Dev Lead, Microsoft SQL Server Storage Engine
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "ChrisR" <noemail@.bla.com> wrote in message
> news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
>> sql2k sp3a
>> Is there a way for me to create db corruption to do some testing?
>> TIA, Chris
>|||Doh! My print statement resturns a 0.
"ChrisR" <noemail@.bla.com> wrote in message
news:OCFVydulFHA.576@.TK2MSFTNGP15.phx.gbl...
> Thanks Randal, but this doesn't return an error, which is really what I
> need. (@.@.Error still = 0) Heres what I'm trying to do.
> alter procedure admin_DBCCCheckDB
> as
> declare @.Exec varchar(256)
> declare @.Error int
> declare @.rc int
> declare @.ServerName varchar(256)
> declare @.DBName varchar(128)
> declare @.Subject varchar(128)
> set @.ServerName = (select @.@.ServerName)
> set @.DBName = (select db_name())
> SET @.Exec = 'dbcc checkdb(''' + @.DBName + ''')' + 'WITH NO_INFOMSGS'
> set @.Subject = 'Database corruption in the ' +@.DBName+ ' database!!!'
> EXEC (@.Exec)
> SELECT @.Error = @.@.error
> print @.Error
> IF @.Error <> 0
> exec @.rc = master.dbo.xp_smtp_sendmail
> @.FROM = @.ServerName
> ,@.TO = 'SQLAdmins@.Bla.com'
> ,@.Subject = @.Subject
> ,@.server = N'255.255.255.255'
> ,@.Port = 25
>
>
> "Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
> news:usgrpPulFHA.3828@.TK2MSFTNGP12.phx.gbl...
>> Manually delete a row from sysindexes (but don't delete anything with id
>> < 100).
>> --
>> Paul Randal
>> Dev Lead, Microsoft SQL Server Storage Engine
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
>> sql2k sp3a
>> Is there a way for me to create db corruption to do some testing?
>> TIA, Chris
>>
>
Is there a way for me to create db corruption to do some testing?
TIA, ChrisManually delete a row from sysindexes (but don't delete anything with id <
100).
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"ChrisR" <noemail@.bla.com> wrote in message
news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
> sql2k sp3a
> Is there a way for me to create db corruption to do some testing?
> TIA, Chris
>|||Thanks Randal, but this doesn't return an error, which is really what I
need. (@.@.Error still = 0) Heres what I'm trying to do.
alter procedure admin_DBCCCheckDB
as
declare @.Exec varchar(256)
declare @.Error int
declare @.rc int
declare @.ServerName varchar(256)
declare @.DBName varchar(128)
declare @.Subject varchar(128)
set @.ServerName = (select @.@.ServerName)
set @.DBName = (select db_name())
SET @.Exec = 'dbcc checkdb(''' + @.DBName + ''')' + 'WITH NO_INFOMSGS'
set @.Subject = 'Database corruption in the ' +@.DBName+ ' database!!!'
EXEC (@.Exec)
SELECT @.Error = @.@.error
print @.Error
IF @.Error <> 0
exec @.rc = master.dbo.xp_smtp_sendmail
@.FROM = @.ServerName
,@.TO = 'SQLAdmins@.Bla.com'
,@.Subject = @.Subject
,@.server = N'255.255.255.255'
,@.Port = 25
"Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
news:usgrpPulFHA.3828@.TK2MSFTNGP12.phx.gbl...
> Manually delete a row from sysindexes (but don't delete anything with id <
> 100).
> --
> Paul Randal
> Dev Lead, Microsoft SQL Server Storage Engine
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "ChrisR" <noemail@.bla.com> wrote in message
> news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
>> sql2k sp3a
>> Is there a way for me to create db corruption to do some testing?
>> TIA, Chris
>|||Doh! My print statement resturns a 0.
"ChrisR" <noemail@.bla.com> wrote in message
news:OCFVydulFHA.576@.TK2MSFTNGP15.phx.gbl...
> Thanks Randal, but this doesn't return an error, which is really what I
> need. (@.@.Error still = 0) Heres what I'm trying to do.
> alter procedure admin_DBCCCheckDB
> as
> declare @.Exec varchar(256)
> declare @.Error int
> declare @.rc int
> declare @.ServerName varchar(256)
> declare @.DBName varchar(128)
> declare @.Subject varchar(128)
> set @.ServerName = (select @.@.ServerName)
> set @.DBName = (select db_name())
> SET @.Exec = 'dbcc checkdb(''' + @.DBName + ''')' + 'WITH NO_INFOMSGS'
> set @.Subject = 'Database corruption in the ' +@.DBName+ ' database!!!'
> EXEC (@.Exec)
> SELECT @.Error = @.@.error
> print @.Error
> IF @.Error <> 0
> exec @.rc = master.dbo.xp_smtp_sendmail
> @.FROM = @.ServerName
> ,@.TO = 'SQLAdmins@.Bla.com'
> ,@.Subject = @.Subject
> ,@.server = N'255.255.255.255'
> ,@.Port = 25
>
>
> "Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
> news:usgrpPulFHA.3828@.TK2MSFTNGP12.phx.gbl...
>> Manually delete a row from sysindexes (but don't delete anything with id
>> < 100).
>> --
>> Paul Randal
>> Dev Lead, Microsoft SQL Server Storage Engine
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:%23WgmjHulFHA.3316@.TK2MSFTNGP14.phx.gbl...
>> sql2k sp3a
>> Is there a way for me to create db corruption to do some testing?
>> TIA, Chris
>>
>
Subscribe to:
Posts (Atom)