Hi there,
I try to run the following update statement on MS SQL Server 2000 SP4
UPDATE Site
SET Active = 0
WHERE
RID IN (SELECT site.RID AS site_rid
FROM Site INNER JOIN
ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
Manager m ON ms.ManagerID = m.RID
WHERE (am.UserName = 'iwk1004') AND
(ms.isPrimaryUser = 1))
Running this query I get the message "Subquery returned more than 1
value. This is not permitted when the subquery follows =, !=, <, <= ,
>, >= or when the subquery is used as an expression."
Which is weird, because according to the documentation and examples I
inferred could use UPDATE with the use of IN in the condition and the
subquery returining multiple rows. (sub-query works fine BTW)
Any idea what is going on?
Regards,
Iwaniwanvanderkleijn@.gmail.com wrote:
> Hi there,
> I try to run the following update statement on MS SQL Server 2000 SP4
> UPDATE Site
> SET Active = 0
> WHERE
> RID IN (SELECT site.RID AS site_rid
> FROM Site INNER JOIN
> ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
> Manager m ON ms.ManagerID = m.RID
> WHERE (am.UserName = 'iwk1004') AND
> (ms.isPrimaryUser = 1))
> Running this query I get the message "Subquery returned more than 1
> value. This is not permitted when the subquery follows =, !=, <, <= ,
> >, >= or when the subquery is used as an expression."
> Which is weird, because according to the documentation and examples I
> inferred could use UPDATE with the use of IN in the condition and the
> subquery returining multiple rows. (sub-query works fine BTW)
> Any idea what is going on?
> Regards,
> Iwan
Your subquery returns multiple rows so change it to return some
aggregation of site.rid.
like
UPDATE Site
SET Active = 0
WHERE
RID IN (SELECT max(site.RID) AS site_rid
FROM Site INNER JOIN
ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
Manager m ON ms.ManagerID = m.RID
WHERE (am.UserName = 'iwk1004') AND
(ms.isPrimaryUser = 1))
Regards
Amish Shah
http://shahamishm.tripod.com|||Not tested this at all - just an idea
UPDATE Site
SET Active = 0
FROM
(
SELECT site.RID AS site_rid
FROM Site INNER JOIN
ManagerSite ms ON site.RID = ms.ArtistSiteID INNER
JOIN
Manager m ON ms.ManagerID = m.RID
WHERE (am.UserName = 'iwk1004') AND
(ms.isPrimaryUser = 1
) as tRes
WHERE tRes.site_rid = site.RID
/* You could remove site table from the correlated subquery tRes all
together becuase it actually isn't needed and just join
tREs.ArtistSiteID = site.RID */
Or try your original subquery with EXISTS clause rather than IN|||I agree that the message makes no sense with the code shown, since
multiple values are expected after an IN.
This could be written with an EXISTS test using a correlated subquery,
rather than an IN.
UPDATE Site
SET Active = 0
WHERE EXISTS
(SELECT *
FROM ManagerSite ms
JOIN Manager m
ON ms.ManagerID = m.RID
WHERE site.RID = ms.ArtistSiteID
AND am.UserName = 'iwk1004'
AND ms.isPrimaryUser = 1)
Roy Harvey
Beacon Falls, CT
On 7 Aug 2006 03:07:06 -0700, "iwanvanderkleijn@.gmail.com"
<iwanvanderkleijn@.gmail.com> wrote:
>Hi there,
>I try to run the following update statement on MS SQL Server 2000 SP4
>UPDATE Site
>SET Active = 0
> WHERE
> RID IN (SELECT site.RID AS site_rid
> FROM Site INNER JOIN
> ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
> Manager m ON ms.ManagerID = m.RID
> WHERE (am.UserName = 'iwk1004') AND
>(ms.isPrimaryUser = 1))
>Running this query I get the message "Subquery returned more than 1
>value. This is not permitted when the subquery follows =, !=, <, <= ,
>>, >= or when the subquery is used as an expression."
>Which is weird, because according to the documentation and examples I
>inferred could use UPDATE with the use of IN in the condition and the
>subquery returining multiple rows. (sub-query works fine BTW)
>Any idea what is going on?
>Regards,
>Iwan|||I'm confused about what the [am.] alias is referring to.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
<iwanvanderkleijn@.gmail.com> wrote in message
news:1154945225.949531.95440@.i42g2000cwa.googlegroups.com...
> Hi there,
> I try to run the following update statement on MS SQL Server 2000 SP4
> UPDATE Site
> SET Active = 0
> WHERE
> RID IN (SELECT site.RID AS site_rid
> FROM Site INNER JOIN
> ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
> Manager m ON ms.ManagerID = m.RID
> WHERE (am.UserName = 'iwk1004') AND
> (ms.isPrimaryUser = 1))
> Running this query I get the message "Subquery returned more than 1
> value. This is not permitted when the subquery follows =, !=, <, <= ,
>>, >= or when the subquery is used as an expression."
> Which is weird, because according to the documentation and examples I
> inferred could use UPDATE with the use of IN in the condition and the
> subquery returining multiple rows. (sub-query works fine BTW)
> Any idea what is going on?
> Regards,
> Iwan
>|||Arnie Rowland wrote:
> I'm confused about what the [am.] alias is referring to.
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> <iwanvanderkleijn@.gmail.com> wrote in message
> news:1154945225.949531.95440@.i42g2000cwa.googlegroups.com...
> > Hi there,
> >
> > I try to run the following update statement on MS SQL Server 2000 SP4
> >
> > UPDATE Site
> >
> > SET Active = 0
> >
> > WHERE
> > RID IN (SELECT site.RID AS site_rid
> > FROM Site INNER JOIN
> > ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
> > Manager m ON ms.ManagerID = m.RID
> > WHERE (am.UserName = 'iwk1004') AND
> > (ms.isPrimaryUser = 1))
> >
> > Running this query I get the message "Subquery returned more than 1
> > value. This is not permitted when the subquery follows =, !=, <, <= ,
> >>, >= or when the subquery is used as an expression."
> >
> > Which is weird, because according to the documentation and examples I
> > inferred could use UPDATE with the use of IN in the condition and the
> > subquery returining multiple rows. (sub-query works fine BTW)
> >
> > Any idea what is going on?
> >
> > Regards,
> >
> > Iwan
> >
I misunderstand the prob.
Your query looks ok but am is not referencing any table
Regards
Amish Shah|||I think it is confused over what "Site" referance you are trying to
update because it is name twice. Try the following pattern (tables
from Northwind) where you alias the update table.
update o
set o.quantity = 1
from [Order Details] o
where o.OrderId in
(select [Order Details].OrderID
from [Order Details]
inner join dbo.Orders
on [Order Details].Orderid = Orders.OrderID )
JJ
Showing posts with label rid. Show all posts
Showing posts with label rid. Show all posts
Sunday, March 11, 2012
Cannot use subquery in UPDATE statement?
Hi there,
I try to run the following update statement on MS SQL Server 2000 SP4
UPDATE Site
SET Active = 0
WHERE
RID IN (SELECT site.RID AS site_rid
FROM Site INNER JOIN
ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
Manager m ON ms.ManagerID = m.RID
WHERE (am.UserName = 'iwk1004') AND
(ms.isPrimaryUser = 1))
Running this query I get the message "Subquery returned more than 1
value. This is not permitted when the subquery follows =, !=, <, <= ,
>, >= or when the subquery is used as an expression."
Which is weird, because according to the documentation and examples I
inferred could use UPDATE with the use of IN in the condition and the
subquery returining multiple rows. (sub-query works fine BTW)
Any idea what is going on?
Regards,
Iwaniwanvanderkleijn@.gmail.com wrote:
> Hi there,
> I try to run the following update statement on MS SQL Server 2000 SP4
> UPDATE Site
> SET Active = 0
> WHERE
> RID IN (SELECT site.RID AS site_rid
> FROM Site INNER JOIN
> ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
> Manager m ON ms.ManagerID = m.RID
> WHERE (am.UserName = 'iwk1004') AND
> (ms.isPrimaryUser = 1))
> Running this query I get the message "Subquery returned more than 1
> value. This is not permitted when the subquery follows =, !=, <, <= ,
> Which is weird, because according to the documentation and examples I
> inferred could use UPDATE with the use of IN in the condition and the
> subquery returining multiple rows. (sub-query works fine BTW)
> Any idea what is going on?
> Regards,
> Iwan
Your subquery returns multiple rows so change it to return some
aggregation of site.rid.
like
UPDATE Site
SET Active = 0
WHERE
RID IN (SELECT max(site.RID) AS site_rid
FROM Site INNER JOIN
ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
Manager m ON ms.ManagerID = m.RID
WHERE (am.UserName = 'iwk1004') AND
(ms.isPrimaryUser = 1))
Regards
Amish Shah
http://shahamishm.tripod.com|||Not tested this at all - just an idea
UPDATE Site
SET Active = 0
FROM
(
SELECT site.RID AS site_rid
FROM Site INNER JOIN
ManagerSite ms ON site.RID = ms.ArtistSiteID INNER
JOIN
Manager m ON ms.ManagerID = m.RID
WHERE (am.UserName = 'iwk1004') AND
(ms.isPrimaryUser = 1
) as tRes
WHERE tRes.site_rid = site.RID
/* You could remove site table from the correlated subquery tRes all
together becuase it actually isn't needed and just join
tREs.ArtistSiteID = site.RID */
Or try your original subquery with EXISTS clause rather than IN|||I agree that the message makes no sense with the code shown, since
multiple values are expected after an IN.
This could be written with an EXISTS test using a correlated subquery,
rather than an IN.
UPDATE Site
SET Active = 0
WHERE EXISTS
(SELECT *
FROM ManagerSite ms
JOIN Manager m
ON ms.ManagerID = m.RID
WHERE site.RID = ms.ArtistSiteID
AND am.UserName = 'iwk1004'
AND ms.isPrimaryUser = 1)
Roy Harvey
Beacon Falls, CT
On 7 Aug 2006 03:07:06 -0700, "iwanvanderkleijn@.gmail.com"
<iwanvanderkleijn@.gmail.com> wrote:
>Hi there,
>I try to run the following update statement on MS SQL Server 2000 SP4
>UPDATE Site
>SET Active = 0
> WHERE
> RID IN (SELECT site.RID AS site_rid
> FROM Site INNER JOIN
> ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
> Manager m ON ms.ManagerID = m.RID
> WHERE (am.UserName = 'iwk1004') AND
>(ms.isPrimaryUser = 1))
>Running this query I get the message "Subquery returned more than 1
>value. This is not permitted when the subquery follows =, !=, <, <= ,
>Which is weird, because according to the documentation and examples I
>inferred could use UPDATE with the use of IN in the condition and the
>subquery returining multiple rows. (sub-query works fine BTW)
>Any idea what is going on?
>Regards,
>Iwan|||I'm confused about what the [am.] alias is referring to.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
<iwanvanderkleijn@.gmail.com> wrote in message
news:1154945225.949531.95440@.i42g2000cwa.googlegroups.com...
> Hi there,
> I try to run the following update statement on MS SQL Server 2000 SP4
> UPDATE Site
> SET Active = 0
> WHERE
> RID IN (SELECT site.RID AS site_rid
> FROM Site INNER JOIN
> ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
> Manager m ON ms.ManagerID = m.RID
> WHERE (am.UserName = 'iwk1004') AND
> (ms.isPrimaryUser = 1))
> Running this query I get the message "Subquery returned more than 1
> value. This is not permitted when the subquery follows =, !=, <, <= ,
> Which is weird, because according to the documentation and examples I
> inferred could use UPDATE with the use of IN in the condition and the
> subquery returining multiple rows. (sub-query works fine BTW)
> Any idea what is going on?
> Regards,
> Iwan
>|||Arnie Rowland wrote:
[vbcol=seagreen]
> I'm confused about what the [am.] alias is referring to.
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> <iwanvanderkleijn@.gmail.com> wrote in message
> news:1154945225.949531.95440@.i42g2000cwa.googlegroups.com...
I misunderstand the prob.
Your query looks ok but am is not referencing any table
Regards
Amish Shah|||I think it is confused over what "Site" referance you are trying to
update because it is name twice. Try the following pattern (tables
from Northwind) where you alias the update table.
update o
set o.quantity = 1
from [Order Details] o
where o.OrderId in
(select [Order Details].OrderID
from [Order Details]
inner join dbo.Orders
on [Order Details].Orderid = Orders.OrderID )
JJ
I try to run the following update statement on MS SQL Server 2000 SP4
UPDATE Site
SET Active = 0
WHERE
RID IN (SELECT site.RID AS site_rid
FROM Site INNER JOIN
ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
Manager m ON ms.ManagerID = m.RID
WHERE (am.UserName = 'iwk1004') AND
(ms.isPrimaryUser = 1))
Running this query I get the message "Subquery returned more than 1
value. This is not permitted when the subquery follows =, !=, <, <= ,
>, >= or when the subquery is used as an expression."
Which is weird, because according to the documentation and examples I
inferred could use UPDATE with the use of IN in the condition and the
subquery returining multiple rows. (sub-query works fine BTW)
Any idea what is going on?
Regards,
Iwaniwanvanderkleijn@.gmail.com wrote:
> Hi there,
> I try to run the following update statement on MS SQL Server 2000 SP4
> UPDATE Site
> SET Active = 0
> WHERE
> RID IN (SELECT site.RID AS site_rid
> FROM Site INNER JOIN
> ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
> Manager m ON ms.ManagerID = m.RID
> WHERE (am.UserName = 'iwk1004') AND
> (ms.isPrimaryUser = 1))
> Running this query I get the message "Subquery returned more than 1
> value. This is not permitted when the subquery follows =, !=, <, <= ,
> Which is weird, because according to the documentation and examples I
> inferred could use UPDATE with the use of IN in the condition and the
> subquery returining multiple rows. (sub-query works fine BTW)
> Any idea what is going on?
> Regards,
> Iwan
Your subquery returns multiple rows so change it to return some
aggregation of site.rid.
like
UPDATE Site
SET Active = 0
WHERE
RID IN (SELECT max(site.RID) AS site_rid
FROM Site INNER JOIN
ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
Manager m ON ms.ManagerID = m.RID
WHERE (am.UserName = 'iwk1004') AND
(ms.isPrimaryUser = 1))
Regards
Amish Shah
http://shahamishm.tripod.com|||Not tested this at all - just an idea
UPDATE Site
SET Active = 0
FROM
(
SELECT site.RID AS site_rid
FROM Site INNER JOIN
ManagerSite ms ON site.RID = ms.ArtistSiteID INNER
JOIN
Manager m ON ms.ManagerID = m.RID
WHERE (am.UserName = 'iwk1004') AND
(ms.isPrimaryUser = 1
) as tRes
WHERE tRes.site_rid = site.RID
/* You could remove site table from the correlated subquery tRes all
together becuase it actually isn't needed and just join
tREs.ArtistSiteID = site.RID */
Or try your original subquery with EXISTS clause rather than IN|||I agree that the message makes no sense with the code shown, since
multiple values are expected after an IN.
This could be written with an EXISTS test using a correlated subquery,
rather than an IN.
UPDATE Site
SET Active = 0
WHERE EXISTS
(SELECT *
FROM ManagerSite ms
JOIN Manager m
ON ms.ManagerID = m.RID
WHERE site.RID = ms.ArtistSiteID
AND am.UserName = 'iwk1004'
AND ms.isPrimaryUser = 1)
Roy Harvey
Beacon Falls, CT
On 7 Aug 2006 03:07:06 -0700, "iwanvanderkleijn@.gmail.com"
<iwanvanderkleijn@.gmail.com> wrote:
>Hi there,
>I try to run the following update statement on MS SQL Server 2000 SP4
>UPDATE Site
>SET Active = 0
> WHERE
> RID IN (SELECT site.RID AS site_rid
> FROM Site INNER JOIN
> ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
> Manager m ON ms.ManagerID = m.RID
> WHERE (am.UserName = 'iwk1004') AND
>(ms.isPrimaryUser = 1))
>Running this query I get the message "Subquery returned more than 1
>value. This is not permitted when the subquery follows =, !=, <, <= ,
>Which is weird, because according to the documentation and examples I
>inferred could use UPDATE with the use of IN in the condition and the
>subquery returining multiple rows. (sub-query works fine BTW)
>Any idea what is going on?
>Regards,
>Iwan|||I'm confused about what the [am.] alias is referring to.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
<iwanvanderkleijn@.gmail.com> wrote in message
news:1154945225.949531.95440@.i42g2000cwa.googlegroups.com...
> Hi there,
> I try to run the following update statement on MS SQL Server 2000 SP4
> UPDATE Site
> SET Active = 0
> WHERE
> RID IN (SELECT site.RID AS site_rid
> FROM Site INNER JOIN
> ManagerSite ms ON site.RID = ms.ArtistSiteID INNER JOIN
> Manager m ON ms.ManagerID = m.RID
> WHERE (am.UserName = 'iwk1004') AND
> (ms.isPrimaryUser = 1))
> Running this query I get the message "Subquery returned more than 1
> value. This is not permitted when the subquery follows =, !=, <, <= ,
> Which is weird, because according to the documentation and examples I
> inferred could use UPDATE with the use of IN in the condition and the
> subquery returining multiple rows. (sub-query works fine BTW)
> Any idea what is going on?
> Regards,
> Iwan
>|||Arnie Rowland wrote:
[vbcol=seagreen]
> I'm confused about what the [am.] alias is referring to.
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> <iwanvanderkleijn@.gmail.com> wrote in message
> news:1154945225.949531.95440@.i42g2000cwa.googlegroups.com...
I misunderstand the prob.
Your query looks ok but am is not referencing any table
Regards
Amish Shah|||I think it is confused over what "Site" referance you are trying to
update because it is name twice. Try the following pattern (tables
from Northwind) where you alias the update table.
update o
set o.quantity = 1
from [Order Details] o
where o.OrderId in
(select [Order Details].OrderID
from [Order Details]
inner join dbo.Orders
on [Order Details].Orderid = Orders.OrderID )
JJ
Friday, February 24, 2012
Cannot Shrink Database
All,
We have a data modeling group in here that can grow databases to 150Gb or
200Gb.
When they have run a scenario they will get rid of lots of the data and ask
me to shrink the database for them. This usually works no problem.
Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, but
when I shrink with a 10% free space option nothing happens to the size.
I am a bit hazy about the details but is it something to do with where data
gets written to?
Any ideas on how to get around this problem would be very welcome.
Thanks In AdvanceVerify that the tranlog has been backed up recently and then run
CHECKPOINT against the database. This will force all of the dirty and
log pages that haven't been written to get written. Most likely there
is a dirty page preventing the database from shrinking any further than
it has.
HTH
Jason|||Is if the ldf file which is big? If so, I have some info in below article (approx middle of article)
regarding shrinking of tlog files:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"MANCPOLYMAN" <MANCPOLYMAN@.discussions.microsoft.com> wrote in message
news:DFC25D21-F281-4A2C-9C21-920500732936@.microsoft.com...
> All,
> We have a data modeling group in here that can grow databases to 150Gb or
> 200Gb.
> When they have run a scenario they will get rid of lots of the data and ask
> me to shrink the database for them. This usually works no problem.
> Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, but
> when I shrink with a 10% free space option nothing happens to the size.
> I am a bit hazy about the details but is it something to do with where data
> gets written to?
> Any ideas on how to get around this problem would be very welcome.
> Thanks In Advance
>|||Jason,
Thanks for the info. Appreciate the help.
"j strate" wrote:
> Verify that the tranlog has been backed up recently and then run
> CHECKPOINT against the database. This will force all of the dirty and
> log pages that haven't been written to get written. Most likely there
> is a dirty page preventing the database from shrinking any further than
> it has.
> HTH
> Jason
>
We have a data modeling group in here that can grow databases to 150Gb or
200Gb.
When they have run a scenario they will get rid of lots of the data and ask
me to shrink the database for them. This usually works no problem.
Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, but
when I shrink with a 10% free space option nothing happens to the size.
I am a bit hazy about the details but is it something to do with where data
gets written to?
Any ideas on how to get around this problem would be very welcome.
Thanks In AdvanceVerify that the tranlog has been backed up recently and then run
CHECKPOINT against the database. This will force all of the dirty and
log pages that haven't been written to get written. Most likely there
is a dirty page preventing the database from shrinking any further than
it has.
HTH
Jason|||Is if the ldf file which is big? If so, I have some info in below article (approx middle of article)
regarding shrinking of tlog files:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"MANCPOLYMAN" <MANCPOLYMAN@.discussions.microsoft.com> wrote in message
news:DFC25D21-F281-4A2C-9C21-920500732936@.microsoft.com...
> All,
> We have a data modeling group in here that can grow databases to 150Gb or
> 200Gb.
> When they have run a scenario they will get rid of lots of the data and ask
> me to shrink the database for them. This usually works no problem.
> Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, but
> when I shrink with a 10% free space option nothing happens to the size.
> I am a bit hazy about the details but is it something to do with where data
> gets written to?
> Any ideas on how to get around this problem would be very welcome.
> Thanks In Advance
>|||Jason,
Thanks for the info. Appreciate the help.
"j strate" wrote:
> Verify that the tranlog has been backed up recently and then run
> CHECKPOINT against the database. This will force all of the dirty and
> log pages that haven't been written to get written. Most likely there
> is a dirty page preventing the database from shrinking any further than
> it has.
> HTH
> Jason
>
Cannot Shrink Database
All,
We have a data modeling group in here that can grow databases to 150Gb or
200Gb.
When they have run a scenario they will get rid of lots of the data and ask
me to shrink the database for them. This usually works no problem.
Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, but
when I shrink with a 10% free space option nothing happens to the size.
I am a bit hazy about the details but is it something to do with where data
gets written to?
Any ideas on how to get around this problem would be very welcome.
Thanks In Advance
Verify that the tranlog has been backed up recently and then run
CHECKPOINT against the database. This will force all of the dirty and
log pages that haven't been written to get written. Most likely there
is a dirty page preventing the database from shrinking any further than
it has.
HTH
Jason
|||Is if the ldf file which is big? If so, I have some info in below article (approx middle of article)
regarding shrinking of tlog files:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"MANCPOLYMAN" <MANCPOLYMAN@.discussions.microsoft.com> wrote in message
news:DFC25D21-F281-4A2C-9C21-920500732936@.microsoft.com...
> All,
> We have a data modeling group in here that can grow databases to 150Gb or
> 200Gb.
> When they have run a scenario they will get rid of lots of the data and ask
> me to shrink the database for them. This usually works no problem.
> Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, but
> when I shrink with a 10% free space option nothing happens to the size.
> I am a bit hazy about the details but is it something to do with where data
> gets written to?
> Any ideas on how to get around this problem would be very welcome.
> Thanks In Advance
>
|||Jason,
Thanks for the info. Appreciate the help.
"j strate" wrote:
> Verify that the tranlog has been backed up recently and then run
> CHECKPOINT against the database. This will force all of the dirty and
> log pages that haven't been written to get written. Most likely there
> is a dirty page preventing the database from shrinking any further than
> it has.
> HTH
> Jason
>
We have a data modeling group in here that can grow databases to 150Gb or
200Gb.
When they have run a scenario they will get rid of lots of the data and ask
me to shrink the database for them. This usually works no problem.
Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, but
when I shrink with a 10% free space option nothing happens to the size.
I am a bit hazy about the details but is it something to do with where data
gets written to?
Any ideas on how to get around this problem would be very welcome.
Thanks In Advance
Verify that the tranlog has been backed up recently and then run
CHECKPOINT against the database. This will force all of the dirty and
log pages that haven't been written to get written. Most likely there
is a dirty page preventing the database from shrinking any further than
it has.
HTH
Jason
|||Is if the ldf file which is big? If so, I have some info in below article (approx middle of article)
regarding shrinking of tlog files:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"MANCPOLYMAN" <MANCPOLYMAN@.discussions.microsoft.com> wrote in message
news:DFC25D21-F281-4A2C-9C21-920500732936@.microsoft.com...
> All,
> We have a data modeling group in here that can grow databases to 150Gb or
> 200Gb.
> When they have run a scenario they will get rid of lots of the data and ask
> me to shrink the database for them. This usually works no problem.
> Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, but
> when I shrink with a 10% free space option nothing happens to the size.
> I am a bit hazy about the details but is it something to do with where data
> gets written to?
> Any ideas on how to get around this problem would be very welcome.
> Thanks In Advance
>
|||Jason,
Thanks for the info. Appreciate the help.
"j strate" wrote:
> Verify that the tranlog has been backed up recently and then run
> CHECKPOINT against the database. This will force all of the dirty and
> log pages that haven't been written to get written. Most likely there
> is a dirty page preventing the database from shrinking any further than
> it has.
> HTH
> Jason
>
Cannot Shrink Database
All,
We have a data modeling group in here that can grow databases to 150Gb or
200Gb.
When they have run a scenario they will get rid of lots of the data and ask
me to shrink the database for them. This usually works no problem.
Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, but
when I shrink with a 10% free space option nothing happens to the size.
I am a bit hazy about the details but is it something to do with where data
gets written to?
Any ideas on how to get around this problem would be very welcome.
Thanks In AdvanceVerify that the tranlog has been backed up recently and then run
CHECKPOINT against the database. This will force all of the dirty and
log pages that haven't been written to get written. Most likely there
is a dirty page preventing the database from shrinking any further than
it has.
HTH
Jason|||Is if the ldf file which is big? If so, I have some info in below article (a
pprox middle of article)
regarding shrinking of tlog files:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"MANCPOLYMAN" <MANCPOLYMAN@.discussions.microsoft.com> wrote in message
news:DFC25D21-F281-4A2C-9C21-920500732936@.microsoft.com...
> All,
> We have a data modeling group in here that can grow databases to 150Gb or
> 200Gb.
> When they have run a scenario they will get rid of lots of the data and as
k
> me to shrink the database for them. This usually works no problem.
> Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, b
ut
> when I shrink with a 10% free space option nothing happens to the size.
> I am a bit hazy about the details but is it something to do with where dat
a
> gets written to?
> Any ideas on how to get around this problem would be very welcome.
> Thanks In Advance
>|||Jason,
Thanks for the info. Appreciate the help.
"j strate" wrote:
> Verify that the tranlog has been backed up recently and then run
> CHECKPOINT against the database. This will force all of the dirty and
> log pages that haven't been written to get written. Most likely there
> is a dirty page preventing the database from shrinking any further than
> it has.
> HTH
> Jason
>
We have a data modeling group in here that can grow databases to 150Gb or
200Gb.
When they have run a scenario they will get rid of lots of the data and ask
me to shrink the database for them. This usually works no problem.
Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, but
when I shrink with a 10% free space option nothing happens to the size.
I am a bit hazy about the details but is it something to do with where data
gets written to?
Any ideas on how to get around this problem would be very welcome.
Thanks In AdvanceVerify that the tranlog has been backed up recently and then run
CHECKPOINT against the database. This will force all of the dirty and
log pages that haven't been written to get written. Most likely there
is a dirty page preventing the database from shrinking any further than
it has.
HTH
Jason|||Is if the ldf file which is big? If so, I have some info in below article (a
pprox middle of article)
regarding shrinking of tlog files:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"MANCPOLYMAN" <MANCPOLYMAN@.discussions.microsoft.com> wrote in message
news:DFC25D21-F281-4A2C-9C21-920500732936@.microsoft.com...
> All,
> We have a data modeling group in here that can grow databases to 150Gb or
> 200Gb.
> When they have run a scenario they will get rid of lots of the data and as
k
> me to shrink the database for them. This usually works no problem.
> Today I have 2 databases they want to shrink, both have 85 - 90 Gb free, b
ut
> when I shrink with a 10% free space option nothing happens to the size.
> I am a bit hazy about the details but is it something to do with where dat
a
> gets written to?
> Any ideas on how to get around this problem would be very welcome.
> Thanks In Advance
>|||Jason,
Thanks for the info. Appreciate the help.
"j strate" wrote:
> Verify that the tranlog has been backed up recently and then run
> CHECKPOINT against the database. This will force all of the dirty and
> log pages that haven't been written to get written. Most likely there
> is a dirty page preventing the database from shrinking any further than
> it has.
> HTH
> Jason
>
Subscribe to:
Posts (Atom)