Showing posts with label sp3. Show all posts
Showing posts with label sp3. Show all posts

Wednesday, March 28, 2012

More Materialized View questions

sql2k sp3
Im having a really hard time getting my head into
Materialized Views.
Accoring to BOL:
When a unique clustered index is created on a view, the
view is executed and the result set is stored in the
database in the same way a table with a clustered index is
stored.
Now this sounds good and makes sense. However, say I have
a Materialized View:
create view MatTest
as
select * from table1
Create unique clustered index... on MatTest(Column1)
So, if Im reading BOL correctly, the results are stored in
the DB already. But then what happens when I am selecting
from my view and put a WHERE clause on the SELECT?
select * from MatTest
where column1 = bla
and column2 = bla
Wouldn't the view then have to rebuild the results just
like a normal query would?
Also, (dont know if I would do this one, just curious)
what if I want to use Dynamic SQL to call my view from an
SP and be able to feed in Parameters? Is the clustered
index still used?
Thanks to all for your insights.
TIA, ChrisRChris,
Let's say we have the following non-materialized view:
CREATE VIEW NonMaterialized
AS
SELECT TblA.ColA, TblB.ColB
FROM TblA
JOIN TblB ON TblA.PK = TblB.PK
When you run a query against the view, e.g.:
SELECT *
FROM NonMaterialized
WHERE ColA = 5
What really happens is that your query is re-written first as:
SELECT *
FROM
(SELECT TblA.ColA, TblB.ColB
FROM TblA
JOIN TblB ON TblA.PK = TblB.PK) AS NonMaterialized
WHERE ColA = 5
And then most likely optimized into:
SELECT TblA.ColA, TblB.ColB
FROM TblA
JOIN TblB ON TblA.PK = TblB.PK
WHERE ColA = 5
So using this view, you still do all of the work, at query time, as you
would selecting from the base tables.
Now, assume that we've materialized the view. SQL Server now stores the
entire results of the view in the same way that it stores table data. So
when you exercise this query:
SELECT *
FROM Materialized
WHERE ColA = 5
There are no base tables to JOIN. This query can use indexes directly
against the view, as if it were a base table itself.
Does that make more sense?
"ChrisR" <anonymous@.discussions.microsoft.com> wrote in message
news:8f7a01c49680$3eb535e0$a301280a@.phx.gbl...
> sql2k sp3
> Im having a really hard time getting my head into
> Materialized Views.
> Accoring to BOL:
> When a unique clustered index is created on a view, the
> view is executed and the result set is stored in the
> database in the same way a table with a clustered index is
> stored.
>
> Now this sounds good and makes sense. However, say I have
> a Materialized View:
> create view MatTest
> as
> select * from table1
> Create unique clustered index... on MatTest(Column1)
>
> So, if Im reading BOL correctly, the results are stored in
> the DB already. But then what happens when I am selecting
> from my view and put a WHERE clause on the SELECT?
> select * from MatTest
> where column1 = bla
> and column2 = bla
> Wouldn't the view then have to rebuild the results just
> like a normal query would?
> Also, (dont know if I would do this one, just curious)
> what if I want to use Dynamic SQL to call my view from an
> SP and be able to feed in Parameters? Is the clustered
> index still used?
>
> Thanks to all for your insights.
> TIA, ChrisR
>|||Perfect. Thats what I was missing. Also, BOL doesnt metion
needing Enterprise Ed to use these, but I seem to recall
reading that its a must. Do you know?
>--Original Message--
>Chris,
>Let's say we have the following non-materialized view:
>CREATE VIEW NonMaterialized
>AS
> SELECT TblA.ColA, TblB.ColB
> FROM TblA
> JOIN TblB ON TblA.PK = TblB.PK
>When you run a query against the view, e.g.:
>SELECT *
>FROM NonMaterialized
>WHERE ColA = 5
>What really happens is that your query is re-written
first as:
>SELECT *
>FROM
> (SELECT TblA.ColA, TblB.ColB
> FROM TblA
> JOIN TblB ON TblA.PK = TblB.PK) AS NonMaterialized
>WHERE ColA = 5
>And then most likely optimized into:
>SELECT TblA.ColA, TblB.ColB
> FROM TblA
> JOIN TblB ON TblA.PK = TblB.PK
> WHERE ColA = 5
>So using this view, you still do all of the work, at
query time, as you
>would selecting from the base tables.
>Now, assume that we've materialized the view. SQL Server
now stores the
>entire results of the view in the same way that it stores
table data. So
>when you exercise this query:
>SELECT *
>FROM Materialized
>WHERE ColA = 5
>There are no base tables to JOIN. This query can use
indexes directly
>against the view, as if it were a base table itself.
>Does that make more sense?
>
>"ChrisR" <anonymous@.discussions.microsoft.com> wrote in
message
>news:8f7a01c49680$3eb535e0$a301280a@.phx.gbl...
>> sql2k sp3
>> Im having a really hard time getting my head into
>> Materialized Views.
>> Accoring to BOL:
>> When a unique clustered index is created on a view, the
>> view is executed and the result set is stored in the
>> database in the same way a table with a clustered index
is
>> stored.
>>
>> Now this sounds good and makes sense. However, say I
have
>> a Materialized View:
>> create view MatTest
>> as
>> select * from table1
>> Create unique clustered index... on MatTest(Column1)
>>
>> So, if Im reading BOL correctly, the results are stored
in
>> the DB already. But then what happens when I am
selecting
>> from my view and put a WHERE clause on the SELECT?
>> select * from MatTest
>> where column1 = bla
>> and column2 = bla
>> Wouldn't the view then have to rebuild the results just
>> like a normal query would?
>> Also, (dont know if I would do this one, just curious)
>> what if I want to use Dynamic SQL to call my view from
an
>> SP and be able to feed in Parameters? Is the clustered
>> index still used?
>>
>> Thanks to all for your insights.
>> TIA, ChrisR
>
>.
>|||"ChrisR" <anonymous@.discussions.microsoft.com> wrote in message
news:8f3001c49686$bc967ea0$a501280a@.phx.gbl...
> Perfect. Thats what I was missing. Also, BOL doesnt metion
> needing Enterprise Ed to use these, but I seem to recall
> reading that its a must. Do you know?
No, I have indexed views running on Standard Edition servers. I believe
that the restriction is that Standard Edition will not automatically
consider them when you query base tables. For instance, if you created this
view:
CREATE VIEW AView
AS
SELECT ColA, COUNT_BIG(*) AS RowCount
FROM dbo.YourTableA
GROUP BY ColA
... and then you materialized it, and then you did the following query:
SELECT ColA, COUNT(*) AS RowCount
FROM dbo.YourTableA
WHERE ColA = 'ABC'
GROUP BY ColA
Enterprise Edition will actually be able to automatically use AView to
answer the query. In Standard Edition, to use the view, you'd have to do:
SELECT ColA, RowCount
FROM AView|||Yes you need EE for the view to be used automatically. Otherwise you must
specify the NOEXPAND hint.
--
Andrew J. Kelly SQL MVP
"ChrisR" <anonymous@.discussions.microsoft.com> wrote in message
news:8f3001c49686$bc967ea0$a501280a@.phx.gbl...
> Perfect. Thats what I was missing. Also, BOL doesnt metion
> needing Enterprise Ed to use these, but I seem to recall
> reading that its a must. Do you know?
>
> >--Original Message--
> >Chris,
> >
> >Let's say we have the following non-materialized view:
> >
> >CREATE VIEW NonMaterialized
> >AS
> > SELECT TblA.ColA, TblB.ColB
> > FROM TblA
> > JOIN TblB ON TblA.PK = TblB.PK
> >
> >When you run a query against the view, e.g.:
> >
> >SELECT *
> >FROM NonMaterialized
> >WHERE ColA = 5
> >
> >What really happens is that your query is re-written
> first as:
> >
> >SELECT *
> >FROM
> > (SELECT TblA.ColA, TblB.ColB
> > FROM TblA
> > JOIN TblB ON TblA.PK = TblB.PK) AS NonMaterialized
> >WHERE ColA = 5
> >
> >And then most likely optimized into:
> >
> >SELECT TblA.ColA, TblB.ColB
> > FROM TblA
> > JOIN TblB ON TblA.PK = TblB.PK
> > WHERE ColA = 5
> >
> >So using this view, you still do all of the work, at
> query time, as you
> >would selecting from the base tables.
> >
> >Now, assume that we've materialized the view. SQL Server
> now stores the
> >entire results of the view in the same way that it stores
> table data. So
> >when you exercise this query:
> >
> >SELECT *
> >FROM Materialized
> >WHERE ColA = 5
> >
> >There are no base tables to JOIN. This query can use
> indexes directly
> >against the view, as if it were a base table itself.
> >
> >Does that make more sense?
> >
> >
> >"ChrisR" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:8f7a01c49680$3eb535e0$a301280a@.phx.gbl...
> >> sql2k sp3
> >>
> >> Im having a really hard time getting my head into
> >> Materialized Views.
> >>
> >> Accoring to BOL:
> >>
> >> When a unique clustered index is created on a view, the
> >> view is executed and the result set is stored in the
> >> database in the same way a table with a clustered index
> is
> >> stored.
> >>
> >>
> >> Now this sounds good and makes sense. However, say I
> have
> >> a Materialized View:
> >>
> >> create view MatTest
> >> as
> >> select * from table1
> >>
> >> Create unique clustered index... on MatTest(Column1)
> >>
> >>
> >> So, if Im reading BOL correctly, the results are stored
> in
> >> the DB already. But then what happens when I am
> selecting
> >> from my view and put a WHERE clause on the SELECT?
> >>
> >> select * from MatTest
> >> where column1 = bla
> >> and column2 = bla
> >>
> >> Wouldn't the view then have to rebuild the results just
> >> like a normal query would?
> >>
> >> Also, (dont know if I would do this one, just curious)
> >> what if I want to use Dynamic SQL to call my view from
> an
> >> SP and be able to feed in Parameters? Is the clustered
> >> index still used?
> >>
> >>
> >> Thanks to all for your insights.
> >>
> >> TIA, ChrisR
> >>
> >
> >
> >.
> >

