Showing posts with label level. Show all posts
Showing posts with label level. Show all posts

Thursday, March 29, 2012

Changing the text for the Document Map top level node

Can anyone tell me if it is possible to change the text on the top node of the Document Map? I was looking for a property in the Visual Studio designer or a property I could set programmatically but I couldn't find either.

The text on the top node is the file name of my Microsoft report. That is, the report file name isSalesRepOrderDetail.rdlc and the Document Map top node text isSalesRepOrderDetail. It looks pretty unpolished.

Thanks!

Black Cat Bone

I found it. In designer, expand theLocalReport property for the report viewer control and assign a string to theDisplayName property. This becomes the text on the Document Map's top node.

The code equivalent is: ReportViewer1.LocalReport.DisplayName = "Top Node Text";

|||

Thank,

How can I bring the DisplayName into the report, for example I want to show

the DisplayName in the footer of the report too.

Thursday, March 22, 2012

changing the compatibility level

Hi

I am migrating from sql server 2000 to sql server 2005.

When i do back up and Restore of the databases the compatibility level remains 80 (2000).

my concern is

1) should i change the compatibility level to 90 (2005)

2) Am i missing out any thing if i dont change the compatibility level

3) What are the issues that can come up if changed to 90 (2005)

Please reply .I am in a fix

Thanks in advance

If you still have the original SQL 2000 server/database, don't kill it yet

Run the SQL 2005 Upgrade Advisor on it and it'll give you a list of "errors", and "warnings" if you upgrade to 2005 (Errors are must-fix)

You can decide for yourself if # of errors is huge enough to keep the new DB in 80 mode; if not I suggest 90 mode (we did that, don't require restart either)

But honestly, I can only believe MS' words on that SQL2005 IS BETTER, as I don't have any benchmark comparison

Top 30 features of SQL 2005

http://www.microsoft.com/sql/prodinfo/features/top30features.mspx

sql

Changing the collation

Dear gurus,
I am pursuing for a statement or function which allow me change the
collation at database level.
Thanks in advance and regards,
Enrichi enric,
I think you can change collation on database level using "alter database
collate command "
ALTER DATABASE database
{ ADD FILE < filespec > [ ,...n ] [ TO FILEGROUP filegroup_name ]
| ADD LOG FILE < filespec > [ ,...n ]
| REMOVE FILE logical_file_name
| ADD FILEGROUP filegroup_name
| REMOVE FILEGROUP filegroup_name
| MODIFY FILE < filespec >
| MODIFY NAME = new_dbname
| MODIFY FILEGROUP filegroup_name {filegroup_property | NAME =
new_filegroup_name }
| SET < optionspec > [ ,...n ] [ WITH < termination > ]
| COLLATE < collation_name >
}
thanks,
Jose de Jesus Jr. Mcp,Mcdba
MCP #2324787
"Enric" wrote:

> Dear gurus,
> I am pursuing for a statement or function which allow me change the
> collation at database level.
> Thanks in advance and regards,
> Enric|||Yes, but that will not change collation for the existing tables. For that, y
ou need to do ALTER
TABLE ... ALTER COLUMN for each table and each column in the database. And i
t also require you to
drop indexes (and probably a few more things). Not fun...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jose G. de Jesus Jr MCP, MCDBA" <Email me> wrote in message
news:2CA8C84A-C24A-4F58-8860-4C3F3D454037@.microsoft.com...
> hi enric,
> I think you can change collation on database level using "alter database
> collate command "
>
> ALTER DATABASE database
> { ADD FILE < filespec > [ ,...n ] [ TO FILEGROUP filegroup_name ]
> | ADD LOG FILE < filespec > [ ,...n ]
> | REMOVE FILE logical_file_name
> | ADD FILEGROUP filegroup_name
> | REMOVE FILEGROUP filegroup_name
> | MODIFY FILE < filespec >
> | MODIFY NAME = new_dbname
> | MODIFY FILEGROUP filegroup_name {filegroup_property | NAME =
> new_filegroup_name }
> | SET < optionspec > [ ,...n ] [ WITH < termination > ]
> | COLLATE < collation_name >
> }
> --
> thanks,
> --
> Jose de Jesus Jr. Mcp,Mcdba
> MCP #2324787
>
> "Enric" wrote:
>

