Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Friday, March 30, 2012

PredictCaseLikelihood

I'm working with the cluster analysis algorithm (EM) in SQL 2005. I have tried to find documentation on the function PredictCaseLikelihood without luck. Is there any reference on how this function is defined?

Here's an excerpt from my book Data Mining with SQL Server 2005

PredictCaseLikelihood

PredictCaseLikelihood returns a measure from 0 to 1 that indicates how likely an input case is to exist considering the model learned by the algorithm.This measure is very good for use in anomaly detection as it quickly and easily tells you if new data is similar to any data seen before.This function operates in two modes, normalized and nonnormalized.

In the nonnormalized mode, the value of the measure is the raw probability of the case, that is, the product of the probabilities of each of the attributes in the case.For instance, if the probability of Home Ownership = ‘Yes’ is 40% and the probability of Occupation = ‘Craftsmen’ is 10% then the probability of the case is 40% x 10% = 4%.

Nonnormalized likelihoods can be useful, but due to the nature of the probabilities, as you increase the number of attributes in a case the probability of the case becomes increasingly small.Additionally, as a user, you can not understand if a 4% probability for a certain combination of attributes is a good thing or a bad thing.The normalized likelihood divides the probability of the case as provided by the model by the probability computed without the model using raw statistics.This provides a “lift” number that is normalized between 0 and 1 using the formula (lift)/(lift + 1).This is interpreted that cases with likelihood values greater than 0.5 have positive lift and are more likely than random to occur and that values less than 0.5 have negative life and are less likely than random to occur.

For continuous attributes, the probability distribution is used for this computation.

This query returns the normalized case likelihood for each case in the input set.

SELECT t.id, PredictCaseLikelihood()

FROM CustomerClusters

NATURAL PREDICTION JOIN <Input Set> AS t

This query returns the nonnormalized case likelihood for each case in the input set.

SELECT t.id, CaseLikelihood(NONNORMALIZED)

FROM CustomerClusters

NATURAL PREDICTION JOIN <Input Set> AS t

Monday, March 26, 2012

PRB: "use database" not working after "create database"

PRB: "use database" not working after "create database"
Please help,
I have the following query:
set XACT_ABORT on
begin transaction
create database MY_DB
use MY_DB
commit transaction
The "use" statement fails saying the database does not exists, but I get no
error on the "create". And when I go to the server, sure enough the DB is no
t
there, which it should not be if the TX rolled back. So what is wrong? If th
e
"create" is bad, why do I not see an error on it?You will not see it until you commit the transaction.
set XACT_ABORT on
begin transaction
create database MY_DB
commit transaction
use MY_DB
AMB
"ATS" wrote:

> PRB: "use database" not working after "create database"
> Please help,
> I have the following query:
> set XACT_ABORT on
> begin transaction
> create database MY_DB
> use MY_DB
> commit transaction
> The "use" statement fails saying the database does not exists, but I get n
o
> error on the "create". And when I go to the server, sure enough the DB is
not
> there, which it should not be if the TX rolled back. So what is wrong? If
the
> "create" is bad, why do I not see an error on it?|||Thanks for the reply, but that doesn't work in Query Analyzer.|||Try,
use master
go
create database MY_DB
go
select
*
from
sysdatabases
where
[name] = 'MY_DB'
go
drop database MY_DB
go
AMB
"ATS" wrote:

> Thanks for the reply, but that doesn't work in Query Analyzer.|||One other thing I've noticed. Even with or without TX handling it fails in
Query Analyzer.sql

poweroff & index

power-off happened, and server [w2k, sql2k] stopped during working day.
quick analyze showed there is no evident data loss [last changed values are
still there], so they restarted the server and continued to work.
later, some mallfunctions [broken relations] assured us that indices [at
least some of them] are damaged.
questionn is: how are primary key [and other uniques] indices handled?
is it possible, if index not repaired, doubled [not-unique] key being
inserted?
what is the most efficient way to examine if this happened.
after rebuilding primary key index [if broken], what happens with duplicated
keys?
some comments or experience about this?
thnx.
SQL Server should in many cases handle a hard power off just fine. There are two cases where this
can go bad, though:
1. Hardware caching without battery backup. SQL Server depends on what has been written is actually
on the disk. It directs the OS to not cache write operations, but if you have HW caching, then all
bets are off.
2. Torn page. SQL Server directs the OS to do write in page sizes as smallest size. So the OS will
direct the disk subsystem to do the write, but typically smallest size for write operation at disk
level is sector (typically 512 bytes) so a page can be partially written.
The best place to start if you want to read more about this are below two articles:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlIObasics.mspx
http://www.microsoft.com/technet/prodtechnol/sql/2005/iobasics.mspx
Also, I suggest you visit for lots of good stuff related to this topic.
http://blogs.msdn.com/sqlserverstorageengine/default.aspx
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"sali" <sali@.euroherc.hr> wrote in message news:eEYuqK4wHHA.4300@.TK2MSFTNGP04.phx.gbl...
> power-off happened, and server [w2k, sql2k] stopped during working day.
> quick analyze showed there is no evident data loss [last changed values are still there], so they
> restarted the server and continued to work.
> later, some mallfunctions [broken relations] assured us that indices [at least some of them] are
> damaged.
> questionn is: how are primary key [and other uniques] indices handled?
> is it possible, if index not repaired, doubled [not-unique] key being inserted?
> what is the most efficient way to examine if this happened.
> after rebuilding primary key index [if broken], what happens with duplicated keys?
> some comments or experience about this?
> thnx.
>
|||I don't no if you have the resources but.
Why don't you make a online full-backup.
Restore it....do the rebuilld index or repairs and see what happens.
Offcourse you can also query the database to check for duplicate keys.
I don't think this is happening.
But don't take my word for it.
Make sure you have a recent a log back-up and get to work!
Good luck!
"sali" wrote:

> power-off happened, and server [w2k, sql2k] stopped during working day.
> quick analyze showed there is no evident data loss [last changed values are
> still there], so they restarted the server and continued to work.
> later, some mallfunctions [broken relations] assured us that indices [at
> least some of them] are damaged.
> questionn is: how are primary key [and other uniques] indices handled?
> is it possible, if index not repaired, doubled [not-unique] key being
> inserted?
> what is the most efficient way to examine if this happened.
> after rebuilding primary key index [if broken], what happens with duplicated
> keys?
> some comments or experience about this?
> thnx.
>
>
|||thnx
right now server is working, but i want to be sure there is no hidden
problem with corrupted primary & unique keys.
i am affraid that simple :
select count(*), prim_key
group by prim_key
wouldn't show me there is a prim_keys with count()>1
or could i may select with prime_key index switched_off [simple flat scan]?
it all may depends of internal architecture of database engine, i've got a
link about it and going to examine it.
"Hate_orphaned_users" <Hateorphanedusers@.discussions.microsoft.com> je
napisao u poruci interesnoj
grupi:A7465133-50EA-43AB-92BB-2040C3844328@.microsoft.com...[vbcol=seagreen]
> Offcourse you can also query the database to check for duplicate keys.
> Good luck!
>
> "sali" wrote:
|||You might want to check out the DBCC CHECKCONSTRAINTS command.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"sali" <sali@.euroherc.hr> wrote in message news:%23EyhH44wHHA.4640@.TK2MSFTNGP03.phx.gbl...
> thnx
> right now server is working, but i want to be sure there is no hidden
> problem with corrupted primary & unique keys.
> i am affraid that simple :
> select count(*), prim_key
> group by prim_key
> wouldn't show me there is a prim_keys with count()>1
> or could i may select with prime_key index switched_off [simple flat scan]?
> it all may depends of internal architecture of database engine, i've got a
> link about it and going to examine it.
>
> "Hate_orphaned_users" <Hateorphanedusers@.discussions.microsoft.com> je
> napisao u poruci interesnoj
> grupi:A7465133-50EA-43AB-92BB-2040C3844328@.microsoft.com...
>

poweroff & index