Friday, March 9, 2012

Monitoring

Hi ,
Is there a way/tool in Sql Server 2000 SP3 to
monitor all activities going on in the Database ?
For example, I first create an empty database.
Then I have an ERWIN generated DDL to create
all views and tables. After that, I have INSERT
scripts that populate all the base tables. What I
want to monitor is success or failure for each
script.

Thanks,
N.N (N@.N.COM) writes:
> Is there a way/tool in Sql Server 2000 SP3 to
> monitor all activities going on in the Database ?
> For example, I first create an empty database.
> Then I have an ERWIN generated DDL to create
> all views and tables. After that, I have INSERT
> scripts that populate all the base tables. What I
> want to monitor is success or failure for each
> script.

The tool you are looking for is the Profiler. Look in the SQL Server
program group.

However, to check the output from build scripts, I think it's best to
save the log, and then search the output for the string "Msg".

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"N" <N@.N.COM> wrote in message news:<17xUb.21778$_f.2385@.newssvr25.news.prodigy.com>...
> Hi ,
> Is there a way/tool in Sql Server 2000 SP3 to
> monitor all activities going on in the Database ?
> For example, I first create an empty database.
> Then I have an ERWIN generated DDL to create
> all views and tables. After that, I have INSERT
> scripts that populate all the base tables. What I
> want to monitor is success or failure for each
> script.
> Thanks,
> N.

