Forum Replies Created

Viewing 15 posts - 39,586 through 39,600 (of 59,072 total)

  • RE: Avoid dynamic SQL

    The other thing to consider is that not all dynamic SQL receives paramaters from the outside world. Such dynamic SQL needs virtually no protection.

    As a side bar... let's see...

    --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: Avoid dynamic SQL

    RBarryYoung (2/26/2010)


    Jeff Moden (2/26/2010)


    Welsh Corgi (2/26/2010)


    I agree with the distinguished Forum Members with respect to the use of Dynamic SQL.

    There are many reasons to avoid this. If you...

    --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: Avoid dynamic SQL

    Welsh Corgi (2/26/2010)


    OK, Jeff & Barry you point is

    well taken. I appreciate critisism but when you present a problem you should provide a solution...

    I'm good at using...

    --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: Slow performant select query, yet apparently simple.

    The problem is that you're trying to return too much data at the very beginning. The only thing you should initially be concerned with for paging is getting 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: Avoid dynamic SQL

    Welsh Corgi (2/26/2010)


    I accept your critisisim.

    There are many ways to exploit Dynamic SQL and this is well documented.

    In my humble;e opinion you have to take steps to minimize...

    --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: TSQL parser

    kyounger (2/26/2010)


    I am wanting to know if anyone has seen a script/program that pulls column names from a query.

    Basically, I could put any INSERT, UPDATE, SELECT, etc. query, and it...

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

    Alex 469216 (2/26/2010)


    More over, what should I do if I need to consolidate more tables in the future?

    You could insert your top 20 ActiveDirectory records into a temp table

    and 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: two databases...same name...same instance...is it psbl?

    iqtedar (2/26/2010)


    thanks everyone ...i know i cant have two dbs with same name under same instance...i was looking is there a way setup some alias..or something else..

    Synonyms, pass through views,...

    --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: need help to build a query

    sanketahir1985 (2/23/2010)


    hiii dan

    i want O\P in foll. format

    dbdate dbname datasize_MB

    ====== ======== ...

    --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: Calculating tenure in position

    Trybbe (2/26/2010)


    Sorry about that

    Staffno name position posid headcount period

    123 john developer ...

    --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: I want to insert bulk data without using txt file

    thummalalavanya (2/26/2010)


    i want to insert bulk data in one field in a table without using txt file directly using insert statement .plese reply me.

    OPENROWSET or text based linked 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: With 3 years experience in SQL Server DBA.

    I just have to ask this question... what's so wrong with India that all the techies want to bail out of it? I'm not trying to be a smart...

    --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: Avoid dynamic SQL

    Welsh Corgi (2/26/2010)


    I agree with the distinguished Forum Members with respect to the use of Dynamic SQL.

    There are many reasons to avoid this. If you want SQL Injection...

    --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 to 1 column

    lmu92 (2/26/2010)


    A recursive cte will cause performance issues on larger data sets.

    A common way to resolve this issue is the usage of FOR XML PATH.

    Something like

    SELECT [EnrolleeID],

    STUFF(

    (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: Fast random row selector

    ChrisM@home (2/26/2010)


    Have you tried joining to a table containing "random" ID's?

    DROP TABLE #Sampler

    DECLARE @TableSize INT, @SampleSize INT

    SET @TableSize = 1200000

    SET @SampleSize = @TableSize/10 -- 10%

    SELECT TOP(@SampleSize) SampleID = ABS(CHECKSUM(NEWID()))%@TableSize

    INTO...

    --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 - 39,586 through 39,600 (of 59,072 total)