Forum Replies Created

Viewing 15 posts - 3,616 through 3,630 (of 5,393 total)

  • RE: New Stored Procedure

    You could also add some PRINT commands to the IF/ELSE branches to see the path it took.

    Maybe this is easier than setting up a trace...

    -- Gianluca Sartori

  • RE: New Stored Procedure

    Well, it doesn't work as you expected, but it probably works the way you coded it.

    Since you only gave us the code and not an explanation of the expected behaviour,...

    -- Gianluca Sartori

  • RE: help in my procedure

    Brandie Tarvin (12/16/2010)


    Gianluca Sartori (12/16/2010)


    CELKO (12/15/2010)


    3) Why are you wasting time with dynamic SQL?

    Actually, dynamic SQL is the most efficient way to handle optional parameters in stored procedures.

    Using COALESCE,...

    -- Gianluca Sartori

  • RE: help in my procedure

    CELKO (12/15/2010)


    3) Why are you wasting time with dynamic SQL?

    Actually, dynamic SQL is the most efficient way to handle optional parameters in stored procedures.

    Using COALESCE, ISNULL, CASE and OR...

    -- Gianluca Sartori

  • RE: help in my procedure

    WayneS (12/15/2010)


    Craig Farrell (12/15/2010)


    Actually, the WHERE 1=1 is a neat little trick to avoid doing extra if statements to determine if something starts the clause and needs an AND. ...

    -- Gianluca Sartori

  • RE: Is SP and InlineSQL performace almost same in mordern version of database than Old Version ?

    Shubhajyoti Ghosh (12/14/2010)


    So do you mean SP and cached Inline Query (Parametarized SQL of ORM using sp_executesql) performance wise same?

    Yes, as far as cache-hits is concerned. The same exact code...

    -- Gianluca Sartori

  • RE: Is SP and InlineSQL performace almost same in mordern version of database than Old Version ?

    What a question! Really hard to give a sensible answer.

    I think this one needs to broken into several points:

    1) Query parsing / compilation

    ORMs generate SQL code that has to be...

    -- Gianluca Sartori

  • RE: Construct an EXECUTE string

    Mac_85 (12/13/2010)


    I must have missed a whole lot (having not used these before).

    ADO Command Objects can help you avoiding sql injection and, whenever the procedure is called multiple times, can...

    -- Gianluca Sartori

  • RE: Construct an EXECUTE string

    I don't know exactly what is causing the error. It seems to be related to the parameter type.

    You could try to create the parameters reading from the stored procedure metadata,...

    -- Gianluca Sartori

  • RE: Versioning

    You could take a look at this book on Team-based development:

    http://www.sqlservercentral.com/articles/books/71472/

    The ebook is free.

    -- Gianluca Sartori

  • RE: Construct an EXECUTE string

    Instead of constructing a sql string containing a string representation of the parameters, you'd better use a command object and pass the parameters as such.

    Example:

    Dim cmd, sql, prm, conn

    Set cmd...

    -- Gianluca Sartori

  • RE: a syntax error

    This should do:

    (Emp_Name=Case when @VarEmp_Name is not null Then @VarEmp_Name Else Emp_Name end)And

    Hope this helps,

    Gianluca

    -- Gianluca Sartori

  • RE: Are the posted questions getting worse?

    GSquared (12/6/2010)


    Steve Jones - SSC Editor (12/6/2010)


    .... It's actually impossible to get a real person at google.

    Real people are overrated. I've had plenty of tech support people fail the...

    -- Gianluca Sartori

  • RE: procedure call

    RETURN exits from current procedure and doesn't affect callers.

    command-1 will be executed.

    -- Gianluca Sartori

  • RE: provider: Named Pipes Provider, error: 40

    Check your local server connectivity settings.

    You will find it in your start menu: MS SQL Server --> Configuration Tools --> SQL Server Configuration Manager.

    Select from the tree view on the...

    -- Gianluca Sartori

Viewing 15 posts - 3,616 through 3,630 (of 5,393 total)