Forum Replies Created

Viewing 15 posts - 271 through 285 (of 370 total)

  • RE: SQL Injection and sp_executesql

    GilaMonster (10/1/2011)

    Let's say, while you're on vacation the junior developer has to make a change and he can't figure out how to get that sp_executesql working again, so he changes...

  • RE: SQL Injection and sp_executesql

    Lexa (10/1/2011)


    GilaMonster (10/1/2011)


    Lexa (10/1/2011)


    codebyo (10/1/2011)


    'sp_executesql' will do that for you.

    codebyo, what exactly do you mean by it will do that for you? If a '; drop table --' command...

  • RE: SQL Injection and sp_executesql

    Or maybe I'm just making a big confusion or haven't understood clearly. Thank you for your advices. πŸ˜€

    Best regards,

  • RE: SQL Injection and sp_executesql

    GilaMonster (10/1/2011)


    codebyo (10/1/2011)


    I see many procedures that have checks for every parameter passed instead of doing as advised here in this topic. πŸ™‚

    Defend in depth. Check parameters and use parameterisation...

  • RE: SQL Injection and sp_executesql

    Lexa (10/1/2011)


    codebyo (10/1/2011)


    'sp_executesql' will do that for you.

    codebyo, what exactly do you mean by it will do that for you? If a '; drop table --' command is passed,...

  • RE: SQL Injection and sp_executesql

    Plus you won't need any parameter checks for SQL injection at the beginning of your code when you use 'sp_executesql' properly as Gail advised.

    'sp_executesql' will do that for you.

    Best regards,

  • RE: ROW_NUMBER() OVER (PARTITION BY *** ORDER BY ***) excluding NULL values

    drew.allen (9/29/2011)


    The problem with a UNION (ALL) is that you will have to scan the table twice. Here is an approach that only scans the table once.

    SELECT [ID]

    ...

  • RE: Business Intelligence Development Version

    Good question.

    And that's what I always wondered: is Microsoft dropping support for BIDS in favor of a new technology?

    This happened with Report Builder which is now being dropped because of...

  • RE: Table update problem

    You beat me to it, ColdCoffee. πŸ˜€

    Here's my code anyway:

    SELECT t1.startdate, t1.enddate_goal, t2.date_goal

    FROM (SELECT ROW_NUMBER() OVER (PARTITION BY account ORDER BY startdate) AS NId, startdate, enddate_goal, account

    ...

  • RE: Database will not be dropped

    Does 'sp_detach_db' work?

    Best regards,

  • RE: Query to combine two fields into one output

    For a variable size code, you can do something like this:

    DECLARE @Size INT = 7;

    SELECT

    REPLICATE('0', @Size-LEN(CAST(1234 AS VARCHAR(MAX)))) + CAST(1234 AS VARCHAR(MAX)) +

    REPLICATE('0', @Size-LEN(CAST(76541 AS VARCHAR(MAX))))...

  • RE: TempDB

    SQL Kiwi (9/28/2011)


    Ah, a good precise question that doesn't require me to parse a T-SQL batch in my head. Nice.

    :laugh:

    Agree. Easy and straightforward question that shows an important limitation...

  • RE: What’s in YOUR Recovery Plan?

    SQLBOT (9/27/2011)


    Oh, and I'd really love to see zombies ruling the world. πŸ˜€

    I'm prepared for it!! πŸ˜›

    If all goes wrong we can always hide inside a mall and wait...

  • RE: Find first day of a week/month

    Hmm. What do you mean? September 1st is Thursday, not the first day of the week.

    Day of week would be like this:

    SELECT CASE DATEPART(WEEKDAY, '20110901')

    ...

  • RE: SQL Script to Run DOS Batch File

    pelusodm (9/27/2011)


    Andre,

    Thanks for your response to my post. If you could describe your solution in simpler terms (I'm a SQL Server newbie), it would be much appreciated.

    Thanks

    Hmm... no offense...

Viewing 15 posts - 271 through 285 (of 370 total)