Forum Replies Created

Viewing 15 posts - 706 through 720 (of 1,439 total)

  • RE: Converting XML Column

    This will give you a new row for each XML FormItem element.

    SELECT TicketAssessors.Name AS [Assessors Name], TicketAssessors.Designation AS [Assessors Designation],

    ...

  • RE: Converting XML Column

    kev43barrie (12/1/2011)


    Can this be done within a select statement with out creating a function?

    Very likely. You'll need to post more details though.

  • RE: Converting XML Column

    These will be returned as NULLs in the query. Have you tried it?

  • RE: Converting XML Column

    See if this helps

    DECLARE @T TABLE(ID INT, XMLCol XML)

    INSERT INTO @T(ID,XMLCol)

    VALUES(1,

    '<ArrayOfFormItem xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <FormItem>

    <ControlId>Club_Licensed</ControlId>

    <ItemValue>y</ItemValue>

    <ItemText>Yes</ItemText>

    </FormItem>

    ...

  • RE: Group Islands of Contiguous Dates (SQL Spackle)

    Naomi N (11/30/2011)


    How will you expand the solution when you have StartDate EndDate fields in your table and you want continuous intervals, e.g.

    01/01/2010 - 01/15/2010

    01/16/2010 - 02/10/2010

    The above two...

  • RE: XML Import 1:n relationship

    jjzzmp (11/29/2011)


    Dear Mark-101232,

    This is a great help, thank you very very much!

    Kind regards,

    John

    You're welcome!

  • RE: XML Import 1:n relationship

    Try this

    DECLARE @x XML

    SET @x=@invoer

    SELECT r.value('1+count(for $a in . return $a/../ *[. << $a])','int') AS nr,

    r.value('(./customernumber)[1]','VARCHAR(15)') AS customernumber,

    ...

  • RE: FOR XML child nodes depend on column value

    ken-1133369 (11/24/2011)


    Thanks very much Mark.

    I got close but had the case END in the wrong place

    CASE LineType WHEN 1 THEN (StockCode as [StockLine/StockCode])

    ELSE (Comment as [CommentLine/Comment]) END,

    Your's works perfectly!:-):-)

    Thanks...

  • RE: FOR XML child nodes depend on column value

    Is this what you're after?

    select XOrder as [OrderHeader/XOrder],[CustomerPoNumber] as [OrderHeader/CustomerPoNumber],

    Customer as [OrderHeader/Customer],

    CONVERT(VARCHAR(10),OrderDate,120) as [OrderHeader/OrderDate],

    CONVERT(VARCHAR(10),RequestedShipDate,120) as [OrderHeader/RequestedShipDate],

    (Select

    (select case when LineType = 1 then CustomerPoLine end as...

  • RE: FOR XML child nodes depend on column value

    Can you post some sample data for the source tables?

  • RE: Issue with replace function

    This sort of construct won't work

    IF 'abc' in (@Selection) -- If abc is in @selection then we are taking bank

    You could try

    IF @Selection LIKE '%,abc,%'

    instead

  • RE: help with multi-path hierarchical data

    I think this is known as a directed graph

    DECLARE @Start VARCHAR(50)

    DECLARE @End VARCHAR(50)

    DECLARE @MaxLevels INT

    SET @Start='G9'

    SET @End='BIN200'

    SET @MaxLevels=7;

    WITH CTE AS (

    SELECT c.DeviceID AS Start,CAST(d.DeviceName AS VARCHAR(1000)) AS Path, c.ConnectedDeviceID, 1...

  • RE: Sql query help

    What are your expected results?

    See if this helps

    WITH CTE AS (

    SELECT [Date],StaffId,ClientId,

    ROW_NUMBER() OVER(PARTITION BY StaffId,ClientId ORDER BY [Date]) AS rn

    FROM dbo.Visits)

    SELECT a.StaffId,a.ClientId

    FROM CTE...

  • RE: retrieve the Name Of XML elements in a table

    Cadavre (11/14/2011)


    Mark-101232 (11/14/2011)


    What XML are you trying to generate?

    Let me start again, because I'm sure that I'm attempting to over-complicate this with my lack of XML knowledge.

    Take this XML: -

    <Message>

    ...

Viewing 15 posts - 706 through 720 (of 1,439 total)