Forum Replies Created

Viewing 15 posts - 856 through 870 (of 1,957 total)

  • RE: OPENXML query problem

    You need to declare the namespaces and reference them in your SELECT.

    Also pay attention to case sensitivity in XML.

    EXEC sp_xml_preparedocument @docno OUTPUT, @doc,'<camt:Document xmlns:camt="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02"/>'

    select * from openxml(@docno,'/camt:Document/camt:BkToCstmrStmt/camt:Stmt',2) with ([camt:Id] varchar(100))...

  • RE: STDEVP help

    Sean Lange (5/28/2013)


    dwilliscp (5/28/2013)


    If you have a record, where there are 12 columns, one for each of the last 12 months, and you want to use STDEVP, how would you...

  • RE: range and count of users

    Sorry, that's the problem with not having sample data to test with...

    you probable want something more like this:

    select point_range,count(*)

    from (

    select

    jp.userid

    , case...

  • RE: XML, SSIS, and counting Tags

    Evil Kraig F (5/24/2013)


    For the love of gods...

    THANK YOU. 😀

    I owe you a beer. Or ten.

    I'll take the THANK YOU as enough... Beer is for lizards...:hehe:

  • RE: XML, SSIS, and counting Tags

    ...I'm thinking something like this:

    declare @x xml = (select *

    from sys.tables as tables

    for xml auto,elements)

    select @x,(select count(*) from @x.nodes('tables') [count](nd) for xml auto,elements,type)

    from (values(1)) as [root](b)

    for xml auto,elements

    Which produces

    <root>

    ...

    ...

  • RE: XML, SSIS, and counting Tags

    I'm missing the point I am sure, so can you explain why you can't just count the nodes with a select?

  • RE: SSMS query page shifts

    Do you have any SSMS Addins?

  • RE: SSMS query page shifts

    facemann (5/24/2013)


    My SSMS 2008 R2 has an irksome quirk. Every 10-15 minutes the query screen shifts down. I will be typing a line of code positioned in the...

  • RE: range and count of users

    You are grouping by userid, so of course you get one row per userid....

    Try this:

    select

    x.point_range

    , count(jp.userid) as countofusers

    from StatusLevelPnt jp

    inner join user ju on...

  • RE: Sending a Null Value in a Store Proc

    Yes, you can pass a NULL into a stored proc.

    Try this:

    create proc testNullParam @p1 varchar(10),@p2 varchar(10)=null,@p3 varchar(10)

    as

    select @p1 as p1, @p2 as p2, @p3 as p3

    go

    exec testNullParam @p1='test',@p2=null,@p3='test'

    You get this:

    +--------------------+

    ¦[highlight="#808080"]...

  • RE: Have I been smoking something?? Insert construction question.

    Tobar (5/23/2013)The one draw back with this method, I just noticed :-D, is that you must specify all the columns in the table. If you are only updating 5 columns...

  • RE: Adding an include to an existing Index

    GilaMonster (5/23/2013)


    mister.magoo (5/23/2013)


    I don't have 2005 any more, but interestingly on 2012 at least, you can just issue a CREATE INDEX using the same index name without dropping it first!

    You...

  • RE: Adding an include to an existing Index

    Kingston Dhasian (5/23/2013)


    You will have to drop the existing index and then create the index with the INCLUDED columns

    The link below can help you with the syntax to create the...

  • RE: Syntax on assigning result of EXEC to var

    the syntax

    EXEC @myvariable = dbo.myproc;

    will take the RETURN value from the stored proc and put it into @myvariable, which IIRC must be of Integer data type.

    It looks like you are...

  • RE: Automating SQL Traces

    Thanks for a well presented, well thought out article, which has expanded my knowledge.

Viewing 15 posts - 856 through 870 (of 1,957 total)