power-off happened, and server [w2k, sql2k] stopped during working day.
quick analyze showed there is no evident data loss [last changed values
are
still there], so they restarted the server and continued to work.
later, some mallfunctions [broken relations] assured us that indices
1;at
least some of them] are damaged.
questionn is: how are primary key [and other uniques] indices handled?
is it possible, if index not repaired, doubled [not-unique] key being
inserted?
what is the most efficient way to examine if this happened.
after rebuilding primary key index [if broken], what happens with duplic
ated
keys?
some comments or experience about this?
thnx.SQL Server should in many cases handle a hard power off just fine. There are
two cases where this
can go bad, though:
1. hardware caching without battery backup. SQL Server depends on what has b
een written is actually
on the disk. It directs the OS to not cache write operations, but if you hav
e HW caching, then all
bets are off.
2. Torn page. SQL Server directs the OS to do write in page sizes as smalles
t size. So the OS will
direct the disk subsystem to do the write, but typically smallest size for w
rite operation at disk
level is sector (typically 512 bytes) so a page can be partially written.
The best place to start if you want to read more about this are below two ar
ticles:
http://www.microsoft.com/technet/pr...5/iobasics.mspx
Also, I suggest you visit for lots of good stuff related to this topic.
http://blogs.msdn.com/sqlserverstor...ne/default.aspx
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"sali" <sali@.euroherc.hr> wrote in message news:eEYuqK4wHHA.4300@.TK2MSFTNGP04.phx.gbl...[vbc
ol=seagreen]
> power-off happened, and server [w2k, sql2k] stopped during working day
.
> quick analyze showed there is no evident data loss [last changed value
s are still there], so they
> restarted the server and continued to work.
> later, some mallfunctions [broken relations] assured us that indices &
#91;at least some of them] are
> damaged.
> questionn is: how are primary key [and other uniques] indices handled?
> is it possible, if index not repaired, doubled [not-unique] key being
inserted?
> what is the most efficient way to examine if this happened.
> after rebuilding primary key index [if broken], what happens with dupl
icated keys?
> some comments or experience about this?
> thnx.
>[/vbcol]|||I don't no if you have the resources but.
Why don't you make a online full-backup.
Restore it....do the rebuilld index or repairs and see what happens.
Offcourse you can also query the database to check for duplicate keys.
I don't think this is happening.
But don't take my word for it.
Make sure you have a recent a log back-up and get to work!
Good luck!
"sali" wrote:

> power-off happened, and server [w2k, sql2k] stopped during working day
.
> quick analyze showed there is no evident data loss [last changed value
s are
> still there], so they restarted the server and continued to work.
> later, some mallfunctions [broken relations] assured us that indices &
#91;at
> least some of them] are damaged.
> questionn is: how are primary key [and other uniques] indices handled?
> is it possible, if index not repaired, doubled [not-unique] key being
> inserted?
> what is the most efficient way to examine if this happened.
> after rebuilding primary key index [if broken], what happens with dupl
icated
> keys?
> some comments or experience about this?
> thnx.
>
>|||thnx
right now server is working, but i want to be sure there is no hidden
problem with corrupted primary & unique keys.
i am affraid that simple :
select count(*), prim_key
group by prim_key
wouldn't show me there is a prim_keys with count()>1
or could i may select with prime_key index switched_off [simple flat sca
n]?
it all may depends of internal architecture of database engine, i've got a
link about it and going to examine it.
"Hate_orphaned_users" <Hateorphanedusers@.discussions.microsoft.com> je
napisao u poruci interesnoj
grupi:A7465133-50EA-43AB-92BB-2040C3844328@.microsoft.com...[vbcol=seagreen]
> Offcourse you can also query the database to check for duplicate keys.
> Good luck!
>
> "sali" wrote:
>|||You might want to check out the DBCC CHECKCONSTRAINTS command.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"sali" <sali@.euroherc.hr> wrote in message news:%23EyhH44wHHA.4640@.TK2MSFTNGP03.phx.gbl...[v
bcol=seagreen]
> thnx
> right now server is working, but i want to be sure there is no hidden
> problem with corrupted primary & unique keys.
> i am affraid that simple :
> select count(*), prim_key
> group by prim_key
> wouldn't show me there is a prim_keys with count()>1
> or could i may select with prime_key index switched_off [simple flat s
can]?
> it all may depends of internal architecture of database engine, i've got a
> link about it and going to examine it.
>
> "Hate_orphaned_users" <Hateorphanedusers@.discussions.microsoft.com> je
> napisao u poruci interesnoj
> grupi:A7465133-50EA-43AB-92BB-2040C3844328@.microsoft.com...
>[/vbcol]

poweroff & index

power-off happened, and server [w2k, sql2k] stopped during working day.
quick analyze showed there is no evident data loss [last changed values are
still there], so they restarted the server and continued to work.
later, some mallfunctions [broken relations] assured us that indices [at
least some of them] are damaged.
questionn is: how are primary key [and other uniques] indices handled?
is it possible, if index not repaired, doubled [not-unique] key being
inserted?
what is the most efficient way to examine if this happened.
after rebuilding primary key index [if broken], what happens with duplicated
keys?
some comments or experience about this?
thnx.SQL Server should in many cases handle a hard power off just fine. There are two cases where this
can go bad, though:
1. Hardware caching without battery backup. SQL Server depends on what has been written is actually
on the disk. It directs the OS to not cache write operations, but if you have HW caching, then all
bets are off.
2. Torn page. SQL Server directs the OS to do write in page sizes as smallest size. So the OS will
direct the disk subsystem to do the write, but typically smallest size for write operation at disk
level is sector (typically 512 bytes) so a page can be partially written.
The best place to start if you want to read more about this are below two articles:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlIObasics.mspx
http://www.microsoft.com/technet/prodtechnol/sql/2005/iobasics.mspx
Also, I suggest you visit for lots of good stuff related to this topic.
http://blogs.msdn.com/sqlserverstorageengine/default.aspx
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"sali" <sali@.euroherc.hr> wrote in message news:eEYuqK4wHHA.4300@.TK2MSFTNGP04.phx.gbl...
> power-off happened, and server [w2k, sql2k] stopped during working day.
> quick analyze showed there is no evident data loss [last changed values are still there], so they
> restarted the server and continued to work.
> later, some mallfunctions [broken relations] assured us that indices [at least some of them] are
> damaged.
> questionn is: how are primary key [and other uniques] indices handled?
> is it possible, if index not repaired, doubled [not-unique] key being inserted?
> what is the most efficient way to examine if this happened.
> after rebuilding primary key index [if broken], what happens with duplicated keys?
> some comments or experience about this?
> thnx.
>|||I don't no if you have the resources but.
Why don't you make a online full-backup.
Restore it....do the rebuilld index or repairs and see what happens.
Offcourse you can also query the database to check for duplicate keys.
I don't think this is happening.
But don't take my word for it.
Make sure you have a recent a log back-up and get to work!
Good luck!
"sali" wrote:
> power-off happened, and server [w2k, sql2k] stopped during working day.
> quick analyze showed there is no evident data loss [last changed values are
> still there], so they restarted the server and continued to work.
> later, some mallfunctions [broken relations] assured us that indices [at
> least some of them] are damaged.
> questionn is: how are primary key [and other uniques] indices handled?
> is it possible, if index not repaired, doubled [not-unique] key being
> inserted?
> what is the most efficient way to examine if this happened.
> after rebuilding primary key index [if broken], what happens with duplicated
> keys?
> some comments or experience about this?
> thnx.
>
>|||thnx
right now server is working, but i want to be sure there is no hidden
problem with corrupted primary & unique keys.
i am affraid that simple :
select count(*), prim_key
group by prim_key
wouldn't show me there is a prim_keys with count()>1
or could i may select with prime_key index switched_off [simple flat scan]?
it all may depends of internal architecture of database engine, i've got a
link about it and going to examine it.
"Hate_orphaned_users" <Hateorphanedusers@.discussions.microsoft.com> je
napisao u poruci interesnoj
grupi:A7465133-50EA-43AB-92BB-2040C3844328@.microsoft.com...
> Offcourse you can also query the database to check for duplicate keys.
> Good luck!
>
> "sali" wrote:
>> power-off happened, and server [w2k, sql2k] stopped during working day.
>> quick analyze showed there is no evident data loss|||You might want to check out the DBCC CHECKCONSTRAINTS command.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"sali" <sali@.euroherc.hr> wrote in message news:%23EyhH44wHHA.4640@.TK2MSFTNGP03.phx.gbl...
> thnx
> right now server is working, but i want to be sure there is no hidden
> problem with corrupted primary & unique keys.
> i am affraid that simple :
> select count(*), prim_key
> group by prim_key
> wouldn't show me there is a prim_keys with count()>1
> or could i may select with prime_key index switched_off [simple flat scan]?
> it all may depends of internal architecture of database engine, i've got a
> link about it and going to examine it.
>
> "Hate_orphaned_users" <Hateorphanedusers@.discussions.microsoft.com> je
> napisao u poruci interesnoj
> grupi:A7465133-50EA-43AB-92BB-2040C3844328@.microsoft.com...
>> Offcourse you can also query the database to check for duplicate keys.
>> Good luck!
>>
>> "sali" wrote:
>> power-off happened, and server [w2k, sql2k] stopped during working day.
>> quick analyze showed there is no evident data loss
>sql

