Forum Replies Created

Viewing 15 posts - 226 through 240 (of 683 total)

  • RE: need help badly newbie question

    rbarryyoung (4/16/2008)


    I feel bad for the OP, but we can't really do much for them until they can post something that we can see. Maybe an attachment?

    I've just searched...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Recursive Query

    GSquared (4/15/2008)


    Dictionary definition of "Recursive":

    Recursive (re-cur-siv) adj: See recursive.

    😀

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: need help badly newbie question

    rbarryyoung (4/11/2008)


    Wow.

    I really wish that the {code} IFcode tags would treat their contents as literals and not strip out the html & xml tags.

    Agreed. The trick is to replace all...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Recursive Query

    I guess your google is broken.

    "A recursive query is one in which a CTE references itself."

    http://www.sqlservercentral.com/articles/Development/recursivequeriesinsqlserver2005/1760/%5B/url%5D

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Importing xml file into ms sql server2005

    -- Data

    declare @x xml

    set @x = '<ROOT>

    <Customers>

    <CustomerID>1111</CustomerID>

    <CompanyName>Sean Chai</CompanyName>

    <City>NY</City>

    <Order OrderID="1" />

    <Order OrderID="2" />

    </Customers>

    <Customers>

    ...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: delete only the root in xml

    Nice feedback - thank you 🙂

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Importing xml file into ms sql server2005

    Hi vsjayashri

    Can't see your xml 🙁

    Try replacing every < with &lt; and repost...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: delete only the root in xml

    Can't see your example, but this works...

    DECLARE @x XML

    SET @x = '<root><a><b /></a><c d="e" /></root>'

    SET @x = @x.query('root/*')

    SELECT @x

    /* Results

    <a><b /></a><c d="e" />

    */

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: replace characters on condition in table and cell

    Also asked here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=100959

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Flatten Results of Query

    It's a bit tricky to tell what's what, but try something like this...

    c.reportrundate as Day1

    ,a.MaterialNumber

    ,a.MaterialDescription

    ,a.MaterialGroup

    ,max(Case

    When a.plant = 'DC15' then a.unrestrictedstock

    end) as Day1LDCStock

    ,max(Case

    ...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Query Help - T-SQL

    Yep - you need something to identify the order. An identity field will do it, for example...

    -- Data

    CREATE TABLE MyTable (

    ident int identity(1, 1), --<----- you need this

    ...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Trim right of decimal in varchar field

    This will go wrong for values with trailing spaces.

    Using DATALENGTH rather then LEN will fix this 🙂

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: total time diff between more than two dates

    Something like this...

    declare @d1 datetime

    declare @d2 datetime

    declare @d3 datetime

    declare @d4 datetime

    set @d1 = '02/Nov/06 9:14:21 AM'

    set @d2 = '19/Apr/07 11:52:31 AM'

    set @d3 = '02/dec/07 12:14:21 AM'

    set @d4 = '19/jan/08 5:52:31...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Trigger: Looping though multiple rows in the deleted table?

    It looks like you're happy, so just to mention in passing that there are circumstances where 'ON DELETE CASCADE' would be an alternative. Here's an example...

    --Structure

    CREATE TABLE t1 (Id INT...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: How to write this group query

    Or...

    select dateadd(hour, datediff(hour, 0, acc_dt), 0) as dt, sum(acc_count) as total_cnt

    from Acc_count group by dateadd(hour, datediff(hour, 0, acc_dt), 0)

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

Viewing 15 posts - 226 through 240 (of 683 total)