Forum Replies Created

Viewing 15 posts - 181 through 195 (of 389 total)

  • RE: Using row_number()

    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...

  • RE: T-SQL Help

    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?

  • RE: Help on XML parsing

    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...

  • RE: Help on XML parsing

    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.

  • RE: XML Workshop XXII - A TSQL RSS Library

    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...

  • RE: Return first record of each key

    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...

  • RE: T-SQL Help

    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...

  • RE: XML Workshop XXII - A TSQL RSS Library

    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...

  • RE: XML Query

    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.

  • RE: Sales Order Workshop Part IV

    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...

  • RE: XML Workshop XVIII - Generating an RSS 2.0 Feed with TSQL

    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...

  • RE: Sales Order Workshop Part IV

    Agreed with Hans. On large XML documents, OPENXML is found to be performing better than XQuery methods.

  • RE: Automatic Updates in Sql Server 2005

    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

  • RE: A case with GROUP BY

    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...

  • RE: convert date object into integer

    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...

Viewing 15 posts - 181 through 195 (of 389 total)