Tuesday, March 20, 2012

changing sql server service account password

SQL Server 2000 running on W2K3 Advanced Server Cluster with 2 nodes.
We have a domain level account which the MSSQLSERVER and SQLSERVERAGENT
services use.
When I change the password for this account in active directory, I also
changed the password for the services in the Services properties on both
cluster nodes
The services Startup Type has to be Manual, or else the following error
occurs:
"17050: initerrlog: could not open error log file ... (the correct path
to the error log follows)"
The error log is on the shared drive of the cluster.
Also, when the servers boot up, the following error is in Event Viewer:
"The Data portion of event 19002 from MSSQLServer is invalid"
Microsoft (Q230393) says this is a bug and ignore it, but it didn't occur
until I changed the password.
Are these normal consequences of changing the account password?
Are there other steps I should take?
Thanks
Bill
Go back into Enterprise Manager and change the service accounts there. That
will fix any permissions and setup issues. Service startup type as Manual
is correct. That allows the cluster service to control the actual service
start/stop.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
"bill" <belgie@.datamti.com> wrote in message
news:uOYfAolLFHA.904@.tk2msftngp13.phx.gbl...
> SQL Server 2000 running on W2K3 Advanced Server Cluster with 2 nodes.
> We have a domain level account which the MSSQLSERVER and SQLSERVERAGENT
> services use.
> When I change the password for this account in active directory, I also
> changed the password for the services in the Services properties on both
> cluster nodes
> The services Startup Type has to be Manual, or else the following error
> occurs:
> "17050: initerrlog: could not open error log file ... (the correct path
> to the error log follows)"
> The error log is on the shared drive of the cluster.
> Also, when the servers boot up, the following error is in Event Viewer:
> "The Data portion of event 19002 from MSSQLServer is invalid"
> Microsoft (Q230393) says this is a bug and ignore it, but it didn't occur
> until I changed the password.
> Are these normal consequences of changing the account password?
> Are there other steps I should take?
> Thanks
> Bill
>
>

Sunday, March 11, 2012

changing set option to on from default server level setting

What are some things to watch out for if we change the default settings from
off to on for certain set options.
For eg: if i turn the set aritabort on at a server level, what are the cons
?
> For eg: if i turn the set aritabort on at a server level, what are the cons
That applications that relies on the old default behavior doesn't work correctly anymore. Always set
the setting in your app, and leave the defaults as is.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jamie" <jamesw@.hotmail.com> wrote in message news:etw6jze1FHA.164@.TK2MSFTNGP10.phx.gbl...
> What are some things to watch out for if we change the default settings from off to on for certain
> set options.
> For eg: if i turn the set aritabort on at a server level, what are the cons ?
>

changing set option to on from default server level setting

What are some things to watch out for if we change the default settings from
off to on for certain set options.
For eg: if i turn the set aritabort on at a server level, what are the cons
?> For eg: if i turn the set aritabort on at a server level, what are the cons
That applications that relies on the old default behavior doesn't work correctly anymore. Always set
the setting in your app, and leave the defaults as is.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jamie" <jamesw@.hotmail.com> wrote in message news:etw6jze1FHA.164@.TK2MSFTNGP10.phx.gbl...
> What are some things to watch out for if we change the default settings from off to on for certain
> set options.
> For eg: if i turn the set aritabort on at a server level, what are the cons ?
>

changing set option to on from default server level setting

What are some things to watch out for if we change the default settings from
off to on for certain set options.
For eg: if i turn the set aritabort on at a server level, what are the cons
?> For eg: if i turn the set aritabort on at a server level, what are the con
s
That applications that relies on the old default behavior doesn't work corre
ctly anymore. Always set
the setting in your app, and leave the defaults as is.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jamie" <jamesw@.hotmail.com> wrote in message news:etw6jze1FHA.164@.TK2MSFTNGP10.phx.gbl...[v
bcol=seagreen]
> What are some things to watch out for if we change the default settings fr
om off to on for certain
> set options.
> For eg: if i turn the set aritabort on at a server level, what are the con
s ?
>[/vbcol]

