Showing posts with label 2k5. Show all posts
Showing posts with label 2k5. Show all posts

Saturday, February 25, 2012

A quicker way of performing this XML query?

Hi all

I have the following query that makes up part of a table-value-function i've written in SQL 2K5.

XML Query


SELECT CONVERT(XML, objectdata).value('(/xmlData/IsTrue)[1]', 'bit') as IsTrue
from myTable
where idfield = [@.FunctionTable].ID


Until adding this query, the function ran in under 60 seconds. Adding this query has added an extra 120 seconds to the function execution time.


This query is called around 200 times in the function as part of an update:

UPDATE @.FunctionTable set ...

....

, FieldValue = (SELECT CONVERT(XML, objectdata).value('(/xmlData/IsTrue)[1]', 'bit') as IsTrue
from myTable
where idfield = [@.FunctionTable].ID)

Is there a more performant way to do the same XML lookup?

Many Thanks

Are there any XML indexes created?

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||Probabaly not, would this index be placed upon the source field?
|||

You can create an index on the field where you do the XQuery.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

A quicker way of performing this XML query?

Hi all

I have the following query that makes up part of a table-value-function i've written in SQL 2K5.

XML Query


SELECT CONVERT(XML, objectdata).value('(/xmlData/IsTrue)[1]', 'bit') as IsTrue
from myTable
where idfield = [@.FunctionTable].ID


Until adding this query, the function ran in under 60 seconds. Adding this query has added an extra 120 seconds to the function execution time.


This query is called around 200 times in the function as part of an update:

UPDATE @.FunctionTable set ...

....

, FieldValue = (SELECT CONVERT(XML, objectdata).value('(/xmlData/IsTrue)[1]', 'bit') as IsTrue
from myTable
where idfield = [@.FunctionTable].ID)

Is there a more performant way to do the same XML lookup?

Many Thanks

Are there any XML indexes created?

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||Probabaly not, would this index be placed upon the source field?
|||

You can create an index on the field where you do the XQuery.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

Monday, February 13, 2012

A little help with clustered SQL server setup.

Guys,
I keep getting errors while trying to install SQL 2K5 server on Win2K3 x64
R2 SP2 cluster.
The setup sequence was
1. Install SQL client/tools on all nodes
2. Install first instance of SQL server
3. Install SQL SP2 for client/tools on all nodes
4. Install SQL server SP2 for instance
5. Install second instance of SQL server
This step keeps failing no matter what I tried.
I did similar setup before in “slightly” different order and it works fine:
1. Install SQL client/tools on all nodes
2. Install first instance of SQL server
3. Install second instance of SQL server
4. Install third instance of SQL server
5. Install SQL SP2 for client/tools on all nodes
6. Install SQL server SP2 for all instances
With my current setup I don’t want (actually I can not) follow same order.
What if the first instance is already in production AND SP2 is applied
already, and then I need to install a new instance?
Anyway, setup keeps failing on remote nodes with this error:
(I tried both, GUI and command line with exact same result)
Running: LoadResourcesAction at: 2007/4/22 22:22:59
Complete: LoadResourcesAction at: 2007/4/22 22:22:59, returned true
Running: ParseBootstrapOptionsAction at: 2007/4/22 22:22:59
Loaded DLL:\\NYSQL01\C$\Program Files\Microsoft SQL Server\90\Setup
Bootstrap\xmlrw.dll Version:2.0.3609.0
Error :Read private data failed 2
Complete: ParseBootstrapOptionsAction at: 2007/4/22 22:22:59, returned false
Error: Action "ParseBootstrapOptionsAction" failed during execution. Error
information reported during run:
Could not decrypt command line due to WinException.
Error Code: 0x80070002 (2)
Windows Error Text: The system cannot find the file specified.
Source File Name: cryptohelper\lsasecret.cpp
Compiler Timestamp: Sat Oct 7 09:43:52 2006
Function Name: sqls::LsaSecret::Read
Source Line Number: 107
Is the Cluster service account the same on all nodes?
Ayad Shammout
"OK" <OK@.discussions.microsoft.com> wrote in message
news:05D675D0-39FC-4621-AAFA-CD4E4FFD1B18@.microsoft.com...
> Guys,
> I keep getting errors while trying to install SQL 2K5 server on Win2K3 x64
> R2 SP2 cluster.
> The setup sequence was
> 1. Install SQL client/tools on all nodes
> 2. Install first instance of SQL server
> 3. Install SQL SP2 for client/tools on all nodes
> 4. Install SQL server SP2 for instance
> 5. Install second instance of SQL server
> This step keeps failing no matter what I tried.
> I did similar setup before in "slightly" different order and it works
> fine:
> 1. Install SQL client/tools on all nodes
> 2. Install first instance of SQL server
> 3. Install second instance of SQL server
> 4. Install third instance of SQL server
> 5. Install SQL SP2 for client/tools on all nodes
> 6. Install SQL server SP2 for all instances
> With my current setup I don't want (actually I can not) follow same order.
> What if the first instance is already in production AND SP2 is applied
> already, and then I need to install a new instance?
> Anyway, setup keeps failing on remote nodes with this error:
> (I tried both, GUI and command line with exact same result)
> Running: LoadResourcesAction at: 2007/4/22 22:22:59
> Complete: LoadResourcesAction at: 2007/4/22 22:22:59, returned true
> Running: ParseBootstrapOptionsAction at: 2007/4/22 22:22:59
> Loaded DLL:\\NYSQL01\C$\Program Files\Microsoft SQL Server\90\Setup
> Bootstrap\xmlrw.dll Version:2.0.3609.0
> Error :Read private data failed 2
> Complete: ParseBootstrapOptionsAction at: 2007/4/22 22:22:59, returned
> false
> Error: Action "ParseBootstrapOptionsAction" failed during execution.
> Error
> information reported during run:
> Could not decrypt command line due to WinException.
> Error Code: 0x80070002 (2)
> Windows Error Text: The system cannot find the file specified.
> Source File Name: cryptohelper\lsasecret.cpp
> Compiler Timestamp: Sat Oct 7 09:43:52 2006
> Function Name: sqls::LsaSecret::Read
> Source Line Number: 107
>
|||LOL :-)
Exactly the same of course!
OK
"Ayad Shammout" wrote:

> Is the Cluster service account the same on all nodes?
> Ayad Shammout
>
> "OK" <OK@.discussions.microsoft.com> wrote in message
> news:05D675D0-39FC-4621-AAFA-CD4E4FFD1B18@.microsoft.com...
>
>