Viewing 15 posts - 181 through 195 (of 389 total)
Try changing
Customers.CustomerName = case when rn = 1 then CustomerName else '' end
TO
case when rn = 1 then CustomerName else '' end AS CustomerName
Secondly, Remove the ORDER BY clause...
October 2, 2008 at 4:25 am
So what is the logic?
if there is only one row, take it even if it is ZERO and other wise take only non-zero values?
October 2, 2008 at 4:13 am
Ah, I did not notice the attachment!
May be a little easier method using a CROSS APPLY.
SELECT
Node.value('@ID','INT') AS ServiceLineNumber,
Node1.value('@Name', 'varchar(20)') as FieldName,
Node1.query('New').value('.','varchar(20)') AS OldValue,
Node1.query('Old').value('.','varchar(20)') AS NewValue
FROM @xml.nodes('/ServiceLine') t(Node)
CROSS APPLY...
October 2, 2008 at 3:31 am
Iany,
This editor does not allow XML tags and hence your XML data does not show up in the post. Please replace XML tags ('<>') with '[]' and repost.
October 2, 2008 at 2:07 am
The code presented in this article creates RSS feeds with a single channel. All the feeds I have seen so far contains only one channel. If you really need to...
October 1, 2008 at 9:32 pm
If you are on SQL Server 2005, you can use the ROW_NUMBER() function to achieve this.
for example
DECLARE @t TABLE ( VARCHAR(30), COL1 VARCHAR(30), COL2 VARCHAR(20))
INSERT INTO @t(, col1, col2) SELECT...
October 1, 2008 at 12:10 pm
You did not mention the version of SQL Server you are using. Assuming that you are on SQL Server 2005, the following will work.
SET DATEFORMAT DMY;
SET NOCOUNT ON
DECLARE @t TABLE...
October 1, 2008 at 11:56 am
At the basic level, you can create a web page that serves the XML document. This article explains how to access the results of the query from ADO.NET: http://www.sqlservercentral.com/articles/XML/62054/
Your web...
October 1, 2008 at 11:11 am
I am not able to see the XML data. Please replace "<>" with "[]" and post the data again. It looks like the editor does not allow XML tags.
October 1, 2008 at 6:45 am
XML data is much more descriptive than CSV. XML is designed with a lot of other goals too. I agree with you that in this case a CSV approach may...
October 1, 2008 at 4:14 am
One option is to write a .NET application that executes the query/stored procedure and writes the output to a file: http://www.sqlservercentral.com/articles/XML/62054/
Or use a command line utility like sqlcmd.exe etc that...
September 30, 2008 at 10:20 pm
Agreed with Hans. On large XML documents, OPENXML is found to be performing better than XQuery methods.
September 29, 2008 at 9:09 am
Create a stored procedure that performs the required updates. Then schedule as an SQL Server Agent Job to run at scheduled intervals.
http://technet.microsoft.com/en-us/library/ms190268(SQL.90).aspx
September 29, 2008 at 6:22 am
There was a mistake in my original query and I have corrected it. "DATEADD(d, 0, DATEDIFF(d, 0, SaleDate) )" will remove the TIME portion from a DATETIME value and will...
September 29, 2008 at 12:54 am
If it is a matter of finding the difference between two dates (in milliseconds) you can even run the following query.
DECLARE @d1 DATETIME, @d2 DATETIME
SELECT @d1 = '1/9/2008 11:30:24.123', @d2...
September 29, 2008 at 12:46 am
Viewing 15 posts - 181 through 195 (of 389 total)