Saturday, February 25, 2012

Changing NULL, to NOT NULL

SQL Server 2005
When I run the command:
alter table FileRepository alter column parentID int not null
I get the message:
Msg 5074, Level 16, State 1, Line 1
The index 'IX_FileRepository' is dependent on column 'parentID'.
Msg 5074, Level 16, State 1, Line 1
The statistics '_dta_stat_191339746_1_12_11_2' is dependent on column
'parentID'.
Msg 4922, Level 16, State 9, Line 1
ALTER TABLE ALTER COLUMN parentID failed because one or more objects access
this column.
No problem on the index as that is easy to drop and recreate. But what is
this stuff about statistics and how do I deal with it?
FWIW, I know just enough about 2000 to do my job, but diddle about 2005.You drop statistics in the same way that you drop indexes. Typically, you
don't have both statistics and indexes on the same column - except, say, if
you have an index on a single column and statistics on a pair of columns,
and vice-versa. In your case, it looks like the Database Tuning Advisor
recommended the stats and the DBA running the DTA allowed them to be built.
You'll have to run:
DROP STATISTICS FileRepository ._dta_stat_191339746_1_12_11_2
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"JayKon" <JayKon@.discussions.microsoft.com> wrote in message
news:C172210B-9AF9-438D-AB31-58B55DFC5367@.microsoft.com...
SQL Server 2005
When I run the command:
alter table FileRepository alter column parentID int not null
I get the message:
Msg 5074, Level 16, State 1, Line 1
The index 'IX_FileRepository' is dependent on column 'parentID'.
Msg 5074, Level 16, State 1, Line 1
The statistics '_dta_stat_191339746_1_12_11_2' is dependent on column
'parentID'.
Msg 4922, Level 16, State 9, Line 1
ALTER TABLE ALTER COLUMN parentID failed because one or more objects access
this column.
No problem on the index as that is easy to drop and recreate. But what is
this stuff about statistics and how do I deal with it?
FWIW, I know just enough about 2000 to do my job, but diddle about 2005.|||Thank you sir.
After having a further conversation, it seems they have tried the alter
already and it ran for several hours before timing out ( a very large table).
This implies to me that it is doing a table rebuild, even though all data in
that column is already NOT NULL and only the DDL needs to be changed.
Am I probably right here? Can we make this type of change without it taking
more than a few seconds to do the alter?
"Tom Moreau" wrote:
> You drop statistics in the same way that you drop indexes. Typically, you
> don't have both statistics and indexes on the same column - except, say, if
> you have an index on a single column and statistics on a pair of columns,
> and vice-versa. In your case, it looks like the Database Tuning Advisor
> recommended the stats and the DBA running the DTA allowed them to be built.
> You'll have to run:
> DROP STATISTICS FileRepository ._dta_stat_191339746_1_12_11_2
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "JayKon" <JayKon@.discussions.microsoft.com> wrote in message
> news:C172210B-9AF9-438D-AB31-58B55DFC5367@.microsoft.com...
> SQL Server 2005
> When I run the command:
> alter table FileRepository alter column parentID int not null
> I get the message:
> Msg 5074, Level 16, State 1, Line 1
> The index 'IX_FileRepository' is dependent on column 'parentID'.
> Msg 5074, Level 16, State 1, Line 1
> The statistics '_dta_stat_191339746_1_12_11_2' is dependent on column
> 'parentID'.
> Msg 4922, Level 16, State 9, Line 1
> ALTER TABLE ALTER COLUMN parentID failed because one or more objects access
> this column.
>
> No problem on the index as that is easy to drop and recreate. But what is
> this stuff about statistics and how do I deal with it?
> FWIW, I know just enough about 2000 to do my job, but diddle about 2005.
>|||This is a multi-part message in MIME format.
--=_NextPart_000_0A6F_01C77871.851AEB80
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
Well, that's the issue. If you have a lot of data, it will take a long
time. Your log may fill up during that time. Ultimately, you may need to
create a new table, with the intended DDL. Then, you move the data in
chunks to the other table. Meanwhile, you create a partitioned view (with
the same name as the old table) that includes both tables. However, you
will need to add INSTEAD OF triggers for any INSERT/UPDATE/DELETE activity
that will occur during that time. Once all data have been moved, you can
drop the original table and view, renaming the new table.
The attached code has an example.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"JayKon" <JayKon@.discussions.microsoft.com> wrote in message
news:3E756320-3BA2-46CA-A2E6-9DBD404D83B4@.microsoft.com...
Thank you sir.
After having a further conversation, it seems they have tried the alter
already and it ran for several hours before timing out ( a very large
table).
This implies to me that it is doing a table rebuild, even though all data in
that column is already NOT NULL and only the DDL needs to be changed.
Am I probably right here? Can we make this type of change without it taking
more than a few seconds to do the alter?
"Tom Moreau" wrote:
> You drop statistics in the same way that you drop indexes. Typically, you
> don't have both statistics and indexes on the same column - except, say,
> if
> you have an index on a single column and statistics on a pair of columns,
> and vice-versa. In your case, it looks like the Database Tuning Advisor
> recommended the stats and the DBA running the DTA allowed them to be
> built.
> You'll have to run:
> DROP STATISTICS FileRepository ._dta_stat_191339746_1_12_11_2
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "JayKon" <JayKon@.discussions.microsoft.com> wrote in message
> news:C172210B-9AF9-438D-AB31-58B55DFC5367@.microsoft.com...
> SQL Server 2005
> When I run the command:
> alter table FileRepository alter column parentID int not null
> I get the message:
> Msg 5074, Level 16, State 1, Line 1
> The index 'IX_FileRepository' is dependent on column 'parentID'.
> Msg 5074, Level 16, State 1, Line 1
> The statistics '_dta_stat_191339746_1_12_11_2' is dependent on column
> 'parentID'.
> Msg 4922, Level 16, State 9, Line 1
> ALTER TABLE ALTER COLUMN parentID failed because one or more objects
> access
> this column.
>
> No problem on the index as that is easy to drop and recreate. But what is
> this stuff about statistics and how do I deal with it?
> FWIW, I know just enough about 2000 to do my job, but diddle about 2005.
>
--=_NextPart_000_0A6F_01C77871.851AEB80
Content-Type: text/plain;
name="Alter.sql"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Alter.sql"
-- Listing 1
create table dbo.t1
(
id int primary key nonclustered
, dt datetime not null
, junk varchar (20) not null
)
create clustered index C_t1 on dbo.t1 (dt)
create table dbo.t2
(
id int primary key nonclustered
, dt datetime not null
, junk varchar (20) not null
, other1 bit not null
default (0)
, other2 varchar (30) null
)
create clustered index C_t2 on dbo.t2 (dt)
create view dbo.t
as
select
id
, dt
, junk
from
dbo.t2
union all
select
id
, dt
, junk
from
dbo.t1
go
-- Listing 2
create table dbo.threshold
(
threshold datetime not null
)
insert dbo.threshold values ('1995-01-01')
go
-- Listing 3
create trigger tri_t on dbo.t instead of insert
as
insert dbo.t1 (id, dt, junk)
select id, dt, junk
from inserted
where dt >= (select threshold from dbo.threshold)
insert dbo.t2 (id, dt, junk)
select id, dt, junk
from inserted
where dt < (select threshold from dbo.threshold)
go
-- Listing 4
create trigger tru_t on dbo.t instead of update
as
if (update (dt))
begin
-- no crossing of threshold
update x
set
dt = i.dt
, junk = i.junk
from
inserted i
join deleted d on d.id = i.id
join dbo.t2 x on x.id = i.id
cross join
dbo.threshold z
where
i.dt < z.threshold
and d.dt < z.threshold
update x
set
dt = i.dt
, junk = i.junk
from
inserted i
join deleted d on d.id = i.id
join dbo.t1 x on x.id = i.id
cross join
dbo.threshold z
where
i.dt >= z.threshold
and d.dt >= z.threshold
-- threshold crossed
delete x
from
inserted i
join deleted d on d.id = i.id
join dbo.t2 x on x.id = i.id
cross join
dbo.threshold z
where
i.dt >= z.threshold
and d.dt < z.threshold
delete x
from
inserted i
join deleted d on d.id = i.id
join dbo.t1 x on x.id = i.id
cross join
dbo.threshold z
where
i.dt < z.threshold
and d.dt >= z.threshold
insert dbo.t1 (id, dt, junk)
select i.id, i.dt, i.junk
from
inserted i
join deleted d on d.id = i.id
cross join
dbo.threshold z
where
i.dt >= z.threshold
and d.dt < z.threshold
insert dbo.t2 (id, dt, junk)
select i.id, i.dt, i.junk
from
inserted i
join deleted d on d.id = i.id
cross join
dbo.threshold z
where
i.dt < z.threshold
and d.dt >= z.threshold
end
else
begin
update x
set
junk = i.junk
from
inserted i
join dbo.t1 x on x.id = i.id
where
i.dt >= (select threshold from dbo.threshold)
update x
set
junk = i.junk
from
inserted i
join dbo.t2 x on x.id = i.id
where
i.dt < (select threshold from dbo.threshold)
end
go
-- Listing 5
create trigger tru_t on dbo.t instead of delete
as
if @.@.ROWCOUNT = 0
return
delete x
from
deleted d
join dbo.t1 x on x.id = d.id
delete x
from
deleted d
join dbo.t2 x on x.id = d.id
go
-- populate the table
declare
@.year smallint
, @.month tinyint
, @.day tinyint
, @.id int
, @.date datetime
, @.icount int
, @.max int
select
@.year = 1995
, @.id = 1
while @.year < 2004
begin
set @.month = 1
while @.month <= 12
begin
set @.day = 1
while @.day <= case when @.month in (1, 3, 5, 7, 8, 10, 12) then 31
when @.month in (4, 6, 9, 11) then 30
when @.year % 4 = 0 then 29
else 28 end
begin
set @.date = cast (@.year as char (4))
+ replace (str (@.month, 2), ' ', '0')
+ replace (str (@.day, 2), ' ', '0')
select
@.max = rand () * 1000
, @.icount = 1
while @.icount <= @.max
begin
insert t1 (id, dt, junk)
values (@.id, @.date, replicate ('X', 20))
select
@.icount = @.icount + 1
, @.id = @.id + 1
end
set @.day = @.day + 1
end
set @.month = @.month + 1
end
set @.year = @.year + 1
end
go
-- Listing 6
-- migrate the data
declare
@.date datetime
, @.str varchar (8000)
select
@.date = min (dt)
from
t1
while @.date is not null and not datepart (hh, getdate()) between 8 and 18
begin
begin tran
update threshold
set
threshold = dateadd (dd, 1, @.date)
insert t2 (id, dt, junk)
select id, dt, junk
from t1
where dt = @.date
delete t1
where dt = @.date
commit tran
select
@.date = min (dt)
from
t1
end
/*
drop view t
drop table t1
drop table t2
drop table threshold
*/
--=_NextPart_000_0A6F_01C77871.851AEB80--|||> After having a further conversation, it seems they have tried the alter
> already and it ran for several hours before timing out ( a very large
> table).
> This implies to me that it is doing a table rebuild, even though all data
> in
> that column is already NOT NULL and only the DDL needs to be changed.
> Am I probably right here?
That depends, did they open Enterprise Manager and click around in the GUI
to make the change? By default, in most cases, when you click OK Enterprise
Manager will do exactly that behind your back: create a new table, move the
data over, drop the old table, rename the new table to the old name, etc.
No exactly pretty.
You should probably wait to attempt this during a maintenance window (e.g.
on a Sunday at midnight), and even enforce it with setting the database to
SINGLE_USER, and then you won't have to worry about blocking users, or being
blocked by users, or being slowed down by other activity in the database.
If it still takes too long, you may have to use Tom's solution, which is a
bit more complex but is certainly better than what Enterprise Manager tries
to do.|||> You should probably wait to attempt this
And by "this" I mean an ALTER statement in Query Analyzer, not clicking OK
to the change in Enterprise Manager.|||Yes, they tried to do it through the GUI.
"Aaron Bertrand [SQL Server MVP]" wrote:
> > After having a further conversation, it seems they have tried the alter
> > already and it ran for several hours before timing out ( a very large
> > table).
> > This implies to me that it is doing a table rebuild, even though all data
> > in
> > that column is already NOT NULL and only the DDL needs to be changed.
> >
> > Am I probably right here?
> That depends, did they open Enterprise Manager and click around in the GUI
> to make the change? By default, in most cases, when you click OK Enterprise
> Manager will do exactly that behind your back: create a new table, move the
> data over, drop the old table, rename the new table to the old name, etc.
> No exactly pretty.
> You should probably wait to attempt this during a maintenance window (e.g.
> on a Sunday at midnight), and even enforce it with setting the database to
> SINGLE_USER, and then you won't have to worry about blocking users, or being
> blocked by users, or being slowed down by other activity in the database.
> If it still takes too long, you may have to use Tom's solution, which is a
> bit more complex but is certainly better than what Enterprise Manager tries
> to do.
>
>|||At present, I'm on a dev server (our only 2005 box).
As it happens, the ALTER statement does see that it's a simple DDL change
and took a couple of seconds.
I'm releived that SQL Server is smart enough to do that.
Thank you very much.
"Aaron Bertrand [SQL Server MVP]" wrote:
> > After having a further conversation, it seems they have tried the alter
> > already and it ran for several hours before timing out ( a very large
> > table).
> > This implies to me that it is doing a table rebuild, even though all data
> > in
> > that column is already NOT NULL and only the DDL needs to be changed.
> >
> > Am I probably right here?
> That depends, did they open Enterprise Manager and click around in the GUI
> to make the change? By default, in most cases, when you click OK Enterprise
> Manager will do exactly that behind your back: create a new table, move the
> data over, drop the old table, rename the new table to the old name, etc.
> No exactly pretty.
> You should probably wait to attempt this during a maintenance window (e.g.
> on a Sunday at midnight), and even enforce it with setting the database to
> SINGLE_USER, and then you won't have to worry about blocking users, or being
> blocked by users, or being slowed down by other activity in the database.
> If it still takes too long, you may have to use Tom's solution, which is a
> bit more complex but is certainly better than what Enterprise Manager tries
> to do.
>
>

