Forum Replies Created

Viewing 15 posts - 1,306 through 1,320 (of 2,894 total)

  • RE: Select table names from queries

    Lowell (8/30/2012)


    you could search for words that exist after "FROM" and "JOIN", right? ...

    What about: INSERT, INTO, DELETE, TABLE (in possible truncate, create, alter or drop table statements).

  • RE: Unique runs

    No probs.

    Actually it was never safe to use three part set in quirky update.

    If your read BoL abnout UPDATE you will find that:

    Setting Variables and Columns

    Variable names can be...

  • RE: Unique runs

    Search for "OMG" In J.M. article:

    http://www.sqlservercentral.com/articles/T-SQL/68467/

    It does explain the problem in details and gives good example.

  • RE: execute a procedure in another one

    Replace the line executing the proc with following:

    declare @dt datetime = CAST (FLOOR (CAST (CURRENT_TIMESTAMP as float )) as datetime)

    exec dbo.CreerFile '00000000-0000-0000-0000-000000000000',@RefCourrier , @dt

  • RE: Unique runs

    ...

    ...

    ,@tempno = helpergroupno = CASE

    ...

    Please note, the "three-parts" SET is not reliable. You better to split it to two of "two-part" SET's.

  • RE: Stored procedure in Where clause

    CELKO (8/29/2012)


    In the early days, we had to load parameters into registers in the hardware. Why are you still doing that with local variables?

    ...

    Oh those old days,

    They gone away.

    But...

  • RE: UPDATE when the values are the same

    ...

    In light of that, it makes a lot of sense to always code your update statements with conditions that verify that the rows actually need to be updated, especially since...

  • RE: UPDATE when the values are the same

    ...

    P.S. Respectfully, to everyone shouting at Sergiy: he may have an apparently combative style...

    I wouldn't call it shouting as such. But that exactly style makes this thread a real thriller!...

  • RE: UPDATE when the values are the same

    ....

    IF YOU DON'T FEED A TROLL EVENTUALLY IT WILL STARVE TO DEATH AND GO AWAY! LET THIS GUY BE WRONG AND MOVE ON! ALL HE IS DOING IS...

  • RE: Is UPDATE FROM only available in SQL 2005?

    ...

    You can slightly simplify this be leaving out the Group By clause in the subquery. It's not necessary, since the Where clause already enforces a distinct value. Not...

  • RE: Selecting records based on string search

    Luis Cazares (8/28/2012)


    Too complicated. Keep it simple.

    create procedure dbo.STORED_PROC_NAME

    (

    @sstrg varchar(100)

    )

    as

    begin

    set nocount on;

    --declare @strg varchar(100) = 'Catalog',

    set @sstrg = '%' + REPLACE( @sstrg, '*', '%') + '%'

    SELECT project_name

    FROM...

  • RE: increment values on day basis on column

    anuj12paritosh (8/28/2012)


    HI ALL

    PLEASE PROVIDE SOME EASY WAY IF YOU KNOW

    THANKS

    The easiest way to achieve that will be switching to SQL2012 and using sequences.

    All others ways will not be easy...

  • RE: ##table question?

    Sergiy (8/27/2012)


    SQL_path (8/27/2012)


    GSquared (8/24/2012)


    Same as any other table.

    and should i drop the ## table in sp2 and sp3 both?

    Generally the good practice is to drop objects within the same procedure...

  • RE: how to remove zero from my string

    Jeff Moden (8/24/2012)


    tyson.price (8/24/2012)


    Do you think this:

    SELECT SUBSTRING(@Source,PATINDEX('%[^'+@Char+'X]%',@Source),1000)

    out performs this:

    select REPLACE(LTRIM(REPLACE('000temp001', '0', ' ')), ' ', '0')

    "A Developer must not guess... a Developer must KNOW!" 😉 Test it. ...

  • RE: how to remove zero from my string

    tyson.price (8/24/2012)


    I get your point but, that is why we have comments. I will take performance over easy to read any day of the week. Comments are easy to type...

Viewing 15 posts - 1,306 through 1,320 (of 2,894 total)