Friday, March 23, 2012

Power/Factorial not working

I am trying to get the value, 3 to the 2.2 power (3^2.222).
Can someone tell me how to do it? The literature says to use:
POWER(3,2.222)
however ths is rounding my values for some reason.Power (X, Y)

GOT IT!

and the key was x.

Power (1.0000, 1) will return 1.0000
Power (1.00, 1) will return 1.00

Hooah!

`Le

Wednesday, March 21, 2012

PostBack while selecting a parameter

Hi,

I'm working on a report having 2 date parameters(which uses calendar control) and a dropdownlist. But on selecting each of these parameters, the page refreshes. For eg On selecting a date from the calendar control results in a postback. The same is the case with the dropdownlist. Could you please help to resolve this issue? We need the postback to happen only on clicking the 'View Report' button.

Also, is there any way to customize the 'View Report' button. It always appears in the right hand side. Can we set the position of this button so that it appears just below the paging button?

Thanks in advance,

Sonu.

1. No, it's not possible to avoid postbacks when you enter parameters one by one.

2. There is no way to customize the position of the button but you can change the style of the button in your report manager by using the ReportingServices.css file in the following folder (probably):

C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportManager\Styles

Please refer to more details in the following link:

http://msdn2.microsoft.com/en-us/library/ms345247.aspx

Shyam

sql

Postage Calculation goes where?

When a customer proceeds to the checkout of the store I'm working on, the customer's ID is sent to a database stored procedure which returns the details of the order based on the shopping cart and customer account details stored in the database.

Should I have the stored procedure calculate the postage and packing for the order or should I wait till the order details are returned to the asp.net code, do some calculations, and then update the order?

Having this code in the asp.net page would not only require a trip to the server to do the update but also a trip to retrieve p&p information used for the calculations. These extra trips are my concern.

Any thoughts?::These extra trips are my concern.

Why? Are you working for Amazon?

How many hundred CHECKOUTS do you have per minute?

IMHO this is a non-issue, at least with some caching.

Tuesday, March 20, 2012

Post SP1 troubles

Access 2003 + Sp1 + adp + ADO 2.8 + SQL Server 2000.
A perfectly working form with subform from two inner joined tables now is
giving me annoying messages when inserting records in the master table.
"Cannot insert a non-null value into a timestamp column. Use INSERT with a
column list or with a default of NULL for the timestamp column."
There's nothing done programmatically, all data bound to form's controls
(obvoiusly not the timestamp field).
Help!
I would use Profiler to determine the exact SQL being passed to the server.
The message is probably correct and the app is probably trying to do what
the message says it is preventing.
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Atlas" <atlaspeak@.my-deja.com> wrote in message
news:10guprqnccn2g2b@.news.supernews.com...
> Access 2003 + Sp1 + adp + ADO 2.8 + SQL Server 2000.
> A perfectly working form with subform from two inner joined tables now is
> giving me annoying messages when inserting records in the master table.
> "Cannot insert a non-null value into a timestamp column. Use INSERT with a
> column list or with a default of NULL for the timestamp column."
> There's nothing done programmatically, all data bound to form's controls
> (obvoiusly not the timestamp field).
> Help!
>

Post SP1 troubles

Access 2003 + Sp1 + adp + ADO 2.8 + SQL Server 2000.
A perfectly working form with subform from two inner joined tables now is
giving me annoying messages when inserting records in the master table.
"Cannot insert a non-null value into a timestamp column. Use INSERT with a
column list or with a default of NULL for the timestamp column."
There's nothing done programmatically, all data bound to form's controls
(obvoiusly not the timestamp field).
Help!I would use Profiler to determine the exact SQL being passed to the server.
The message is probably correct and the app is probably trying to do what
the message says it is preventing.
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Atlas" <atlaspeak@.my-deja.com> wrote in message
news:10guprqnccn2g2b@.news.supernews.com...
> Access 2003 + Sp1 + adp + ADO 2.8 + SQL Server 2000.
> A perfectly working form with subform from two inner joined tables now is
> giving me annoying messages when inserting records in the master table.
> "Cannot insert a non-null value into a timestamp column. Use INSERT with a
> column list or with a default of NULL for the timestamp column."
> There's nothing done programmatically, all data bound to form's controls
> (obvoiusly not the timestamp field).
> Help!
>

Post SP1 troubles

Access 2003 + Sp1 + adp + ADO 2.8 + SQL Server 2000.
A perfectly working form with subform from two inner joined tables now is
giving me annoying messages when inserting records in the master table.
"Cannot insert a non-null value into a timestamp column. Use INSERT with a
column list or with a default of NULL for the timestamp column."
There's nothing done programmatically, all data bound to form's controls
(obvoiusly not the timestamp field).
Help!I would use Profiler to determine the exact SQL being passed to the server.
The message is probably correct and the app is probably trying to do what
the message says it is preventing.
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Atlas" <atlaspeak@.my-deja.com> wrote in message
news:10guprqnccn2g2b@.news.supernews.com...
> Access 2003 + Sp1 + adp + ADO 2.8 + SQL Server 2000.
> A perfectly working form with subform from two inner joined tables now is
> giving me annoying messages when inserting records in the master table.
> "Cannot insert a non-null value into a timestamp column. Use INSERT with a
> column list or with a default of NULL for the timestamp column."
> There's nothing done programmatically, all data bound to form's controls
> (obvoiusly not the timestamp field).
> Help!
>

Post method in ASP stops working

I am having an issue on a windows 2003 box where I run a report to a new
window, and I do a request.form to get all my parameters. The first time I
run a report to a new window I am prompted for the windows user name and
password. Once I enter in the login info my report runs fine. Then when I try
to run another report to a new window the request.form doesn't work to pull
things in from my form. Everything is blank, so I get error messages. Another
report will not run until I shutdown IE restart IE log back into my website
and run the report.
My redirect string is
http://Session('sServer')/ReportServer?/Session("sProjectCode")/sReport &
"&rs:Command=render&rs:Format=HTML4.0&rc:Paramaters=False"
Can anyone tell me why the post method or Request.form will only work once
and then I have to restart IE. Again I am opening the report in a new window.
--
Thanks,
CraigI fixed this by going into IIS and going into the properties on the Reports
and ReportServer Virtual directories and under Directory security enabling
anonymous access.
"Craig" wrote:
> I am having an issue on a windows 2003 box where I run a report to a new
> window, and I do a request.form to get all my parameters. The first time I
> run a report to a new window I am prompted for the windows user name and
> password. Once I enter in the login info my report runs fine. Then when I try
> to run another report to a new window the request.form doesn't work to pull
> things in from my form. Everything is blank, so I get error messages. Another
> report will not run until I shutdown IE restart IE log back into my website
> and run the report.
> My redirect string is
> http://Session('sServer')/ReportServer?/Session("sProjectCode")/sReport &
> "&rs:Command=render&rs:Format=HTML4.0&rc:Paramaters=False"
> Can anyone tell me why the post method or Request.form will only work once
> and then I have to restart IE. Again I am opening the report in a new window.
> --
> Thanks,
> Craig

Possibly similar issue with launching Report Builder from client PC's

Hi,

I got a working installation of reporting services 2005 up and running, Im able to create models and launch the Report Builder on the machine on which the server is installed, however if I try and run it from another machine on the network I get an error and Im able to view the following exception.

Following errors were detected during this operation.
* [04 Jul 2005 10:39:34 +01:00] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Failed while downloading http://testserver/ReportServer/ReportBuilder/ReportBuilder.application
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadManifest(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ManifestType manifestType, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifest(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
Inner Exception
System.Net.WebException
- The remote server returned an error: (401) Unauthorized.
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)

Anyone able to help ?The error means that the client does not have the Whidbey CLR installed. You will need to install the Whidbey CLR on each client machine where you want to use report builder.

-Lukasz|||Hi,
I was facing similar problem while accessing Report Manager installed on different system on the network, I was able to get Report Manager menu but can not see contents on Report Server. It was displayed Blank without any exception.

Report Server is installed on http://testsrv/Reports$sql2005.

I changed configuration of Reporting Service on Server , Report Server Configuration Manager > Windows Service Identity> Service account from "Local System" to "Local Services".

I can access Report Manager with contents.

Meanwhile I noticed that Report Builder is not launching on the system which is a different system from the Report Server. As per my understanding, Report Builder is a "End user tool" and will be launched without any upgradation of the system (Different system from server). I am getting prompt for "Open/Save document".
Where as Report Builder is working fine on Server itself.

While opening document, I can see XML contents to access Report Builder.
I am pasting part of that XML file in orange colour,

<?xml version="1.0" encoding="utf-8" ?>

- <asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<assemblyIdentity name="ReportBuilder.app" version="9.0.1116.8" publicKeyToken="49ef3e7f44a9c98c" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />

<description asmv2:publisher="Microsoft" asmv2:product="Report Builder" xmlns="urn:schemas-microsoft-com:asm.v1" />

<deployment install="false" trustURLParameters="true" />

- <dependency>

- <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="ReportBuilder.exe.manifest" size="7148">

<assemblyIdentity name="ReportBuilder.exe" version="9.0.1116.8" publicKeyToken="49ef3e7f44a9c98c" language="neutral" processorArchitecture="msil" type="win32" />

- <hash>

- <dsig:Transforms>

<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />

</dsig:Transforms>

<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />

<dsig:DigestValue>aAi7VtRySyyvYXiAs4FuFXSiqLA=</dsig:DigestValue>

</hash>

</dependentAssembly>

Anyone knows how to fix this, It is required to upgrade my system, what are the upgrades require on the system to access Report Builder?

|||Your two issues are unrelated. Specifically for the Report Builder issue - the client machine (the one on which you want to run Report Builder) needs to have The .Net Framework 2.0 (CLR 2.0) installed on it.

The reason is that the Report Builder leverages the ClickOnce technology that is new in the .Net Framework 2.0.

Regarding your other issue - the Report Manager shows the top menu with a blank contents when your login does not have permissions on the root of the report server. You will need a role that has Read Properties (Browser roles has this) assigned to your login on the root of the report server namespace. Changing the account from Local System to Local Service should not affect this.

-Lukasz|||Thanks Lukasz, I have installed .NET Framework 2.0 on Client machine and able to launch Report Builder successfully.

I created a new user with sufficient permission and access to HOME directory on Report Server and able to access Reports/Data Sources/Models using Client Machine.

Thanks again!|||

I have what may be a similar problem. I try to click on the "Report Builder" button from a client machine and nothing happens, however I have tried things mentioned in the suggestions above and it did not seem to help. From a client PC, I logged in as myself and am not able to run "Report Builder", but when I login as a local admin I am able to run "Report Builder".

Our server has SQL Server 2005 Enterprise Edition and Visual Studio 2005 installed. I am able to run "Report Builder" from my PC where I had Visual Studio 2005 installed, but not SQL Server 2005 installed. I have local admin priviledges to my PC.

From a client PC, I logged in as myself and am not able to run "Report Builder". When I click on it nothing happens. I gave my Windows login "Content Manger" permissions under the SSRS Home -> Properties tab, and I also added my login and gave myself "System Administrator" and "System User" Roles under the SSRS ->Site Settings->Configure site-wide security option. This seems to be configured correctly, as "Report Builder" launches when I am on my PC. However, it does not launch on the client PC when logged in under my login.

Further, when I login as a local admin on the client PC, I am able to run "Report Builder", so I think the .net framework 2.0 is correctly installed and working properly. However, it is our policy not to give the user of the client PC local admin rights. My windows login does not have local admin rights to this particular PC.

Q1. Is local admin rights required on the client PC where "Report Builder" is ran? If so, is it only required for the first time it is loaded? It seems like it should not be required, however this would explain the symptoms detailed above.

Q2. Is there an error log that may help debug what this problem is? It is strange to me, that nothing happens, but no error is displayed on the http://.../reportserver/Pages page

Q3. When logged in as local admin, report builder installed to something like:

C:\Documents and Settings\Administrator.8ZR5551\Local Settings\Apps\2.0\VVJ0004J.B0N\H3KE16BP.Y07\repo..lder_89845dcd8080cc91_0009.0000_none_7ecce75e919dcccd

I am not sure if I can copy this install to another directory which the client has permission to run from. Is this a valid thing to do? I am guessing probably not since I tried this and it did not seem to work.I tried this and it did not seem to work..

Q4. I saw this posting talking about the need to run under PartialTrust mode, instead of FullTrust mode. So I reconfigured the RSWebApplication.config file to do that, and it still does not work.:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=280387&SiteID=1 which refers to the following link.

http://msdn2.microsoft.com/en-us/library/ms345245.aspx

I changed the C:\Program Files\MSSQL2005\MSSQL.3\Reporting Services\ReportManager\ RSWebApplication.config

From

<Configuration><UI> …

<ReportBuilderTrustLevel> FullTrust </ReportBuilderTrustLevel>

</UI>…</Configuration>

To

<Configuration><UI> …

<ReportBuilderTrustLevel>PartialTrust</ReportBuilderTrustLevel>

</UI>…</Configuration>

Stopped and restarted report server through reporting services configuration (not sure if I needed to do this) The problem still occurred, however.

|||

Well scratch that idea on local admin rights. Our IT department gave login admin to my windows login (My computer->Manage->System Tools: Local Users and Groups->Administrators) and it still did not work. When I click on "Report Builder" it still does not do anything. I also tried to use it directly at the following URL's and it still did not work, same result of not displaying anything:

http://.../reportserver/ReportBuilder/ReportBuilder.application

http://.../reportserver/ReportBuilder/ReportBuilderLocalIntranet.application

Q5. Is there any Internet Explorer settings that would cause this behavior? I tried disabling popup blocker, but this did not seem to help.

Q6. In the above posting, giving permission on the server HOME directory was required. What directory does this refer to? Does this mean each user of Report Builder needs Windows Directory level security to some directories like C:\Program Files\MSSQL2005\MSSQL.3\Reporting Services\ReportManager\ or others? This does not seem to make sense, but I was unsure which HOME directory was mentioned in the previous posting by Nilesh Trivedi.
.

|||Well this is almost a year old but I am facing the exact same problem as Chad Buher. Clicking on the Report Builder button does nothing, no error, nothing. Can this be caused by some network policy setting?

Monday, March 12, 2012

Possibly similar issue with launching Report Builder from client PC's

Hi,

I got a working installation of reporting services 2005 up and running, Im able to create models and launch the Report Builder on the machine on which the server is installed, however if I try and run it from another machine on the network I get an error and Im able to view the following exception.

Following errors were detected during this operation.
* [04 Jul 2005 10:39:34 +01:00] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Failed while downloading http://testserver/ReportServer/ReportBuilder/ReportBuilder.application
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadManifest(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ManifestType manifestType, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifest(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
Inner Exception
System.Net.WebException
- The remote server returned an error: (401) Unauthorized.
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)

Anyone able to help ?The error means that the client does not have the Whidbey CLR installed. You will need to install the Whidbey CLR on each client machine where you want to use report builder.

-Lukasz|||Hi,
I was facing similar problem while accessing Report Manager installed on different system on the network, I was able to get Report Manager menu but can not see contents on Report Server. It was displayed Blank without any exception.

Report Server is installed on http://testsrv/Reports$sql2005.

I changed configuration of Reporting Service on Server , Report Server Configuration Manager > Windows Service Identity> Service account from "Local System" to "Local Services".

I can access Report Manager with contents.

Meanwhile I noticed that Report Builder is not launching on the system which is a different system from the Report Server. As per my understanding, Report Builder is a "End user tool" and will be launched without any upgradation of the system (Different system from server). I am getting prompt for "Open/Save document".
Where as Report Builder is working fine on Server itself.

While opening document, I can see XML contents to access Report Builder.
I am pasting part of that XML file in orange colour,

<?xml version="1.0" encoding="utf-8" ?>

- <asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<assemblyIdentity name="ReportBuilder.app" version="9.0.1116.8" publicKeyToken="49ef3e7f44a9c98c" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />

<description asmv2:publisher="Microsoft" asmv2:product="Report Builder" xmlns="urn:schemas-microsoft-com:asm.v1" />

<deployment install="false" trustURLParameters="true" />

- <dependency>

- <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="ReportBuilder.exe.manifest" size="7148">

<assemblyIdentity name="ReportBuilder.exe" version="9.0.1116.8" publicKeyToken="49ef3e7f44a9c98c" language="neutral" processorArchitecture="msil" type="win32" />

- <hash>

- <dsig:Transforms>

<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />

</dsig:Transforms>

<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />

<dsig:DigestValue>aAi7VtRySyyvYXiAs4FuFXSiqLA=</dsig:DigestValue>

</hash>

</dependentAssembly>

Anyone knows how to fix this, It is required to upgrade my system, what are the upgrades require on the system to access Report Builder?

|||Your two issues are unrelated. Specifically for the Report Builder issue - the client machine (the one on which you want to run Report Builder) needs to have The .Net Framework 2.0 (CLR 2.0) installed on it.

The reason is that the Report Builder leverages the ClickOnce technology that is new in the .Net Framework 2.0.

Regarding your other issue - the Report Manager shows the top menu with a blank contents when your login does not have permissions on the root of the report server. You will need a role that has Read Properties (Browser roles has this) assigned to your login on the root of the report server namespace. Changing the account from Local System to Local Service should not affect this.

-Lukasz|||Thanks Lukasz, I have installed .NET Framework 2.0 on Client machine and able to launch Report Builder successfully.

I created a new user with sufficient permission and access to HOME directory on Report Server and able to access Reports/Data Sources/Models using Client Machine.

Thanks again!|||

I have what may be a similar problem. I try to click on the "Report Builder" button from a client machine and nothing happens, however I have tried things mentioned in the suggestions above and it did not seem to help. From a client PC, I logged in as myself and am not able to run "Report Builder", but when I login as a local admin I am able to run "Report Builder".

Our server has SQL Server 2005 Enterprise Edition and Visual Studio 2005 installed. I am able to run "Report Builder" from my PC where I had Visual Studio 2005 installed, but not SQL Server 2005 installed. I have local admin priviledges to my PC.

From a client PC, I logged in as myself and am not able to run "Report Builder". When I click on it nothing happens. I gave my Windows login "Content Manger" permissions under the SSRS Home -> Properties tab, and I also added my login and gave myself "System Administrator" and "System User" Roles under the SSRS ->Site Settings->Configure site-wide security option. This seems to be configured correctly, as "Report Builder" launches when I am on my PC. However, it does not launch on the client PC when logged in under my login.

Further, when I login as a local admin on the client PC, I am able to run "Report Builder", so I think the .net framework 2.0 is correctly installed and working properly. However, it is our policy not to give the user of the client PC local admin rights. My windows login does not have local admin rights to this particular PC.

Q1. Is local admin rights required on the client PC where "Report Builder" is ran? If so, is it only required for the first time it is loaded? It seems like it should not be required, however this would explain the symptoms detailed above.

Q2. Is there an error log that may help debug what this problem is? It is strange to me, that nothing happens, but no error is displayed on the http://.../reportserver/Pages page

Q3. When logged in as local admin, report builder installed to something like:

C:\Documents and Settings\Administrator.8ZR5551\Local Settings\Apps\2.0\VVJ0004J.B0N\H3KE16BP.Y07\repo..lder_89845dcd8080cc91_0009.0000_none_7ecce75e919dcccd

I am not sure if I can copy this install to another directory which the client has permission to run from. Is this a valid thing to do? I am guessing probably not since I tried this and it did not seem to work.I tried this and it did not seem to work..

Q4. I saw this posting talking about the need to run under PartialTrust mode, instead of FullTrust mode. So I reconfigured the RSWebApplication.config file to do that, and it still does not work.:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=280387&SiteID=1 which refers to the following link.

http://msdn2.microsoft.com/en-us/library/ms345245.aspx

I changed the C:\Program Files\MSSQL2005\MSSQL.3\Reporting Services\ReportManager\ RSWebApplication.config

From

<Configuration><UI> …

<ReportBuilderTrustLevel> FullTrust </ReportBuilderTrustLevel>

</UI>…</Configuration>

To

<Configuration><UI> …

<ReportBuilderTrustLevel>PartialTrust</ReportBuilderTrustLevel>

</UI>…</Configuration>

Stopped and restarted report server through reporting services configuration (not sure if I needed to do this) The problem still occurred, however.

|||

Well scratch that idea on local admin rights. Our IT department gave login admin to my windows login (My computer->Manage->System Tools: Local Users and Groups->Administrators) and it still did not work. When I click on "Report Builder" it still does not do anything. I also tried to use it directly at the following URL's and it still did not work, same result of not displaying anything:

http://.../reportserver/ReportBuilder/ReportBuilder.application

http://.../reportserver/ReportBuilder/ReportBuilderLocalIntranet.application

Q5. Is there any Internet Explorer settings that would cause this behavior? I tried disabling popup blocker, but this did not seem to help.

Q6. In the above posting, giving permission on the server HOME directory was required. What directory does this refer to? Does this mean each user of Report Builder needs Windows Directory level security to some directories like C:\Program Files\MSSQL2005\MSSQL.3\Reporting Services\ReportManager\ or others? This does not seem to make sense, but I was unsure which HOME directory was mentioned in the previous posting by Nilesh Trivedi.
.

|||Well this is almost a year old but I am facing the exact same problem as Chad Buher. Clicking on the Report Builder button does nothing, no error, nothing. Can this be caused by some network policy setting?

possible uses and impact of using xml datatype

I'm looking at this for an application I'm working on right now that is currently using SQL 2000 and a huge number of meta data files.

We synchronize externally using different technologies to items which cannot be pre-defined at all. We don't know what they will look like, what attributes they will have, or even if a new item might pop up.

So. we have a database just to record that "x" exists, and there is an applicaiton layer to interpret with the meta data what x actually means and looks like, then display it to the user. We track changes to "x" once we know it is there, over time. IT's attribute values will change over time.

I'm thinking with 2005, we could stuff the fact that "x" exists into a row, and it's corresponding definition in an XML column. It seems that this is the exact situation the XML data type was invented for.

My question is: am I right in the above assumption, and what would we really gain by moving that information from the filesystem into the database? Better performance? Easier to manipulate the XML? Easier association of a particular XML file to database data? Would it degrade performance of a system that is currently kind of slow but working?

I think if we used this correctly and in a limited way, we could have something pretty spiffy.

How easy is it to read and manipulate the elements in the XML using SQL?

I want to stay away from CLR and continue using the application layer, just have the attributes for the object available to the application layer.

Could someone give me an example of the ideal situation this datatype was invented for? I believe it would be wrong to invent the whole "database-in-a-database" thing, but for our purposes the datatype might work, since we have no control over the entities or attributes but need to store their existence for the UI.

Obviously, I have a lot of research to do but I thought I might ask if it's worth my time at this point.

Yes, it's worth your time to investigate, but it's hard to know what the impact might be on your particular situation.

Tagged data formats and markup languages generally, of which XML is a member, are ideal for metadata situations.

But the thing is, you must already *have* a metadata language in your app, so it's hard to say what benefit would come from changing it to XML ... except for exactly this point, that the xpath and xquery capabilities in XML generally, and the excellent integration with SQL in SQL Server 2005, are very likely to be helpful. Also that XML as a language, is simple, straightforward, and very widespread.

Friday, March 9, 2012

Possible to overuse WITH (NOLOCK)?

I'm working with a process that is initially invoked from VB, but runs
through a set of stored procedures. The first four levels of the calls are
simply gathering data that the other levels below will need and aggregating
some of it. This data is used to determine if further processing is needed or
not, and if so, calls the next level. W/o going into too much detail, since
the upper levels are simply data gathering, I've been rather liberal in my
application of WITH (NOLOCK) on virtually every table that is used in the
look up.
Here's the reason why, initially the process took two hours to run and it
didn't fully complete. Since my users are not in a Snickers commercial, I can
hardly expect them to wait that long for this process. So I need to make it
as fast as possible. I've gone through and changed all my CURSORS to select
loops (mucho improvement) and also dumped #tempTables in favor of table
variables (more improvement)... and then I added WITH (NOLOCK) on every
normal (non temp or derrived - ie inner selects) table in all queries... I
notice more improvement again. I also rearranged a few queries where some
calculations were done breaking out the data into two parts and changed a
LEFT JOIN to an INNER JOIN....
IS the ANY thing else I can do to squeeze some performance out of this
monster? I haven't run it through profiler yet, but that's the next obvious
choice.
The other half of the query is: is it possible to go too far with WITH
(NOLOCK)? Or is what I've done reasonable?
=chris
On Tue, 28 Feb 2006 13:16:26 -0800, CAnderson wrote:

>The other half of the query is: is it possible to go too far with WITH
>(NOLOCK)? Or is what I've done reasonable?
Hi Chris,
I'll start here.
If performance gain is your sole target, you can use this hint freely.
But if you want correct reports, beware. As another poster in this
groups once said it: WITH (NOLOCK) can give you incorrect results at a
blinding speed.
SQL Server will normally lock data that has been changed but not yet
committed. Other queries have to wait for this lock to be released
before they can access the data. With WITH (NOLOCK), you ignore the
lock, which means that you'll read the uncommitted data. This saves lots
of time if there are locks, and it even saves some time if there are no
locks since you bypass the overhead of checking for locks.
But the downside is that you can read uncommitted data. Suppose that I
update a column to one billion dollars negative. Some sanity check in a
trigger will probably catch this and rollback my transaction - but if
your report runs in the periode between my submitting the update and the
trigger rolling it back, your report will be off by a billion dollars.
Another example - suppose a transaction is debiting your account and
crediting mine. Your report runs before my account is credited, but
after yours is debited. Now, the totals on the left-hand side of your
report won't match those on the right-hand side and all bookkeepers,
accountants and controllers in your company will go crazy.

>I've gone through and changed all my CURSORS to select
>loops (mucho improvement) and also dumped #tempTables in favor of table
>variables (more improvement)...
(snip)
>IS the ANY thing else I can do to squeeze some performance out of this
>monster?
Revisit your code. Try to get rid of all cursors, all select loops, all
temp tables and all table variables. SQL Server is optimized for
declarative, set-based processing. All procedural, row-based code (both
cursor and select loop; both temp table and table variable) will almost
always be slower than one single or a short batch of set-based queries.
Check if all your queries use indexes. Add indexes where necessary.
Remove unused indexes. Pay special attention to your choice of clustered
index.
If you need more specific help than this, you'll need to give more
specific information. Check out www.aspfaq.com/5006.
Hugo Kornelis, SQL Server MVP
|||CAnderson [MVP] wrote:
> I'm working with a process that is initially invoked from VB, but runs
> through a set of stored procedures. The first four levels of the
> calls are simply gathering data that the other levels below will need
> and aggregating some of it. This data is used to determine if further
> processing is needed or not, and if so, calls the next level. W/o
> going into too much detail, since the upper levels are simply data
> gathering, I've been rather liberal in my application of WITH
> (NOLOCK) on virtually every table that is used in the look up.
> Here's the reason why, initially the process took two hours to run
> and it didn't fully complete. Since my users are not in a Snickers
> commercial, I can hardly expect them to wait that long for this
> process. So I need to make it as fast as possible. I've gone through
> and changed all my CURSORS to select loops (mucho improvement) and
> also dumped #tempTables in favor of table variables (more
> improvement)... and then I added WITH (NOLOCK) on every normal (non
> temp or derrived - ie inner selects) table in all queries... I
> notice more improvement again. I also rearranged a few queries where
> some calculations were done breaking out the data into two parts and
> changed a LEFT JOIN to an INNER JOIN....
> IS the ANY thing else I can do to squeeze some performance out of this
> monster? I haven't run it through profiler yet, but that's the next
> obvious choice.
> The other half of the query is: is it possible to go too far with WITH
> (NOLOCK)? Or is what I've done reasonable?
> =chris
I think th eapproach you should reall ybe taking here is performance
tuning the SQL running in this long running batch. After you've
diagnosed all the SQL and you know things are running as fast as
possible, then start looking at hints as a possible way to improve
performance. As Hugo clearly demonstrates, not all business requirements
can tolerate a NOLOCK hint. Your business needs to decide if this is
tolerable or not.
Regarding your comment: "dumped #tempTables in favor of table variables
(more improvement)". I don't know what your temp/table vars look like,
but temp tables have some major performance advantages with larger data
sets because you can create indexes to support the queries run off the
tables. Also, if you're looping through the temp tables, pulling one row
at a time, use a SELECT TOP 1 to pull in the data for the row. If you're
joining to the temp tables or deleting from them, an index will likely
help.
David Gugick - SQL Server MVP
Quest Software
|||Thanks David & Hugo... pretty much confirmed what I had already suspected. As
far as reading uncomitted data when using nolock, that's not a problem as the
data isn't updated until the very last step. I really wish I had the time to
go back and re-engineer the process properly in VB code rather than in SQL,
but it's a 5yr old process and if I change it now the account managers will
have a fit, and so will the client as they've been waiting long enough as it
is for this "to work" - it works as originaly built, but not like they want
it to be... ah, clients... where would we be w/o them. What I'm finding is
that 6 times out of 10 it's lightning fast... it's the 4 times that takes the
longest (the 4 times will take more time than the 6 did total.)
I'm not sure I could explain the process w/o giving any trade secrets (drat
those NDA's) or w/o making heads explode as I try to explain the industry, so
I won't bore people w/ the details.
Yes, idealy I wish I could do it in batches of select statement but the
business rules are getting in the way - I truly regret building this the way
I did 5 yrs ago... If I only knew then what I know now... but hindsight is
20/20 right?
At any rate, thanks for your help, I'm going to expore the possibility of
converting the process into VB code, and if I can do it in one day (the
project manager is out today) then I might attempt it. Otherwise, it'll just
have to go as it is for now.
Cheers,
Chris
|||On Wed, 1 Mar 2006 07:05:28 -0800, CAnderson wrote:

>Thanks David & Hugo... pretty much confirmed what I had already suspected. As
>far as reading uncomitted data when using nolock, that's not a problem as the
>data isn't updated until the very last step.
Hi Chris,
Not by that process, it isn't. But are you equally sure that no other
users are accessing and changing the data at the same time?
(snip)

>At any rate, thanks for your help, I'm going to expore the possibility of
>converting the process into VB code, and if I can do it in one day (the
>project manager is out today) then I might attempt it. Otherwise, it'll just
>have to go as it is for now.
Good luck. And let us know if you need further assistance!
Hugo Kornelis, SQL Server MVP
|||"Hugo Kornelis" wrote:

> On Wed, 1 Mar 2006 07:05:28 -0800, CAnderson wrote:
>
> Hi Chris,
> Not by that process, it isn't. But are you equally sure that no other
> users are accessing and changing the data at the same time?
>
Positive... The nature of the data being manipulated, as well as standard
business practicess in the industry, practicaly require that only one person
is going to be accessing and updating the data at any given time - even if
the process wasn't being automated.

> (snip)
>
> Good luck. And let us know if you need further assistance!
> --
> Hugo Kornelis, SQL Server MVP
>
I was able to port much of the business logic over to VB, leaving SQL to
just select queries and two action queries.... there was "some" improvement,
but it still isn't where I need to it be... I found several cases where I
was running through some logic where I didn't need to and short-circuited it
on that condition. And then I find out (from the QA dept no less) that the
Proj Manager has decided to ship it as it is with a note that says we are
working on the performance issue. Which means I can now take my time to do
this right rather than slapping it together like I did. Will wonders never
cease.
-Chris

Possible to overuse WITH (NOLOCK)?

I'm working with a process that is initially invoked from VB, but runs
through a set of stored procedures. The first four levels of the calls are
simply gathering data that the other levels below will need and aggregating
some of it. This data is used to determine if further processing is needed o
r
not, and if so, calls the next level. W/o going into too much detail, since
the upper levels are simply data gathering, I've been rather liberal in my
application of WITH (NOLOCK) on virtually every table that is used in the
look up.
Here's the reason why, initially the process took two hours to run and it
didn't fully complete. Since my users are not in a Snickers commercial, I ca
n
hardly expect them to wait that long for this process. So I need to make it
as fast as possible. I've gone through and changed all my CURSORS to select
loops (mucho improvement) and also dumped #tempTables in favor of table
variables (more improvement)... and then I added WITH (NOLOCK) on every
normal (non temp or derrived - ie inner selects) table in all queries... I
notice more improvement again. I also rearranged a few queries where some
calculations were done breaking out the data into two parts and changed a
LEFT JOIN to an INNER JOIN....
IS the ANY thing else I can do to squeeze some performance out of this
monster? I haven't run it through profiler yet, but that's the next obvious
choice.
The other half of the query is: is it possible to go too far with WITH
(NOLOCK)? Or is what I've done reasonable?
=chrisOn Tue, 28 Feb 2006 13:16:26 -0800, CAnderson wrote:

>The other half of the query is: is it possible to go too far with WITH
>(NOLOCK)? Or is what I've done reasonable?
Hi Chris,
I'll start here.
If performance gain is your sole target, you can use this hint freely.
But if you want correct reports, beware. As another poster in this
groups once said it: WITH (NOLOCK) can give you incorrect results at a
blinding speed.
SQL Server will normally lock data that has been changed but not yet
committed. Other queries have to wait for this lock to be released
before they can access the data. With WITH (NOLOCK), you ignore the
lock, which means that you'll read the uncommitted data. This saves lots
of time if there are locks, and it even saves some time if there are no
locks since you bypass the overhead of checking for locks.
But the downside is that you can read uncommitted data. Suppose that I
update a column to one billion dollars negative. Some sanity check in a
trigger will probably catch this and rollback my transaction - but if
your report runs in the periode between my submitting the update and the
trigger rolling it back, your report will be off by a billion dollars.
Another example - suppose a transaction is debiting your account and
crediting mine. Your report runs before my account is credited, but
after yours is debited. Now, the totals on the left-hand side of your
report won't match those on the right-hand side and all bookkeepers,
accountants and controllers in your company will go crazy.

>I've gone through and changed all my CURSORS to select
>loops (mucho improvement) and also dumped #tempTables in favor of table
>variables (more improvement)...
(snip)
>IS the ANY thing else I can do to squeeze some performance out of this
>monster?
Revisit your code. Try to get rid of all cursors, all select loops, all
temp tables and all table variables. SQL Server is optimized for
declarative, set-based processing. All procedural, row-based code (both
cursor and select loop; both temp table and table variable) will almost
always be slower than one single or a short batch of set-based queries.
Check if all your queries use indexes. Add indexes where necessary.
Remove unused indexes. Pay special attention to your choice of clustered
index.
If you need more specific help than this, you'll need to give more
specific information. Check out www.aspfaq.com/5006.
Hugo Kornelis, SQL Server MVP|||CAnderson [MVP] wrote:
> I'm working with a process that is initially invoked from VB, but runs
> through a set of stored procedures. The first four levels of the
> calls are simply gathering data that the other levels below will need
> and aggregating some of it. This data is used to determine if further
> processing is needed or not, and if so, calls the next level. W/o
> going into too much detail, since the upper levels are simply data
> gathering, I've been rather liberal in my application of WITH
> (NOLOCK) on virtually every table that is used in the look up.
> Here's the reason why, initially the process took two hours to run
> and it didn't fully complete. Since my users are not in a Snickers
> commercial, I can hardly expect them to wait that long for this
> process. So I need to make it as fast as possible. I've gone through
> and changed all my CURSORS to select loops (mucho improvement) and
> also dumped #tempTables in favor of table variables (more
> improvement)... and then I added WITH (NOLOCK) on every normal (non
> temp or derrived - ie inner selects) table in all queries... I
> notice more improvement again. I also rearranged a few queries where
> some calculations were done breaking out the data into two parts and
> changed a LEFT JOIN to an INNER JOIN....
> IS the ANY thing else I can do to squeeze some performance out of this
> monster? I haven't run it through profiler yet, but that's the next
> obvious choice.
> The other half of the query is: is it possible to go too far with WITH
> (NOLOCK)? Or is what I've done reasonable?
> =chris
I think th eapproach you should reall ybe taking here is performance
tuning the SQL running in this long running batch. After you've
diagnosed all the SQL and you know things are running as fast as
possible, then start looking at hints as a possible way to improve
performance. As Hugo clearly demonstrates, not all business requirements
can tolerate a NOLOCK hint. Your business needs to decide if this is
tolerable or not.
Regarding your comment: "dumped #tempTables in favor of table variables
(more improvement)". I don't know what your temp/table vars look like,
but temp tables have some major performance advantages with larger data
sets because you can create indexes to support the queries run off the
tables. Also, if you're looping through the temp tables, pulling one row
at a time, use a SELECT TOP 1 to pull in the data for the row. If you're
joining to the temp tables or deleting from them, an index will likely
help.
David Gugick - SQL Server MVP
Quest Software|||Thanks David & Hugo... pretty much confirmed what I had already suspected. A
s
far as reading uncomitted data when using nolock, that's not a problem as th
e
data isn't updated until the very last step. I really wish I had the time to
go back and re-engineer the process properly in VB code rather than in SQL,
but it's a 5yr old process and if I change it now the account managers will
have a fit, and so will the client as they've been waiting long enough as it
is for this "to work" - it works as originaly built, but not like they want
it to be... ah, clients... where would we be w/o them. What I'm finding is
that 6 times out of 10 it's lightning fast... it's the 4 times that takes th
e
longest (the 4 times will take more time than the 6 did total.)
I'm not sure I could explain the process w/o giving any trade secrets (drat
those NDA's) or w/o making heads explode as I try to explain the industry, s
o
I won't bore people w/ the details.
Yes, idealy I wish I could do it in batches of select statement but the
business rules are getting in the way - I truly regret building this the way
I did 5 yrs ago... If I only knew then what I know now... but hindsight is
20/20 right?
At any rate, thanks for your help, I'm going to expore the possibility of
converting the process into VB code, and if I can do it in one day (the
project manager is out today) then I might attempt it. Otherwise, it'll just
have to go as it is for now.
Cheers,
Chris|||On Wed, 1 Mar 2006 07:05:28 -0800, CAnderson wrote:

>Thanks David & Hugo... pretty much confirmed what I had already suspected.
As
>far as reading uncomitted data when using nolock, that's not a problem as t
he
>data isn't updated until the very last step.
Hi Chris,
Not by that process, it isn't. But are you equally sure that no other
users are accessing and changing the data at the same time?
(snip)

>At any rate, thanks for your help, I'm going to expore the possibility of
>converting the process into VB code, and if I can do it in one day (the
>project manager is out today) then I might attempt it. Otherwise, it'll jus
t
>have to go as it is for now.
Good luck. And let us know if you need further assistance!
Hugo Kornelis, SQL Server MVP|||"Hugo Kornelis" wrote:

> On Wed, 1 Mar 2006 07:05:28 -0800, CAnderson wrote:
>
> Hi Chris,
> Not by that process, it isn't. But are you equally sure that no other
> users are accessing and changing the data at the same time?
>
Positive... The nature of the data being manipulated, as well as standard
business practicess in the industry, practicaly require that only one person
is going to be accessing and updating the data at any given time - even if
the process wasn't being automated.

> (snip)
>
> Good luck. And let us know if you need further assistance!
> --
> Hugo Kornelis, SQL Server MVP
>
I was able to port much of the business logic over to VB, leaving SQL to
just select queries and two action queries.... there was "some" improvement
,
but it still isn't where I need to it be... I found several cases where I
was running through some logic where I didn't need to and short-circuited it
on that condition. And then I find out (from the QA dept no less) that the
Proj Manager has decided to ship it as it is with a note that says we are
working on the performance issue. Which means I can now take my time to do
this right rather than slapping it together like I did. Will wonders never
cease.
-Chris

Possible to overuse WITH (NOLOCK)?

I'm working with a process that is initially invoked from VB, but runs
through a set of stored procedures. The first four levels of the calls are
simply gathering data that the other levels below will need and aggregating
some of it. This data is used to determine if further processing is needed or
not, and if so, calls the next level. W/o going into too much detail, since
the upper levels are simply data gathering, I've been rather liberal in my
application of WITH (NOLOCK) on virtually every table that is used in the
look up.
Here's the reason why, initially the process took two hours to run and it
didn't fully complete. Since my users are not in a Snickers commercial, I can
hardly expect them to wait that long for this process. So I need to make it
as fast as possible. I've gone through and changed all my CURSORS to select
loops (mucho improvement) and also dumped #tempTables in favor of table
variables (more improvement)... and then I added WITH (NOLOCK) on every
normal (non temp or derrived - ie inner selects) table in all queries... I
notice more improvement again. I also rearranged a few queries where some
calculations were done breaking out the data into two parts and changed a
LEFT JOIN to an INNER JOIN....
IS the ANY thing else I can do to squeeze some performance out of this
monster? I haven't run it through profiler yet, but that's the next obvious
choice.
The other half of the query is: is it possible to go too far with WITH
(NOLOCK)? Or is what I've done reasonable?
=chrisOn Tue, 28 Feb 2006 13:16:26 -0800, CAnderson wrote:
>The other half of the query is: is it possible to go too far with WITH
>(NOLOCK)? Or is what I've done reasonable?
Hi Chris,
I'll start here.
If performance gain is your sole target, you can use this hint freely.
But if you want correct reports, beware. As another poster in this
groups once said it: WITH (NOLOCK) can give you incorrect results at a
blinding speed.
SQL Server will normally lock data that has been changed but not yet
committed. Other queries have to wait for this lock to be released
before they can access the data. With WITH (NOLOCK), you ignore the
lock, which means that you'll read the uncommitted data. This saves lots
of time if there are locks, and it even saves some time if there are no
locks since you bypass the overhead of checking for locks.
But the downside is that you can read uncommitted data. Suppose that I
update a column to one billion dollars negative. Some sanity check in a
trigger will probably catch this and rollback my transaction - but if
your report runs in the periode between my submitting the update and the
trigger rolling it back, your report will be off by a billion dollars.
Another example - suppose a transaction is debiting your account and
crediting mine. Your report runs before my account is credited, but
after yours is debited. Now, the totals on the left-hand side of your
report won't match those on the right-hand side and all bookkeepers,
accountants and controllers in your company will go crazy.
>I've gone through and changed all my CURSORS to select
>loops (mucho improvement) and also dumped #tempTables in favor of table
>variables (more improvement)...
(snip)
>IS the ANY thing else I can do to squeeze some performance out of this
>monster?
Revisit your code. Try to get rid of all cursors, all select loops, all
temp tables and all table variables. SQL Server is optimized for
declarative, set-based processing. All procedural, row-based code (both
cursor and select loop; both temp table and table variable) will almost
always be slower than one single or a short batch of set-based queries.
Check if all your queries use indexes. Add indexes where necessary.
Remove unused indexes. Pay special attention to your choice of clustered
index.
If you need more specific help than this, you'll need to give more
specific information. Check out www.aspfaq.com/5006.
--
Hugo Kornelis, SQL Server MVP|||CAnderson [MVP] wrote:
> I'm working with a process that is initially invoked from VB, but runs
> through a set of stored procedures. The first four levels of the
> calls are simply gathering data that the other levels below will need
> and aggregating some of it. This data is used to determine if further
> processing is needed or not, and if so, calls the next level. W/o
> going into too much detail, since the upper levels are simply data
> gathering, I've been rather liberal in my application of WITH
> (NOLOCK) on virtually every table that is used in the look up.
> Here's the reason why, initially the process took two hours to run
> and it didn't fully complete. Since my users are not in a Snickers
> commercial, I can hardly expect them to wait that long for this
> process. So I need to make it as fast as possible. I've gone through
> and changed all my CURSORS to select loops (mucho improvement) and
> also dumped #tempTables in favor of table variables (more
> improvement)... and then I added WITH (NOLOCK) on every normal (non
> temp or derrived - ie inner selects) table in all queries... I
> notice more improvement again. I also rearranged a few queries where
> some calculations were done breaking out the data into two parts and
> changed a LEFT JOIN to an INNER JOIN....
> IS the ANY thing else I can do to squeeze some performance out of this
> monster? I haven't run it through profiler yet, but that's the next
> obvious choice.
> The other half of the query is: is it possible to go too far with WITH
> (NOLOCK)? Or is what I've done reasonable?
> =chris
I think th eapproach you should reall ybe taking here is performance
tuning the SQL running in this long running batch. After you've
diagnosed all the SQL and you know things are running as fast as
possible, then start looking at hints as a possible way to improve
performance. As Hugo clearly demonstrates, not all business requirements
can tolerate a NOLOCK hint. Your business needs to decide if this is
tolerable or not.
Regarding your comment: "dumped #tempTables in favor of table variables
(more improvement)". I don't know what your temp/table vars look like,
but temp tables have some major performance advantages with larger data
sets because you can create indexes to support the queries run off the
tables. Also, if you're looping through the temp tables, pulling one row
at a time, use a SELECT TOP 1 to pull in the data for the row. If you're
joining to the temp tables or deleting from them, an index will likely
help.
David Gugick - SQL Server MVP
Quest Software|||Thanks David & Hugo... pretty much confirmed what I had already suspected. As
far as reading uncomitted data when using nolock, that's not a problem as the
data isn't updated until the very last step. I really wish I had the time to
go back and re-engineer the process properly in VB code rather than in SQL,
but it's a 5yr old process and if I change it now the account managers will
have a fit, and so will the client as they've been waiting long enough as it
is for this "to work" - it works as originaly built, but not like they want
it to be... ah, clients... where would we be w/o them. What I'm finding is
that 6 times out of 10 it's lightning fast... it's the 4 times that takes the
longest (the 4 times will take more time than the 6 did total.)
I'm not sure I could explain the process w/o giving any trade secrets (drat
those NDA's) or w/o making heads explode as I try to explain the industry, so
I won't bore people w/ the details.
Yes, idealy I wish I could do it in batches of select statement but the
business rules are getting in the way - I truly regret building this the way
I did 5 yrs ago... If I only knew then what I know now... but hindsight is
20/20 right?
At any rate, thanks for your help, I'm going to expore the possibility of
converting the process into VB code, and if I can do it in one day (the
project manager is out today) then I might attempt it. Otherwise, it'll just
have to go as it is for now.
Cheers,
Chris|||On Wed, 1 Mar 2006 07:05:28 -0800, CAnderson wrote:
>Thanks David & Hugo... pretty much confirmed what I had already suspected. As
>far as reading uncomitted data when using nolock, that's not a problem as the
>data isn't updated until the very last step.
Hi Chris,
Not by that process, it isn't. But are you equally sure that no other
users are accessing and changing the data at the same time?
(snip)
>At any rate, thanks for your help, I'm going to expore the possibility of
>converting the process into VB code, and if I can do it in one day (the
>project manager is out today) then I might attempt it. Otherwise, it'll just
>have to go as it is for now.
Good luck. And let us know if you need further assistance!
--
Hugo Kornelis, SQL Server MVP|||"Hugo Kornelis" wrote:
> On Wed, 1 Mar 2006 07:05:28 -0800, CAnderson wrote:
> >Thanks David & Hugo... pretty much confirmed what I had already suspected. As
> >far as reading uncomitted data when using nolock, that's not a problem as the
> >data isn't updated until the very last step.
> Hi Chris,
> Not by that process, it isn't. But are you equally sure that no other
> users are accessing and changing the data at the same time?
>
Positive... The nature of the data being manipulated, as well as standard
business practicess in the industry, practicaly require that only one person
is going to be accessing and updating the data at any given time - even if
the process wasn't being automated.
> (snip)
> >At any rate, thanks for your help, I'm going to expore the possibility of
> >converting the process into VB code, and if I can do it in one day (the
> >project manager is out today) then I might attempt it. Otherwise, it'll just
> >have to go as it is for now.
> Good luck. And let us know if you need further assistance!
> --
> Hugo Kornelis, SQL Server MVP
>
I was able to port much of the business logic over to VB, leaving SQL to
just select queries and two action queries.... there was "some" improvement,
but it still isn't where I need to it be... I found several cases where I
was running through some logic where I didn't need to and short-circuited it
on that condition. And then I find out (from the QA dept no less) that the
Proj Manager has decided to ship it as it is with a note that says we are
working on the performance issue. Which means I can now take my time to do
this right rather than slapping it together like I did. Will wonders never
cease.
-Chris

Wednesday, March 7, 2012

Possible to add a Flash Player control to a report?

I'm working on a project where the client wants us to create custom charts which have features not found in the standard Reporting Services charts. I would like to use flash to build this and have found an existing flash charting package for which I have the code and which I plan to expand.

Here's the problem:

The client wants to include these charts in his Reports. Is there some way to add a flash control to a report so that it will appear on the web page as a fully-functional flash presentation, which can then be included when printing or exporting?

The alternative, would be to figure out some means of generating the chart using flash outside of the report, exporting a bitmap of the chart and then saving the bitmap to a known location on the file system so It can be referenced by a report. This has some serious complications, and may not be feasible.

Any ideas?

Embedding flash into reports is not supported. While there are several third party advanced charting packages available which specifically integrate with SSRS2005 Standard, Enterprise, or Developer editions (based on the CustomReportItem extensibility feature), they also cannot use flash because it is currently not supported.

-- Robert

Saturday, February 25, 2012

Possible Corrupt Table

I have 1 table in a 200+ table database
The database is Merge Synchornised and has been working fine for 2
years +
The same database is at several customers and the DB is fully
relational

I have a table which creates client timeout errors whenever an insert
or update is issued

The table has foreign keys and primary key and links parent to
children tables so if I need to recreate the table I will also need
advice on the best way to do this to keep the integrity of the
database

I wasn't sure the table was the problem so I deleted all publications
and disbled the server from being a distributor

I cannot find any error logs with any clues so can only assume the is
the first corruption I have ever seen on SQL 2K (SP3)

I have defragmented the drive, reindexed the tables, shrunk databases
(Plenty of space available)

Please advise any course of action you think may help me.

Regards Paul Goldney[posted and mailed, please reply in news]

paul goldney (paulg@.wizardit.co.uk) writes:
> I have a table which creates client timeout errors whenever an insert
> or update is issued

There is very little information to work from in your post.

If you really suspect corruption, run DBCC CHECKTABLE on the table.

However, I would suggest that there two other possibilities which
are much more likely:

1) There are triggers on the table, and which are poorly implemented
and takes long time to execute.
2) There is a blocking issue. The latter can be investigated by
running sp_who while waiting for the INSERT statement to complete.
If you see a non-zero value in the Blk column that column is blocking
the spid on that row.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp