Forum Replies Created

Viewing 15 posts - 18,856 through 18,870 (of 59,098 total)

  • RE: LEAP and LAG behind the scenes

    Jason A. Long (12/24/2015)


    How about this one?

    Now you're cooking with gas. MUCH better data and test!... and, I stand corrected.

    1. If all you want to do is display...

    --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: Date Format

    johnwalker10 (12/23/2015)


    try the below query to get result in DD/MM/YY format.

    select LEFT(convert(varchar(10), @date, 103),6) + Right(Year(@date)+ 1,2)

    Gosh, no... Never do date/time formatting for a GUI from SQL Server. ...

    --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: Syntax Help please - how to drop a foreign key

    Ok... if have to ask... why was the following post marked as the correct answer...

    johnwalker10 (12/23/2015)


    ALTER TABLE [dbo].[ table_name] DROP CONSTRAINT [fk_name]

    ... even though it has less information that 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: How to reduce Huge Log File size

    You've confused me a bit, Scott. First you say that 16 VLFs for a 1GB logfile is too low and then you explain using even fewer VLFs per GB...

    --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: Number VS Letter

    Basurmanin (12/24/2015)


    Hi all,

    i have the next problem:

    i need to extract numbers from a string.

    Without using CTE, func, proc. Just query.

    Restrictions - varchar (50)

    Let`s take this example

    select 'aGk5kyO8pfas2csd444567' as word union...

    --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 to use 'like' in a query

    SQLisAwE5OmE (12/24/2015)


    Thanks Scott, it worked.

    Appreciate it.

    Do you understand the code that Scott wrote and why it's better to use the >=/< method he used?

    --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: LEAP and LAG behind the scenes

    It's not just the anchor. You can't use a Non-Clustered Index for the QU because of the possibility of a "Merry-go-Round" index.

    Also, your data is sorted on the Amt...

    --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 to identify OVERLAPPING records

    Jeff Moden (12/23/2015)


    mpdillon (12/23/2015)


    John,

    Yes. I agree that would work. I was hoping to find a query solution. I was thinking that if the table were Ordered by item number...

    --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: Shrink Database

    david.holley (12/23/2015)


    I'm incredibly bad at math and doing conversions, but I make a killer Pineapple/Jalapeno caserole.

    Heh... sounds awesome! 🙂

    --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 to identify OVERLAPPING records

    mpdillon (12/23/2015)


    John,

    Yes. I agree that would work. I was hoping to find a query solution. I was thinking that if the table were Ordered by item number and Start...

    --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 way to merge two large client databases

    Do the tables use IDENTITY columns for the PK of the tables?

    --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: Shrink Database

    david.holley (12/23/2015)


    I have a project that uses a SQLExpress database. The size of the database is close to 50% of the max for a SQLExpress db. A big honking chunk...

    --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: Attaching a file from Network Location

    GilaMonster (12/23/2015)


    sri2015 (12/23/2015)


    EXEC XP_CMDSHELL 'net use H: \\foldername1\foldername2\sharedfoldername3'

    EXEC XP_CMDSHELL 'Dir H:'

    EXEC XP_CMDSHELL 'net use H: /delete'

    Nope!

    SQL does not support mapped drives for database files, just the //server/share format,...

    --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: Please Suggest Partition boundaries

    TheSQLGuru (12/22/2015)


    Jeff Moden (12/22/2015)


    TheSQLGuru (12/22/2015)


    Partitioning CAN make PROPERLY DESIGNED report queries go much faster when partition elimination can allow said queries to hit a small fraction of the total data....

    --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: Syntax help on how to create a rule

    mw112009 (12/23/2015)


    Create table x

    (

    IN_TABLE_NAME varchar(50),

    SOURCE_TYPE CHAR(1)

    );

    Question: I only want the SOURCE_TYPE column to have the

    following values: P, S, N, M

    How do I create a rule so that 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)

Viewing 15 posts - 18,856 through 18,870 (of 59,098 total)