Friday, February 24, 2012

Changing Isolation Level.

Changing Isolation Level to Snapshot or Snapshot Read Commited resolve all problems from deadlock ?

thanks

Many deadlock problems are solved because snapshot isolation prevents readers from blocking writers and writers from blocking readers and that is the main cause of deadlocks. Note: Writers still block writers.|||

In general - yes: switching to the new isolation levels with non-blocking read access somewhat helps reducing the likelihood of deadlock, but would not completely eliminate them.

However, you should remember that if the application behavior implicitly depends on the blocking semantics of the old isolation levels as implemented in the SQL Engine, the application may stop working correctly when switching to the versioning-based concurrency model. Ideally you should carefully analyze all the transactions in your application and make sure that you don't rely on the subtleties of the implementation of the specific engine and only after that consider switching to the versioning-based transaction isolation.

You should also remember that when using the Snapshot Isolation level your application should also be able to cope with snapshot update conflicts. In other words in this case you trade some deadlocks with (hopefully much less frequent) update conflicts. But again, it all depends on your application.

Pleas also note that despite the Read Committed Snapshot Isolation the SQL Engine never causes update conflicts, it only uses the non-blocking read semantics when accessing tables that are not being updated by the DML statement (unlike the 'normal' snapshot isolation level where all the access to all the tables is truly non-blocking and the data locks necessary for the update/delete are only acquired after the records has been finally selected by the predicate).

