Forum Replies Created

Viewing 15 posts - 3,991 through 4,005 (of 49,552 total)

  • RE: Rewrite query for better performance

    And does tblEventSample have any nonclustered indexes? If so, please post definitions of all of them.

    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: Snapshot Replication Between 2008 R2 and 2014 SSMS

    Should be OK. I've done transactional from 2008 R2 to 2012. iirc you'll need to ensure the distributor is on a SQL 2014 instance.

    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: Rewrite query for better performance

    Picture of the plan is useless, and you should have mentioned it's SQL 2000, as that removes a lot of options.

    Please run the query with SHOWPLAN_ALL and put the plan's...

    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: Rewrite query for better performance

    Table definitions, index definitions and execution plan (as a .sqlplan file) please.

    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 Server Hits 100% CPU and nothing works

    Eric M Russell (12/16/2015)


    It's not just looking at running queries, it's looking at cached execution plans since the last time the server was restarted.

    It's looking at queries whose plans are...

    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: why space is required for rebuild index. If i m doing rebuilt index what will be increase .mdf or .ldf file

    In short, it creates a new copy of the index and then drops the old one, logging the entire process (each new page allocated with contents)

    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: Insert records that do not exist

    pietlinden (12/15/2015)


    it's the INNER JOIN in your subselect. That's lossy (non-matching records on either side of the join are eliminted, which is what you do NOT want.)

    It's not 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: Insert records that do not exist

    Your exists subquery has no reference to the table in the outer query. Hence it will only be evaluated once and if the subquery returns any rows at all, the...

    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: Anti SQL Injection Function

    JohnG69 (12/15/2015)


    That parameter which I didn't want to bring up because I'm ashamed of... is a whole query 🙁

    You can't whitelist that without writing an entire SQL parser. Consider aliases....

    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: Anti SQL Injection Function

    No you don't, you check against the system tables for permanent tables for table and column names. I'd just prohibit temp tables, as those are harder to validate against.

    Basically, you...

    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: Is there a method to recover corrupted .ldf file?

    Restore from your last good backup (you do have recent backups, right?)

    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: Anti SQL Injection Function

    Whitelist means you reject anything that you don't explicitly allow. What you were talking about earlier

    So I have decided to create a generic function to validate the parameters to avoid...

    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: 2008 Cluster move to new hardware and upgarde to 2014

    Test, test, test!

    I have seen three upgrades this year to SQL 2014, two had severe performance problems afterwards. With the cardinality estimator changing that in itself is enough to warrant...

    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: Using count(*) performance

    Don't just look at the execution plan operators and assume which is better. Test. Get actual metrics and compare numbers (and I don't mean cost %).

    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: Anti SQL Injection Function

    jghali (12/14/2015)


    My question is can someone find a way to get through this function and still cause damage by injecting unwanted SQL?

    Yes. Pretty easily. Send the injected string 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

Viewing 15 posts - 3,991 through 4,005 (of 49,552 total)