Forum Replies Created

Viewing 15 posts - 24,376 through 24,390 (of 59,099 total)

  • RE: LIKE and NULLs

    thisisfutile (2/14/2014)


    fsuoj (2/14/2014)


    Where is it documented that not using % assumes % at the end?

    The Insert "trims" the trailing spaces from the data.

    Not quite right. Trailing spaces are not...

    --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: SQL Training

    goldstone.david (2/16/2014)


    Hi

    I have done a basic 'writing SQL' training a couple of years ago. I use SSMS 12 at work and play with it at home. I can write basic...

    --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: Avoiding Row work in SQL

    Ah.... sorry. I didn't scroll down before posting and didn't notice that you also referred to Wayne's fine article on the subject.

    --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: Avoiding Row work in SQL

    SQLRNNR (2/14/2014)


    Are you limited to SQL 2008 for this? Or do you have SQL 2012 available?

    2012 has a feature that allows this kind of "quirky update" to be done...

    --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: Finding fragmentation in all databases.

    I believe that a part of your problem is that you've hardcoded the database ID in your code at the following line.

    from sys.dm_db_index_physical_stats ([font="Arial Black"]5[/font], null,null,null,'Limited') S

    --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: How can i loop thru data based on dynamic parameter passed to sp

    milos.radivojevic (2/16/2014)


    First you can create a function converting a string to table. For instance you can use this one:

    CREATE FUNCTION dbo.StringToTable

    (

    @Input NVARCHAR (4000),

    @Delimiter NVARCHAR(1)

    )

    RETURNS @OutputTable TABLE (val NVARCHAR(50))

    AS

    BEGIN

    ...

    --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: Did This Work? - Forum Changes at SQLServerCentral

    tmlink99 (2/15/2014)


    I agree with Koen, I think.

    The thing is, the problem you describe is twofold: the OP wants to know what the community thinks (the "experts"), but the community also...

    --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: While Lop in Place of Cursor

    niladri.primalink (2/16/2014)


    Hi All,

    I have a table called Table1 where I have five fields like Tableid, Processigndate, Amount, remainingCollectonCount and Frequency. All total I have more than 5Lacs records.

    Now I...

    --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: Audit Table Design

    Michael L John (2/15/2014)


    You need three triggers (Ugh!); insert, update and delete.

    Actually, you don't. Just calculate whether it's an INSERT, UPDATE, or DELETE and mark a column with...

    --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: Code to list the Week Number of Year

    CLARE.FAUGHEY (2/11/2014)


    Hello I'm relatively new to software development and I have a query regarding listing the weeks 1 - 52 where week 1 of the year starts on Monday 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: Code to list the Week Number of Year

    milos.radivojevic (2/16/2014)


    I guess that the problem was to identify the frist monday in a year and that the rest of the rows generation is more or less trivial.

    Agreed but use...

    --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: Code to list the Week Number of Year

    milos.radivojevic (2/16/2014)


    --first Monday of the month

    SELECT DATEADD(day, DATEDIFF(day, '19000101', DATEADD(month, DATEDIFF(month, '19000101', GETDATE()), '19000101')-1) /7*7 + 7, '19000101');

    --first Monday of the year

    SELECT DATEADD(day, DATEDIFF(day, '19000101', DATEADD(year, DATEDIFF(year, '19000101',...

    --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: Best solution to test as a trial

    meridius10 (2/13/2014)


    Basically I'd like to test a cloud based database but don't want to have to hand over my credit card details in order to be able to do so.

    Ah......

    --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?

    Jack Corbett (2/13/2014)


    Now onto the reason I had time to catch-up today. I was informed that due to financial problems at my now former employer, my position...

    --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: adding one more column for SubTotal in Select statement

    kishorefeb28 (2/13/2014)


    Thank you.

    You bet. Thanks for the reply. Just to be sure, do you understand how it works?

    --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 - 24,376 through 24,390 (of 59,099 total)