You can use Profiler to view all SQL being sent to the database, but
it sounds like you want to add error handling to your scripts? How to
do that would depend how you run the scripts - eg. if you're using
osql, then -r might be useful. Perhaps if you can give some extra
information about how you call the scripts, and an example of the
code, then someone may be able to suggest something specific.

Simon

Monday, February 20, 2012

MOM 2005 Reporting error

Hi

I m using MOM 2005 SP1 FR with MSSQL 2000 SP3 and i get this error on one of my reports :

Erreur de Reporting Services
--
Une erreur s'est produite lors du traitement du rapport. (rsProcessingAborted) Obtenir de l'aide en ligne
Impossible de lire la ligne de donnes suivante pour le dataset PerfAnalysis. (rsErrorReadingNextDataRow) Obtenir de l'aide en ligne
La conversion d'un type de donnes CHAR en type DATETIME a donn une valeur hors des limites des valeurs de date et d'heure.

--
Microsoft Reporting Services

What can i do, i think i must edit xml file ?

Regards.

I have exactly the same problem !
Did anyone have an idea ?

Regards.

MOM 2005 Reporting error

Hi

I m using MOM 2005 SP1 FR with MSSQL 2000 SP3 and i get this error on one of my reports :

Erreur de Reporting Services
--
Une erreur s'est produite lors du traitement du rapport. (rsProcessingAborted) Obtenir de l'aide en ligne
Impossible de lire la ligne de donnes suivante pour le dataset PerfAnalysis. (rsErrorReadingNextDataRow) Obtenir de l'aide en ligne
La conversion d'un type de donnes CHAR en type DATETIME a donn une valeur hors des limites des valeurs de date et d'heure.

