Forum Replies Created

Viewing 15 posts - 1,291 through 1,305 (of 1,438 total)

  • RE: Find Aggregate value in lookup

    Something like this?

    WITH AvgResponse AS (

    SELECT AVG(CAST(response AS DECIMAL (4,2))) AS response,

    expectation,

    employeenumber,

    ...

  • RE: Collation Latin1_General_CI_AS stands for?

    CI - Case Insensistive

    AS - Accent Sensitive

  • RE: MSSQL into XML in Hierarchy?

    CREATE FUNCTION dbo.GetSubTree(@ID int)

    RETURNS XML

    BEGIN RETURN

    (SELECT ID AS "@ID",

    Title AS "@Title",

    dbo.GetSubTree(ID)

    FROM MyTable

    WHERE Parent=@ID...

  • RE: Xquery question

    SELECT

    XML.value('(/*[local-name()="Movement"][@Context="Purchase"])[1]','varchar(50)') AS Purchase

    from

    XMLCollection

  • RE: XQuery

    Why do you want to do this dynamically?

    Have you tried something like this?

    SELECT @var = ParamXML.value('/ROOT[1]/TestCase[position()=sql:variable("@TestCaseID")][1]/Query[1]/@Expected','VARCHAR(MAX)')

    FROM dbo.SPParamXML

    WHERE SPName = @SPName

  • RE: text() for xml Data Type Methods

    select

    tab.col.value('@Descr', 'varchar(100)'),

    tab.col.value('.', 'varchar(100)')

    from @xml.nodes('/SerialNumber/S') tab(col)

  • RE: Query from XML

    select r.value('../@a','int') as A,

    r.value('@b','int') as B

    from #testA

    cross apply xml.nodes('/Tree/Leaf') as x(r)

  • RE: Need help on XML urgently

    You'll need to post the XML with the namespace declarations

  • RE: Need help on XML urgently

    select b.value('@id','int') as CustomerID,

    b.value('./name[1]','varchar(20)') as Name,

    b.value('./city[1]','varchar(20)') as City,

    d.value('@id','int') as...

  • RE: How to identify the position of the nth occurance of character in a string

    You can use a numbers/tally table

    http://www.sqlservercentral.com/articles/TSQL/62867/

    For example

    DECLARE @Parameter VARCHAR(100)

    DECLARE @ch CHAR(1)

    SET @Parameter='aaaddddfffggghhhhjjjj'

    SET @ch='f'

    SELECT ROW_NUMBER() OVER(ORDER BY N) AS nth,

    N AS [Position In String]

    FROM...

  • RE: XML Query

    SELECT r.value('.','VARCHAR(20)')

    FROM Table1

    CROSS APPLY Column1.nodes('/*:Webstore/*:Manifest/*:Version') AS x(r)

  • RE: Check All

    Assume that the selected file types are in a table such as this

    CREATE TABLE SelectFileTypes(FileTypeID INT)

    INSERT INTO SelectFileTypes(FileTypeID) VALUES(2)

    INSERT INTO SelectFileTypes(FileTypeID) VALUES(3)

    This query should give the results you want

    SELECT GroupID

    FROM...

  • RE: Select XML data

    WITH XMLNAMESPACES ('urn:WebstoreDeploymentSchema.xsd' AS ns)

    SELECT r.value('@Name','VARCHAR(50)') AS 'Element Database Template'

    FROM Table1

    CROSS APPLY Column1.nodes('/ns:Webstore/ns:DatabaseTemplates/ns:DatabaseTemplate') AS x(r)

  • RE: coalesce negative values

    RyanRandall (7/14/2008)


    This looks like fun, so I'm chipping in...

    declare @t table (id int identity(1, 1), a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8...

  • RE: coalesce negative values

    antonio.collins (7/10/2008)


    the list is individual columns of floats. i thought of stringing them together and using my fListToFloats(list,delim) function but i'd like something cleaner, especially since i need to...

Viewing 15 posts - 1,291 through 1,305 (of 1,438 total)