Viewing 15 posts - 256 through 270 (of 389 total)
-- SAMPLE TABLE
DECLARE @t TABLE (
error_reference_uid VARCHAR(10),
item_number VARCHAR(10),
error_code VARCHAR(10) )
-- SAMPLE DATA
INSERT INTO @t (error_reference_uid,item_number,error_code) SELECT '1234567','13579','odd'
INSERT INTO @t (error_reference_uid,item_number,error_code) SELECT '1234567','2468','even'
INSERT INTO @t (error_reference_uid,item_number,error_code) SELECT '1234568','13579','odd'
INSERT INTO @t...
.
April 5, 2008 at 1:06 am
If you need to join with the results of OPENXML in more than one query/batch, it is advisable to put the results of OPENXML into a memory/temp table and use...
.
March 29, 2008 at 12:31 am
this must be a limitation on displaying the text at SSMS. refer this article http://www.sqlservercentral.com/articles/XML/62054/ that shows how to retrieve XML results with ADO.NET
.
March 24, 2008 at 11:54 pm
I dont think FOR XML will give you better performance. FOR XML may not be used as a means to increase performance. It is usually used when an XML output...
.
March 19, 2008 at 1:45 am
Try this
;WITH cte AS (
SELECT
name,
count(*) OVER (PARTITION BY '') cnt,
ROW_NUMBER() OVER (ORDER BY name) AS recID
FROM sys.tables
)
SELECT name, RecID, cnt
FROM cte WHERE RecID BETWEEN 5 AND 10
.
March 16, 2008 at 6:18 am
Did you try the "COUNT(*) OVER(PARTITION BY '')" option suggested by Matt, earlier in this thread? This will give you the recordcount.
.
March 16, 2008 at 5:25 am
Hi Paul,
Thank you for the feedback. The code was just for the purpose of demonstration only. My focus was on getting the FOR XML results to the .NET application into...
.
March 12, 2008 at 11:52 pm
Hi Phil,
Thank you for bringing this up. I had plans to cover SQLXML in the later sessions. On the .NET part, i was pretty sure that I could be missing...
.
March 12, 2008 at 4:13 am
I see that the editor has deleted XML tags in my post. So the XQUERY that you asked me in the previous post should look like this: (i am replacing...
.
March 6, 2008 at 5:54 am
aplogies for the bad formatting. the editor does not help me to format correctly. I must be missing something. And my xml data is also missing in the post. But...
.
March 5, 2008 at 7:46 am
Are you looking for something like the following?
DECLARE @x XML
SET @x =
'
...
.
March 5, 2008 at 7:45 am
You could do this by using a variable. You can refer to an element/attribute as 'sql:variable("@varname")'. Look for sql:variable in books online. I have covered this in "XML Workshop...
.
March 4, 2008 at 10:35 pm
Thanks everyone for the interesting feed back. I agree that FOR XML PATH is much easier and almost as power ful as EXPLICIT. I also agree that the process of...
.
February 29, 2008 at 4:44 am
I agree that sp_executesql is better than EXEC() in many ways. Other than reusing the execution plan, it helps to avoid SQL Injection. I have mentioned it in one of...
.
February 26, 2008 at 11:19 pm
Viewing 15 posts - 256 through 270 (of 389 total)