| bio | website | sqlsalt.com |
|---|---|---|
| location | ||
| age | ||
| visits | member for | 1 year, 11 months |
| seen | 8 mins ago | |
| stats | profile views | 440 |
SQL Server Premier Field Engineer at Microsoft.
Twitter: @SQLife
Blog: http://sqlsalt.com
Email: sqlsalt [at] outlook [dot] com
Disclaimer
The views expressed on my posts on this site are mine alone and do not reflect the views of my company. All posts of mine are provided "AS IS" with no warranties, and confers no rights.
The following disclaimer applies to all code, scripts and demos available on my posts:
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
|
May 25 |
comment |
SQL Server SMO Method “Discover()” @ShawnMelton If you want to get all tables, for example, pipe your Select-Object cmdlet to this: Where-Object {$_.Type -eq "Table"}. Make sense? |
|
May 25 |
comment |
SQL Server SMO Method “Discover()” Instead of the BaseType property, I'd suggest using the Name property. It's a bit more readable: $_.GetType().Name. |
|
May 24 |
comment |
Why index REBUILD does not reduce index fragmentatation? @AaronBertrand Hahahahaha Nice! JNK is a mod! |
|
May 24 |
comment |
Why index REBUILD does not reduce index fragmentatation? Great point, +1. |
|
May 24 |
answered | Why index REBUILD does not reduce index fragmentatation? |
|
May 24 |
comment |
Network-related or instance-specific error when running SQL Server 2008 R2 Express We need to see what the error is in the event log. |
|
May 23 |
awarded | Excavator |
|
May 23 |
revised |
Does it make sense to use SQL Server's bracket notation in hand written code? added 7 characters in body |
|
May 23 |
revised |
Performance difference between SQL Server Linked Server and direct query added 12 characters in body |
|
May 22 |
comment |
Is it recommended to clear the query plan cache @EricHiggins I'd rather spend 5 minutes writing a quick script (joining plans with sql text to find referencing plans of the newly-optimized query, pretty simple) than spending 1 hour fielding phone calls and explaining to non-data professionals and "curious" (read: "upset") users wondering why there was a performance degradation. |
|
May 22 |
comment |
Is it recommended to clear the query plan cache @EricHiggins So you're looking at the top 50 plans cached. What about the other 1000 plans that are cached, not changed, and benefiting requests without having to recompile? |
|
May 22 |
comment |
can I convert an integer to base-2 without a function @JHFB Check out this link on Bitwise Operators in SQL Server (msdn.microsoft.com/en-us/library/ms176122.aspx). Basically & does a bitwise AND comparison. So for each possible bit mask day, I AND (&) it with the decimal value of the particular bit set. If it's zero, that bit isn't set. If it's greater than zero, it is. I probably didn't explain that very well, but there are a lot of online tutorials on bit logic that'll do much better at explaining that. |
|
May 22 |
revised |
can I convert an integer to base-2 without a function edited tags |
|
May 22 |
answered | can I convert an integer to base-2 without a function |
|
May 22 |
comment |
Is it recommended to clear the query plan cache @StuartBlackler In that case, I would still recommend not to clear the plan cache as a whole. You can call DBCC FREEPROCCACHE (msdn.microsoft.com/en-us/library/ms174283.aspx) and specify the plan handle as a parameter. This will remove a single plan from the cache. Writing a little clever T-SQL you could loop through all the plans you want to clear to get them out of there. The benefit of this is you won't affect the other 85% of the plan cache. Like most things in production, though, if you decide to go that route definitely test it out in an isolated environment. |
|
May 22 |
revised |
Is it recommended to clear the query plan cache edited tags |
|
May 22 |
comment |
Is it recommended to clear the query plan cache Ah, ok. I see your note now. What % of the queries in your plan cache have you optimized? Not by space, but by usecounts. |
|
May 22 |
answered | Is it recommended to clear the query plan cache |
|
May 21 |
comment |
Allow db_owner to add/view existing logins to database I just realized this is an old post. Sorry for coming into the game late. :) |
|
May 21 |
comment |
Allow db_owner to add/view existing logins to database I think the OP wants to do it with db principals. You're answer is the way he should be doing it though. +1 |