Viewing 15 posts - 151 through 165 (of 346 total)
If you have only one root node in the XML then the following gives better performance:
SELECT Nodes.value(N'@code', N'nvarchar(10)') AS CodeValue
FROM @XmlStr.nodes(N'/XObjects[1]/Objects') XObjects(Nodes);
The change here is in the "...
August 19, 2010 at 2:07 pm
One way to do this would be:
DECLARE @XmlStr XML;
SET @XmlStr = '<XObjects><Objects Type="Alp" code="Alpa125" pChild="0" grp="0" /></XObjects>' ;
SELECT Nodes.value(N'@code', N'nvarchar(10)') AS CodeValue
FROM @XmlStr.nodes(N'/XObjects/Objects') XObjects(Nodes);
Note that the...
August 19, 2010 at 1:57 pm
I wanted to recheck whether the estimated number of rows returned by a multi line table valued function is really always 1 - here is the sample code attached (since...
October 28, 2009 at 2:22 pm
Do you have multi-line table valued functions?
For multi-line table valued functions the optimizer always estimates the number of rows returned as 1 - it is better at estimating the...
October 28, 2009 at 2:10 pm
This might not be a SQL Server related error. Do you have IIS installed on the box along with SQL Server?
This link might be of help: http://forums.iis.net/t/1148965.aspx
October 27, 2009 at 1:25 pm
Regarding the script to create/alter objects - I normally tend to have a script that checks if the object exists, drop it if it exists and then create it. Sort...
October 23, 2009 at 1:40 am
You are right - the WHILE(@@TRANCOUNT>0) is not needed...I did not know that ROLLBACK TRANSACTION decremented the transaction count to 0 even with nested transactions...
I am not too sure about...
October 23, 2009 at 12:06 am
First issue:
The behaviour you are seeing is due to SQL Server's error handling features.
From information available in http://www.sommarskog.se/error-handling-I.html and http://www.sommarskog.se/error-handling-II.html
Since you are setting XACT_ABORT - most statement abort...
October 21, 2009 at 3:25 pm
Does this do what you want?
I was trying to find a way to determine the position of a given ResID in the sequence, and remove the value at that position...
August 23, 2009 at 10:41 pm
It does look like a bug. There is a bug already logged on connect (http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=356617) that seems to be the same issue
August 21, 2009 at 6:55 am
I haven't really seen the database field being empty for T-SQL job steps. Even if you create a job via T-SQL commands and don't provide the @database value I think...
August 21, 2009 at 4:38 am
This has now become a string replacement sort of problem. From what I understand - you need to replace the existing value at a particular position in the string with...
August 21, 2009 at 1:43 am
Nice!! I never thought of using STR()...I can now use this in a lot of places...Thanks Jeff!
August 20, 2009 at 11:39 am
I normally go to http://www.sqlskills.com/whitepapers.asp which has a very nice listing of whitepapers from MSDN and Technet.
August 20, 2009 at 4:28 am
Yes - you will have to change the datatype to decimal (unless you specifically need float).
Assuming you want to track the % increase between products and productspurchase for the same...
August 20, 2009 at 4:09 am
Viewing 15 posts - 151 through 165 (of 346 total)