Which means that in case of single-table predicated UPDATE/DELETE statements, you don't really enjoy the benefits of the non-blocking access when searching the records to be affected and if most of the deadlock in your application are caused by plain single-table UPDATE/DELETE statements. If so, wou will hardly see any improvements when switching to the Read Committed Snapshot IL from the blocking Read Committed IL.

Of course, the things will most likely improve when switching from Repeatable Read or Serilizable, but since in a multi-statement transaction the Read Committed Snapshot is in fact provides much weaker consistency guarantees compare to either of the above, you have to prove first that the application correctness will not suffer after the switch.

Changing Isolation Level.

Changing Isolation Level to Snapshot or Snapshot Read Commited resolve all problems from deadlock ?

thanks

Many deadlock problems are solved because snapshot isolation prevents readers from blocking writers and writers from blocking readers and that is the main cause of deadlocks. Note: Writers still block writers.|||

In general - yes: switching to the new isolation levels with non-blocking read access somewhat helps reducing the likelihood of deadlock, but would not completely eliminate them.

However, you should remember that if the application behavior implicitly depends on the blocking semantics of the old isolation levels as implemented in the SQL Engine, the application may stop working correctly when switching to the versioning-based concurrency model. Ideally you should carefully analyze all the transactions in your application and make sure that you don't rely on the subtleties of the implementation of the specific engine and only after that consider switching to the versioning-based transaction isolation.

