Forum Replies Created

Viewing 15 posts - 4,621 through 4,635 (of 10,144 total)

  • RE: how to concatenate o as perfix in case statment ?

    ravi@sql (5/9/2013)


    ya i agree but thats what my requirment .. any other way to over come this ?

    CASE can only return one data type.

    An ordinary column can only have...

  • RE: CTE Recursive

    Your data set is causing heaps of problems here - there are associations where there shouldn't be. I think the query is ok, in fact with properly formed data, you...

  • RE: how to concatenate o as perfix in case statment ?

    ravi@sql (5/9/2013)


    Hi All,

    select Case when MONTH(GETDATE())=1

    then 12

    when LEN(MONTH(GETDATE()))=2 then MONTH(GETDATE())

    else right('0'+ convert(varchar(2), MONTH(GETDATE())),4) end

    In the above query else statment will come it as to come with zero(0)...

  • RE: Query Improvement

    sqlnaive (5/9/2013)


    ChrisM@Work (5/9/2013)


    kapil_kk (5/9/2013)


    IgorMi (5/9/2013)


    Hi,

    What does its execution plan say? Are there any missing indexes? How big are the tables? Check the statistics on them.

    You can replace the IN with...

  • RE: must declare the scalar variable!

    edalatfeizi (5/9/2013)


    no it's just

    DECLARE @X INT;

    SET @X =12;

    What are you using as your client?

  • RE: must declare the scalar variable!

    edalatfeizi (5/9/2013)


    thank you ChrisM@Work.

    but I have not entered any code between DECLARE and SET my code is:

    DECLARE @X INT;

    SET @X =12;

    Not even this?

    DECLARE @X INT;

    GO

    SET @X =12;

  • RE: must declare the scalar variable!

    Can you post all of the code between the DECLARE and the SET?

  • RE: Query Improvement

    kapil_kk (5/9/2013)


    IgorMi (5/9/2013)


    Hi,

    What does its execution plan say? Are there any missing indexes? How big are the tables? Check the statistics on them.

    You can replace the IN with EXISTS and...

  • RE: Are the posted questions getting worse?

    Stefan Krzywicki (5/8/2013)


    jasona.work (5/8/2013)


    You know, having a window at work can be both a boon and a curse...

    Boon because, especially if it opens, you can get fresh air, bright sunshine...

    Curse...

  • RE: find pairs of NULL records without resorting to CURSORS

    aaron.reese (5/8/2013)


    @chrism-2

    I managed to run that against my entire dataset (some 800K records) and it took less than 30 seconds so a big thanks for that code.

    Obiron

    That's a result! Thank...

  • RE: Today's Random Word!

    Daniel Bowlin (5/8/2013)


    missing

    Found, after ten years.

  • RE: Insertion in table

    It's going to take far less time and will be far less painful (for me) if I have tables and data to test against. Please can you read the link...

  • RE: Stuck with this update statement

    curious_sqldba (5/8/2013)


    ChrisM@Work (5/8/2013)


    curious_sqldba (5/7/2013)


    I have a update statement which is killing my PLE( Page Life expectancy), it is dropping from 4000 to 120. Attached is the execution plan, would like...

  • RE: Isolation Level

    kapil_kk (5/8/2013)


    oopes I am getting error: 🙁

    ...

    Can you post it on the relevant thread please?

  • RE: Isolation Level

    No worries. Here's another code mod, this one is pretty much complete apart from the error handling block. You MUST read the article and write the code.

    --ALTER Procedure [dbo].[BS_Voucher_CreateVoucher]

    DECLARE

    @vouchertypeID int...

Viewing 15 posts - 4,621 through 4,635 (of 10,144 total)