Forum Replies Created

Viewing 15 posts - 37,381 through 37,395 (of 59,072 total)

  • RE: CrossTab or Pivot

    Novicejatt (8/5/2010)


    Hi

    I don't want to write a query for every week. I want that the query should recogonise any week like say within a year(or the date range specified).

    I just...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Casing For Built-In Function Names

    Michael.D (8/5/2010)


    Thanks, Jeff.

    That's what I figured.

    Out of curiosity, does it work as advertised in say, the Developer or Enterprise editions?

    What a stupid little nicety to disable in the...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Trigger validate

    monkeytesiorna (8/4/2010)


    CREATE TRIGGER t_del_emp ON [dbo].[empmas]

    FOR DELETE

    AS

    declare @empid varchar(10)

    SELECT @empid=d.empid FROM DELETED d

    declare @empdetid INT

    IF EXISTS(SELECT * FROM empdet WHERE empid=@empid AND deactivated is null)

    BEGIN

    SET @empdetid = (SELECT...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Are the posted questions getting worse?

    Steve Jones - Editor (8/5/2010)


    Wish me luck. My PASS Board interview is tomorrow. We'll see if I'm still in the running after that.

    Break a leg, Steve. You'll do well.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Are the posted questions getting worse?

    Never mind... 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Null Fun

    irobertson (8/4/2010)


    tl;dr: nulls in subqueried columns will cause you to incorrectly return no results unless you specifically exclude them...

    Cheers, Iain

    Nulls cannot be compared to anything, not even other Nulls. ...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Rolling 3 Weeks

    drew.allen (8/4/2010)


    Even though dates are stored as real numbers, you really should be using DateAdd().

    Drew

    Whether I agree with such claims or not, such claims should be accompanied by links and/or...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Casing For Built-In Function Names

    Michael.D (8/4/2010)


    Sorry for the extremely elementary question but:

    I'm rather a newbie with SQL Server and am trying out SQL Express 2008 R2.

    I have the option selected for Built-in...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Performance Issue in Insert Values

    kalivaraprasadm (8/4/2010)


    Hi all,

    I have one table with 100 columns.

    That contains One clustered Index and 99 Non_clustered Indexes.

    Already table have 2 Lakhs Records.

    Is any performance issue when i am inserting new...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Extended Stored Procedure Returning One Column, not one Row

    AndrewSQLDBA (8/4/2010)


    How can i possible turn this into a normal table? I have tried using Pivot, but I am doing something that something does not like. I am not sure...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Pivot Table

    jessajr (8/4/2010)


    Hi,

    Can you please check my code since I'm having syntax problem based on dynamic pivot table I read.

    Error is:

    Msg 102, Level 15, State 1, Line 26

    Incorrect syntax near '8'.

    DECLARE...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: The Great Debate!

    MaricopaJoe (8/4/2010)


    What I am seeing is all the formatting is being done in the SQL. I wonder what MS says?

    I agree that "it depends"... but to clarify a bit.

    So...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Splitting Tempdb - MAX DOP

    Grant Fritchey (8/4/2010)


    The max degree of parallelism and having multiple files for your tempdb are not directly related. One has to do with file storage, the other has to do...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: power function

    niyinks (8/3/2010)


    Hi

    I am new at SQL, so pls bear with me. How do I correct my code below

    select '1' [union] ,type,SHORTHAND,num,denom,[current],past,round([current]-past,1) current_past,

    round((2.0*num+power(3.0902,2)-3.0902*SQRT(power(3.0902,2)+4.0*num*(1-[current])))/(2.0*(denom+power(3.0902,2))),6) lower_l2,

    round((2.0*num+power(3.0902,2)+3.0902*SQRT(power(3.0902,2)+4.0*num*(1-[current])))/(2.0*(denom+power(3.0902,2))),6) upper_l2,

    Peer_Max,Peer_Min,quarter

    I keep getting this...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Creating Holidays and Special Dates

    I haven't done a deep dive on all the code but, if this works as advertised, it's an awesome solution for the problem stated. Thanks for taking the time...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 15 posts - 37,381 through 37,395 (of 59,072 total)