You should also remember that when using the Snapshot Isolation level your application should also be able to cope with snapshot update conflicts. In other words in this case you trade some deadlocks with (hopefully much less frequent) update conflicts. But again, it all depends on your application.

Pleas also note that despite the Read Committed Snapshot Isolation the SQL Engine never causes update conflicts, it only uses the non-blocking read semantics when accessing tables that are not being updated by the DML statement (unlike the 'normal' snapshot isolation level where all the access to all the tables is truly non-blocking and the data locks necessary for the update/delete are only acquired after the records has been finally selected by the predicate).

Which means that in case of single-table predicated UPDATE/DELETE statements, you don't really enjoy the benefits of the non-blocking access when searching the records to be affected and if most of the deadlock in your application are caused by plain single-table UPDATE/DELETE statements. If so, wou will hardly see any improvements when switching to the Read Committed Snapshot IL from the blocking Read Committed IL.

Of course, the things will most likely improve when switching from Repeatable Read or Serilizable, but since in a multi-statement transaction the Read Committed Snapshot is in fact provides much weaker consistency guarantees compare to either of the above, you have to prove first that the application correctness will not suffer after the switch.

Friday, February 10, 2012

Changing database compatibility from 70 to 80

Hi all. I wanted to know if a database running on SQL Server 2000 SP3a
with a database compatibility level of 70 can be changed to 80 without
any problems. This is a database that was originally built with SQL
Server 7.0. I'm assuming that over time as the DB itself was moved to
SQL Server 2000, the compatibility level was never upgraded.
The reason that I want to change the compatibility level from 70 to 80
is because I need to use the LIKE statement in a table query. It turns
out the LIKE statement uses COLLATE behind the scenes, which is
specific to 80.
Based on what I've read in the SQL Server Books Online, it seems that I
should be able to change this without any problems. I wanted to see
what others think from personal experience (if possible) before I went
and did this.
Any help is greatly appreciated!
I've seen many troubles on untidy applications and JDBC apps with regard to
this. Check this KB, just in case. Sorry if redundant:
http://support.microsoft.com/default...b;en-us;271566
Cheers
AD
"Don Kitchen" <donkitchen@.gmail.com> wrote in message
news:1110230850.065960.319130@.g14g2000cwa.googlegr oups.com...
> Hi all. I wanted to know if a database running on SQL Server 2000 SP3a
> with a database compatibility level of 70 can be changed to 80 without
> any problems. This is a database that was originally built with SQL
> Server 7.0. I'm assuming that over time as the DB itself was moved to
> SQL Server 2000, the compatibility level was never upgraded.
> The reason that I want to change the compatibility level from 70 to 80
> is because I need to use the LIKE statement in a table query. It turns
> out the LIKE statement uses COLLATE behind the scenes, which is
> specific to 80.
> Based on what I've read in the SQL Server Books Online, it seems that I
> should be able to change this without any problems. I wanted to see
> what others think from personal experience (if possible) before I went
> and did this.
> Any help is greatly appreciated!
>

