Forum Replies Created

Viewing 15 posts - 4,366 through 4,380 (of 8,731 total)

  • RE: Where IN @txtVariable (where txtVariable is a CSV list)

    You're comparing against a single value that have commas in it, not separate values.

    To achieve what you want, you need a splitter. It can be found in here: http://www.sqlservercentral.com/articles/Tally+Table/72993/

    And you...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: how to overcome from the tempdb spill over ?

    Have you considered changing your splitter function to a faster one?

    Here's probably the fastest available: http://www.sqlservercentral.com/articles/Tally+Table/72993/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Convert Excel Formula to SQL

    aziznet (8/19/2015)


    I have data concerning sale of several products, columns are number of customer, date of purchase and name of product.

    I need to calculate with SQL the average duration...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    BL0B_EATER (8/19/2015)


    Ed Wagner (8/19/2015)


    BL0B_EATER (8/19/2015)


    crookj (8/19/2015)


    Ed Wagner (8/19/2015)


    Ed Wagner (8/19/2015)


    djj (8/19/2015)


    Eirikur Eiriksson (8/18/2015)


    DonlSimpson (8/18/2015)


    Bearing

    Grease

    Seal

    Approval

    Process

    Procedure

    medical

    Costs

    cash

    Johnny

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Display the output of table in given format

    People seem to be forgetting the aggregation. I hope that you're doing this to move out of this horrible design that will only create headaches.

    SELECT AttribName,

    CASE...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Amount rounding - What did I do wrong?

    TheSQLGuru (8/18/2015)


    Ken at work (8/18/2015)


    TheSQLGuru (8/18/2015)


    assuming both datatypes ARE real, cast the hard-coded values in the isnulls to the same datatpye - not the result of the isnull.

    I'm not sure...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Converting a column of type nvarchar to datetime

    aldous.chris (8/19/2015)


    As expected, I received the following error: 'Conversion failed when converting date and/or time from character string.'

    As mentioned, the format YYYYMMDD will automatically convert to datetime without the need...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Replace String Values - TSQL

    This was the option that I mentioned yesterday, but I had to get out of the office and couldn't post it.

    It will replace any number of instances and has the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Replace String Values - TSQL

    SQL Server doesn't allow user defined functions with variable parameters. All the parameters must be included every single time. There could be an option if you would take 2 strings,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: DateSerial() Equivalent?

    Here's one with the same functionality but as an inline table valued function.

    CREATE FUNCTION dbo.iDateSerial

    (

    @year int ,

    @month int ,

    @day int

    )

    RETURNS TABLE

    AS

    RETURN

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: The Tally Table

    Eric M Russell (8/18/2015)


    Jeff Moden (8/18/2015)


    Alan.B (8/17/2015)


    Jeff Moden (8/14/2015)


    Alan.B (8/14/2015)


    BobAtDBS (8/14/2015)


    I have read Jeff's article, both in the past and an hour ago. His examples aren't things we do...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Long running Select Query

    If you ask me, I would rewrite the query like this even if it's not exactly what you have right now:

    SELECT TE.JobID,

    TotalDistanceTravelled as Distance,--convert(varchar(30),TotalFare) as TotalFare,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Experts Please I Need help to create a sequential aggregate of a column using sum in tsql

    I hope that you're not using the triangular joins methods as they're very slow. If you want to know the reason, it's explained in here: http://www.sqlservercentral.com/articles/T-SQL/61539/

    For the cursor option, you...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    whereisSQL? (8/17/2015)


    Eirikur Eiriksson (8/17/2015)


    Ed Wagner (8/17/2015)


    eccentricDBA (8/17/2015)


    whereisSQL? (8/17/2015)


    DonlSimpson (8/17/2015)


    Optimizer

    Cost-based

    low-cost provider strategy

    Low Quality

    WYPIWYG

    Consultant

    Contractor

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Experts Please I Need help to create a sequential aggregate of a column using sum in tsql

    In 2012+ versions, you can use the OVER() clause for this.

    In 2008 and previous versions, there are different methods which are fully explained in here along with a performance comparison:

    http://www.sqlservercentral.com/articles/T-SQL/68467/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 4,366 through 4,380 (of 8,731 total)