显示标签为“available”的博文。显示所有博文
显示标签为“available”的博文。显示所有博文

2012年3月27日星期二

Flattening the data (denormalizing)

Hello all,
What are the considerations to take if i have to flatten (denormalize) the data?
Is there any guidelines or documentation available in net?
Any lead on this is highly appreciated.
Thank you,
VenugopalHi Venugopal,

The decision to denomalise and which columns to include / repeat depends on the kind of queries you would run on your data. The aim should be to minimise joins to improve performance.

You might want to also revise the rationale for the normal forms once, to decide your candidates for denormailsation and the type of denormalisation to be applied to each.

Regards.|||Here's another trick (see link) you can try before denormalising along:

http://www.sqlservercentral.com/columnists/chedgate/indexedviews.asp

Also take a look at these articles,

http://dmreview.com/master.cfm?NavID=193&EdID=5251

http://dmreview.com/master.cfm?NavID=55&EdID=5337

Flatten out an XML Document (Currently using OPENXML)

I am attempting to take a column with an XML datatype and make it available for reporting with as little code as possible. Specifically, we are storing credit report info in a column that has an XML datatype. We are using the OPENXML command to navigate the XML structure:

DECLARE @.idoc int
DECLARE @.doc xml
SET @.doc = 'GET THE XML COLUMN HERE
EXEC sp_xml_preparedocument @.idoc OUTPUT, @.doc

SELECT *
FROM OPENXML (@.idoc, '/XML_INTERFACE/CREDITREPORT/OBJECTS/DBCOMMCREDITSCORE',2)
WITH (
Rating varchar(10) 'DBRATING',
OverFlow xml '@.mp:xmltext')
EXEC sp_xml_removedocument @.idoc

The result will be a column that shows the Rating field and an Overflow column that shows the XML string.

I can take the above code and put it in a stored procedure to return the values in a flat format. My questions:

    Does anyone know how I can use a view to display the information? (Create View cannot have the above statements. Is there a way to create a tabular representation off of the SP result set, etc.)
    Does anyone have a better way of taking an XML datatype and making this available for report writers?
Dan O

1. The XQuery "nodes()" function will work for this. It is similar to OPENXML, but it is just used from within a normal SELECT statement, so you could create views on top of it.

Here is an example using the nodes() function on the xml data type.

http://msdn2.microsoft.com/en-us/ms188282.aspx

2. nodes() seems like the way to go, but you could also try pre-shredding the xml into a more convenient relational structure if your XML has a lot of nesting that would require many joins to reassemble.

2012年3月11日星期日

FIX: AWE and SQL Server 2000 SP4 (899761)

FIX: Not all memory is available when AWE is enabled on a computer that is
running a 32-bit version of SQL Server 2000 SP4 (899761)
http://www.microsoft.com/downloads/details.aspx?familyid=7c407047-3f1f-48b8-9e4c-dc32875e1961&displaylang=en
This issue only impacts customers with more than 2GB of memory (available
only with the Enterprise, Developer and Evaluation editions) where AWE has
been enabled and more than half of the total system memory is being
allocated to a single SQL Server instance.
Customers with this configuration should apply this hotfix after upgrading
to SQL Server 2000 Service Pack 4.
KB 899761 http://support.microsoft.com/default.aspx?scid=KB;en-us;899761
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.orgThanks Jasper.
Is there any central resouce for sql server hot fixes?
Paul
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:%23VwCMVMdFHA.412@.tk2msftngp13.phx.gbl...
> FIX: Not all memory is available when AWE is enabled on a computer that is
> running a 32-bit version of SQL Server 2000 SP4 (899761)
> http://www.microsoft.com/downloads/details.aspx?familyid=7c407047-3f1f-48b8-9e4c-dc32875e1961&displaylang=en
> This issue only impacts customers with more than 2GB of memory (available
> only with the Enterprise, Developer and Evaluation editions) where AWE has
> been enabled and more than half of the total system memory is being
> allocated to a single SQL Server instance.
> Customers with this configuration should apply this hotfix after upgrading
> to SQL Server 2000 Service Pack 4.
> KB 899761 http://support.microsoft.com/default.aspx?scid=KB;en-us;899761
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
>|||Hi
For a list, you can find it here.
http://www.aspfaq.com/show.asp?id=2160
For some reason, it has not been updated to the latest fixes yet.
Cheers
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Paul Cahill" <nospam@.hotmail.com> wrote in message
news:Oyu$31QdFHA.1684@.TK2MSFTNGP09.phx.gbl...
> Thanks Jasper.
> Is there any central resouce for sql server hot fixes?
> Paul
> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
> news:%23VwCMVMdFHA.412@.tk2msftngp13.phx.gbl...
>> FIX: Not all memory is available when AWE is enabled on a computer that
>> is running a 32-bit version of SQL Server 2000 SP4 (899761)
>> http://www.microsoft.com/downloads/details.aspx?familyid=7c407047-3f1f-48b8-9e4c-dc32875e1961&displaylang=en
>> This issue only impacts customers with more than 2GB of memory (available
>> only with the Enterprise, Developer and Evaluation editions) where AWE
>> has been enabled and more than half of the total system memory is being
>> allocated to a single SQL Server instance.
>> Customers with this configuration should apply this hotfix after
>> upgrading to SQL Server 2000 Service Pack 4.
>> KB 899761 http://support.microsoft.com/default.aspx?scid=KB;en-us;899761
>> --
>> HTH
>> Jasper Smith (SQL Server MVP)
>> http://www.sqldbatips.com
>> I support PASS - the definitive, global
>> community for SQL Server professionals -
>> http://www.sqlpass.org
>>
>|||Thanks Mike.
Paul
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:euYYVbRdFHA.1384@.TK2MSFTNGP09.phx.gbl...
> Hi
> For a list, you can find it here.
> http://www.aspfaq.com/show.asp?id=2160
> For some reason, it has not been updated to the latest fixes yet.
> Cheers
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Paul Cahill" <nospam@.hotmail.com> wrote in message
> news:Oyu$31QdFHA.1684@.TK2MSFTNGP09.phx.gbl...
>> Thanks Jasper.
>> Is there any central resouce for sql server hot fixes?
>> Paul
>> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
>> news:%23VwCMVMdFHA.412@.tk2msftngp13.phx.gbl...
>> FIX: Not all memory is available when AWE is enabled on a computer that
>> is running a 32-bit version of SQL Server 2000 SP4 (899761)
>> http://www.microsoft.com/downloads/details.aspx?familyid=7c407047-3f1f-48b8-9e4c-dc32875e1961&displaylang=en
>> This issue only impacts customers with more than 2GB of memory
>> (available only with the Enterprise, Developer and Evaluation editions)
>> where AWE has been enabled and more than half of the total system memory
>> is being allocated to a single SQL Server instance.
>> Customers with this configuration should apply this hotfix after
>> upgrading to SQL Server 2000 Service Pack 4.
>> KB 899761 http://support.microsoft.com/default.aspx?scid=KB;en-us;899761
>> --
>> HTH
>> Jasper Smith (SQL Server MVP)
>> http://www.sqldbatips.com
>> I support PASS - the definitive, global
>> community for SQL Server professionals -
>> http://www.sqlpass.org
>>
>>
>|||Mike Epprecht (SQL MVP) wrote:
> For a list, you can find it here:
> http://www.aspfaq.com/show.asp=AD?id=3D2160
> For some reason, it has not been updated to the latest fixes yet.
An updated list, containing only the build numbers for SQL Server 2000,
can be found at:
http://www.aspfaq.com/sql2000builds.asp
Razvan