Changing database compatibility from 70 to 80

Hi all. I wanted to know if a database running on SQL Server 2000 SP3a
with a database compatibility level of 70 can be changed to 80 without
any problems. This is a database that was originally built with SQL
Server 7.0. I'm assuming that over time as the DB itself was moved to
SQL Server 2000, the compatibility level was never upgraded.
The reason that I want to change the compatibility level from 70 to 80
is because I need to use the LIKE statement in a table query. It turns
out the LIKE statement uses COLLATE behind the scenes, which is
specific to 80.
Based on what I've read in the SQL Server Books Online, it seems that I
should be able to change this without any problems. I wanted to see
what others think from personal experience (if possible) before I went
and did this.
Any help is greatly appreciated!I've seen many troubles on untidy applications and JDBC apps with regard to
this. Check this KB, just in case. Sorry if redundant:
http://support.microsoft.com/defaul...kb;en-us;271566
Cheers
AD
"Don Kitchen" <donkitchen@.gmail.com> wrote in message
news:1110230850.065960.319130@.g14g2000cwa.googlegroups.com...
> Hi all. I wanted to know if a database running on SQL Server 2000 SP3a
> with a database compatibility level of 70 can be changed to 80 without
> any problems. This is a database that was originally built with SQL
> Server 7.0. I'm assuming that over time as the DB itself was moved to
> SQL Server 2000, the compatibility level was never upgraded.
> The reason that I want to change the compatibility level from 70 to 80
> is because I need to use the LIKE statement in a table query. It turns
> out the LIKE statement uses COLLATE behind the scenes, which is
> specific to 80.
> Based on what I've read in the SQL Server Books Online, it seems that I
> should be able to change this without any problems. I wanted to see
> what others think from personal experience (if possible) before I went
> and did this.
> Any help is greatly appreciated!
>

