Forum Replies Created

Viewing 15 posts - 3,541 through 3,555 (of 8,753 total)

  • RE: Inserting XML

    Ed Wagner (6/1/2016)


    Yeah, something was missed in the question itself. I read it several times and didn't see the problem, so I did what I normally do - go...

  • RE: Inserting XML

    No applicable answer listed as the code is perfectly valid (maybe not valid on SQL Server 2000 but cannot be bothered to check).

    😎

  • RE: What is SQL Fertilization any links?

    ChrisM@Work (5/31/2016)


    Google "SQL Fertilization" with the quotes and most of the links appear to relate to a single job advert, something to do with Broadridge. Best guess? A dopey recruiter...

  • RE: Slow BCP Out, only 9000 rows/second

    mark.kremers.prive (5/30/2016)


    Eirikur Eiriksson (5/30/2016)


    Quick question, what value are you passing with the [-a packetsize] parameter? IIRC, if none is passed it will revert to the default 4096k

    😎

    tried 64k, 32k and...

  • RE: T Sql Query

    yb751 (5/30/2016)


    Eirikur Eiriksson (5/30/2016)


    tmmutsetse (5/30/2016)


    The query that i am using looks like the one below.

    SELECT

    Name,

    Memory,

    Model

    FROM [xxxx].[dbo].[Status]

    where

    active =...

  • RE: T Sql Query

    tmmutsetse (5/30/2016)


    The query that i am using looks like the one below.

    SELECT

    Name,

    Memory,

    Model

    FROM [xxxx].[dbo].[Status]

    where

    active = 1 and

    and name...

  • RE: T Sql Query

    tmmutsetse (5/30/2016)


    Thanks Tom,Infact i have more than those names mentioned above.Almost 30 names.

    Try to write down the definition of the logic, otherwise it will be impossible to construct a query...

  • RE: Slow BCP Out, only 9000 rows/second

    Quick question, what value are you passing with the [-a packetsize] parameter? IIRC, if none is passed it will revert to the default 4096k

    😎

  • RE: Query calculation over a partition

    Pre-grouping works quite well in this case, especially if there is a filtered index on the the table for customerID where sales is not null.

    😎

    ;WITH CUSTOMERS_SALE AS

    (

    ...

  • RE: Query calculation over a partition

    TheSQLGuru (5/28/2016)


    Eirikur Eiriksson (5/28/2016)


    santiagoc93 (5/27/2016)


    select customerId, window, product, sales,

    ( Case when count(sales) over(partition by customerid order by customerid) >0 then 1 else 0 end)as class

    from #example

    Very nice!

    😎

    The...

  • RE: Query calculation over a partition

    santiagoc93 (5/27/2016)


    select customerId, window, product, sales,

    ( Case when count(sales) over(partition by customerid order by customerid) >0 then 1 else 0 end)as class

    from #example

    Very nice!

    😎

    The addition of the...

  • RE: Non-aggregating pivot

    This can be done more efficiently with a simple ROW_NUMBER implementation.

    😎

    The problem with your solution is that it scans the table 1+(2 x number of rows) times, fear it will...

  • RE: folder name

    Alternative method using Lynn's fine test set (with the addition of a Beginninator 😀 )

    😎

    ;WITH testdata AS (

    SELECT

    Directory

    FROM

    (VALUES

    ('/dev/Mywork/deailsbyWork'),

    ('/dev/MyTeam/deailsbyTeam'),

    ('/dev/MySubgroup/deailsbySubgroup'))dt(Directory)

    )

    ,FIRST_CHOP AS

    (

    SELECT

    ...

  • RE: SQL Date column issues in query

    Piling on, don't use implicit convertion

    😎

    DECLARE @startdate DATETIME = CONVERT(DATETIME,'20160101',112);

  • RE: Query calculation over a partition

    Since you are on a 2012 forum then why not use a window function?

    😎

    Note that a POC index like this would be very helpful

    CREATE NONCLUSTERED INDEX NCLIDX_#EXAMPLE_CUST_SALES_INCL_WIN_PRODUCT ON #example

    (customerId ASC,...

Viewing 15 posts - 3,541 through 3,555 (of 8,753 total)