Forum Replies Created

Viewing 15 posts - 18,571 through 18,585 (of 49,552 total)

  • RE: Are the posted questions getting worse?

    Your doing it wrong....

    Lynn Pettis (5/9/2012)


    -- 1st cursor-based solution, loops through all 2135 employee records and updates them all, some with a new salary:

    DECLARE empCursor CURSOR FOR

    SELECT

    ...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: improve performance of sp

    Why are you trying to insert into an identity column?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: improve performance of sp

    riya_dave (5/9/2012)


    is there any way i can use any other things on my table variable,which needs to insert duplicate values.

    Temp table, proper indexing, get rid of the cursor, stop guessing.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Secondary File data storage

    If there are three files in one filegroup, then data will be written to them all according to the proportional fill algorithm

    http://msdn.microsoft.com/en-us/library/ms187087%28v=sql.100%29.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Table-based Functions vs. Views

    SQLKnowItAll (5/9/2012)


    You can use 1 SP built to handle all 3 of those scenarios and then no views, no functions, and you only change 1 SP. 1 SP per class.

    But...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: SQL Injection Vulnerability Question

    cfradenburg (5/9/2012)


    Wouldn't it be possible that the code that calls that to be vulnerable to SQL injection though?

    Yes, but it's also possible that it isn't. Can't draw any conclusions at...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: SSMS stops while showing query execution plan

    If it's the code with the cursor, it will take ages because there will be hundreds, maybe even thousands of execution plans. If there's a cursor anywhere in the code,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: improve performance of sp

    riya_dave (5/9/2012)


    i am thinking which join is better ,i am using inner and left join.

    Neither. They do different things, so you use the one you need for the data that...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: SQL Injection Vulnerability Question

    Yup, that code is vulnerable to SQL Injection. If it's taking the value straight from user input with no sanitisation, no validation, that's one mighty big hole right there.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Table-based Functions vs. Views

    Putts (5/9/2012)


    Because then your App is tied directly to the make-up of each individual SP.

    Yes, and what's wrong with that?

    1. Create Table

    2. Create View

    3. Right App...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Table-based Functions vs. Views

    SQLKnowItAll (5/9/2012)


    Maybe you missed the post in which Gail said that using a table-valued UDF causes a table scan every time.

    I have never said such a thing because it...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Unable to open the physical file trying to attach AdvntrWrks2008 DB

    Whichever account SQL Server is running as.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Unable to open the physical file trying to attach AdvntrWrks2008 DB

    Yes, so was mine when I ran into this. Welcome to UAC. Give it a try, nothing to lose.

    If that still doesn't work, check that the folder mentioned exists and...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: SQL Injection Vulnerability Question

    No, that code as you posted can't have any SQL injected. That said, it's very inefficient.

    http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/

    To have a SQL Injection vulnerability requires that some user input be concatenated into an...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Table-based Functions vs. Views

    Putts (5/9/2012)


    Any change to the table then forces you to refresh all your SPs.

    Not at all. The only time that a procedure might need refreshing if the table...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 18,571 through 18,585 (of 49,552 total)