Changing database compatibility from 70 to 80

Hi all. I wanted to know if a database running on SQL Server 2000 SP3a
with a database compatibility level of 70 can be changed to 80 without
any problems. This is a database that was originally built with SQL
Server 7.0. I'm assuming that over time as the DB itself was moved to
SQL Server 2000, the compatibility level was never upgraded.
The reason that I want to change the compatibility level from 70 to 80
is because I need to use the LIKE statement in a table query. It turns
out the LIKE statement uses COLLATE behind the scenes, which is
specific to 80.
Based on what I've read in the SQL Server Books Online, it seems that I
should be able to change this without any problems. I wanted to see
what others think from personal experience (if possible) before I went
and did this.
Any help is greatly appreciated!I've seen many troubles on untidy applications and JDBC apps with regard to
this. Check this KB, just in case. Sorry if redundant:
http://support.microsoft.com/default.aspx?scid=kb;en-us;271566
Cheers
AD
"Don Kitchen" <donkitchen@.gmail.com> wrote in message
news:1110230850.065960.319130@.g14g2000cwa.googlegroups.com...
> Hi all. I wanted to know if a database running on SQL Server 2000 SP3a
> with a database compatibility level of 70 can be changed to 80 without
> any problems. This is a database that was originally built with SQL
> Server 7.0. I'm assuming that over time as the DB itself was moved to
> SQL Server 2000, the compatibility level was never upgraded.
> The reason that I want to change the compatibility level from 70 to 80
> is because I need to use the LIKE statement in a table query. It turns
> out the LIKE statement uses COLLATE behind the scenes, which is
> specific to 80.
> Based on what I've read in the SQL Server Books Online, it seems that I
> should be able to change this without any problems. I wanted to see
> what others think from personal experience (if possible) before I went
> and did this.
> Any help is greatly appreciated!
>