--
Microsoft Reporting Services

What can i do, i think i must edit xml file ?

Regards.

I have exactly the same problem !
Did anyone have an idea ?

Regards.

MOM 2005 Reporting

I'm trying to install the Mom Reporting service, My MOM 2005 (W2k3 w/sp1)
server also hosts the sql database (sql2000 w/sp3). While running the
install for the reporting services I get this error.
Failed to create data source for data warehouse, check to make sure you can
access the SQL services reporting server. (This is also hosted locally on
the mom server). Error code 2147467259.
Any one have any clues? I am NOT installing the report services to the same
folder as the mom2005 folder per microsoft. Any suggestions or guidance is
greatly appreciated.
Vid
--== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==--
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
--= East and West-Coast Server Farms - Total Privacy via Encryption =--Check your system requirements! 2003 SP1 is not mentioned, only 2003 RTM.
I had to:
1. uninstall SP1.
2. uninstall MOM web console
3. uninstall SRS
4. uninstall Application Services (IIS, ASP, etc.)
5. reinstall Application Services
6. reinstall MOM web console
7. reinstall SRS
8. reinstall MOM reporting services
Early indications are that this seems to have corrected the problem. Your
mileage may vary.
"dave@.xrxdc.com" wrote:
> I'm trying to install the Mom Reporting service, My MOM 2005 (W2k3 w/sp1)
> server also hosts the sql database (sql2000 w/sp3). While running the
> install for the reporting services I get this error.
> Failed to create data source for data warehouse, check to make sure you can
> access the SQL services reporting server. (This is also hosted locally on
> the mom server). Error code 2147467259.
> Any one have any clues? I am NOT installing the report services to the same
> folder as the mom2005 folder per microsoft. Any suggestions or guidance is
> greatly appreciated.
> Vid
> --== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==--
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
> --= East and West-Coast Server Farms - Total Privacy via Encryption =--
>|||Were you able to successfully install the MOM database itself? MOM is rather
picky when it comes to the order in which things are installed...
(1) Install MOM database after installing SQL 2000 w/SP3a
(2) Install MOM application
(3) Install SQL Reporting
As with previous reply - your mileage will vary.
"JerryW" wrote:
> Check your system requirements! 2003 SP1 is not mentioned, only 2003 RTM.
> I had to:
> 1. uninstall SP1.
> 2. uninstall MOM web console
> 3. uninstall SRS
> 4. uninstall Application Services (IIS, ASP, etc.)
> 5. reinstall Application Services
> 6. reinstall MOM web console
> 7. reinstall SRS
> 8. reinstall MOM reporting services
> Early indications are that this seems to have corrected the problem. Your
> mileage may vary.
>
> --
> "dave@.xrxdc.com" wrote:
> > I'm trying to install the Mom Reporting service, My MOM 2005 (W2k3 w/sp1)
> > server also hosts the sql database (sql2000 w/sp3). While running the
> > install for the reporting services I get this error.
> > Failed to create data source for data warehouse, check to make sure you can
> > access the SQL services reporting server. (This is also hosted locally on
> > the mom server). Error code 2147467259.
> >
> > Any one have any clues? I am NOT installing the report services to the same
> > folder as the mom2005 folder per microsoft. Any suggestions or guidance is
> > greatly appreciated.
> >
> > Vid
> >
> > --== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==--
> > http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
> > --= East and West-Coast Server Farms - Total Privacy via Encryption =--
> >