<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'Statistics' and 'security'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=Statistics,security&amp;orTags=0</link><description>Search results matching tags 'Statistics' and 'security'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Connect Digest : 2009-07-18</title><link>http://sqlblog.com/blogs/aaron_bertrand/archive/2009/07/18/connect-digest-2009-07-18.aspx</link><pubDate>Sat, 18 Jul 2009 14:54:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:15326</guid><dc:creator>AaronBertrand</dc:creator><description>&lt;p&gt;I missed last week because I was having fun up in Canada... mostly without any kind of computer access at all.&amp;nbsp; It was a nice break, but now I'm back in the thick of things again.&amp;nbsp; So this week, I am going to try to beef it up a bit to compensate for last week's missing entry.&lt;/p&gt;&lt;p&gt;=================================== &lt;/p&gt;&lt;p&gt;&lt;b&gt;DELETE vs. DROP &lt;/b&gt;&lt;/p&gt;&lt;p&gt;I have always found the mix of these two terms a little perplexing, but over time I see more and more people asking questions like, "can I issue DELETE against a stored procedure?" and, "I ran DELETE dbo.table, but dbo.table still exists, why?"&amp;nbsp; Part of the confusion comes from the fact that if you right-click a table in Object Explorer, there is a context menu item that says "Delete" but this is actually a DROP which drops the table, not a DELETE that deletes the data in the table.&amp;nbsp; I find this confusing, but Microsoft's response is that changing this to DROP would make this more confusing.&amp;nbsp; I disagree with this and I hope you do as well.&amp;nbsp; I would hope that they could add a DROP menu option, and if they want to support a DELETE also then they could add an option like "Edit Top N rows" - which should of course give you the opportunity to edit the WHERE and ORDER BY clauses before running.&amp;nbsp; And of course there should never be a "Delete" menu item for a stored procedure; DROP is more appropriate.&amp;nbsp; The tool shouldn't be used as encouragement for people to not bother learning the difference between DROP and DELETE.&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=473286" title="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=473286" target="_blank"&gt;#473286 : SSMS : change "Delete" to "DROP" on context menu for objects&lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;===================================&amp;nbsp; &lt;/p&gt;&lt;p&gt;&lt;b&gt;YYYY-DD-MM is for the birds&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Fellow MVP Steve Kass has been a huge proponent of deprecating the YYYY-DD-MM format for DATETIME values.&amp;nbsp; He didn't get his wish fulfilled for SQL Server 2008, so now there are all kinds of confusing behaviors with the new DATE/DATETIME2 types (which behave correctly) and the legacy DATETIME/SMALLDATETIME types (which do not).&amp;nbsp; So at the very least, the behavior should be better documented.&lt;/p&gt;&lt;p&gt;&lt;a href="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=290971" title="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=290971" target="_blank"&gt;#290971 : Deprecate the date literal interpretation 'YYYY-DD-MM'&lt;/a&gt;&lt;/p&gt;&lt;div class="SubTitle"&gt;&lt;a href="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=363229" title="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=363229" target="_blank"&gt;#363229 : Confusing and undocumented behavior changes in some expressions involving literal dates&lt;/a&gt;&lt;/div&gt;&lt;p&gt;===================================&amp;nbsp; &lt;/p&gt;&lt;p&gt;&lt;b&gt;Seeing too many databases&lt;/b&gt; &lt;br&gt;&lt;/p&gt;&lt;p&gt;I have been complaining for a long time that when you connect to a shared SQL Server with hundreds of databases, and you only have access to a few ( or in a lot of cases one), you still see all of the databases you don't have access to, and have to wait for Object Explorer to enumerate them all.&amp;nbsp; They fixed a few bugs early on which actually caused errors when certain properties were checked against the databases you didn't have access to, which created havoc for at least one ISP I know of when their users started upgrading to the 2008 version of SSMS.&amp;nbsp; And I searched around for quite a while, certain that this was a duplicate, but I couldn't find an existing Connect item that treated the true core of the problem.&amp;nbsp; Thankfully one was created the other day:&lt;br&gt;&lt;/p&gt;&lt;div class="SubTitle"&gt;&lt;a href="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=474490" title="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=474490" target="_blank"&gt;#474490 : Limiting/restricting view of SQL Server databases in Object Explorer&lt;/a&gt; &lt;br&gt;&lt;p&gt;===================================&amp;nbsp; &lt;/p&gt;&lt;p&gt;&lt;b&gt;Easily determining path information&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Fellow MVP Louis Davidson ("Dr. SQL") makes a good point, that we have very ugly hacks in place for programmatically determining the configuration for the locations of key file types such as data, log, error, etc.&amp;nbsp; He is asking for something relatively simple: a new DMV (or additional columns in an existing DMV) that exposes this information.&amp;nbsp; This is one of the few pieces of data that is easier to get through the SSMS UI than through code.&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=474826" title="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=474826" target="_blank"&gt;#474826 : Access to path information about SQL Server&lt;/a&gt;&lt;/p&gt;&lt;p&gt;===================================&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Statistics enhancements&lt;/b&gt;&lt;/p&gt;&lt;p&gt;"Mpls Mike" filed two items that I can agree with.&amp;nbsp; They are quite similar in that they are both asking for more information in the DMV sys.stats and the STATS_DATE() function.&amp;nbsp; One is that there should be columns indicating the date/time when the stats were created and when they were last updated; the other asks for columns that indicate when the stats have become stale or otherwise invalid. &lt;/p&gt;&lt;div class="SubTitle"&gt;&lt;a href="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=475268" title="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=475268" target="_blank"&gt;#475268 : Add create_date and modify_date to sys.stats catalog view&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=475270" title="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=475270" target="_blank"&gt;#475270 : Add column to sys.stats to indicate if the optimizer considers statistics out of date/invalid&lt;/a&gt;&lt;/p&gt;&lt;p&gt;===================================&amp;nbsp; &lt;/p&gt;

&lt;p&gt;&lt;b&gt;Can't perform index maintenance on CDC-enabled tables&lt;/b&gt;&lt;/p&gt;&lt;p&gt;This is a big one that was unfortunately missed by a lot of us throughout the SQL Server 2008 beta.&amp;nbsp; If you have Change Data Capture enabled on a table, any ALTER statement fails, including simple index maintenance scripts.&amp;nbsp; You can use DBCC DBREINDEX instead, but this is not a perfect answer either, since this command has been deprecated in favor of ALTER INDEX ... REBUILD.&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=474589" title="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=474589" target="_blank"&gt;#474589 : Alter index on CDC enabled tables&lt;/a&gt;&lt;/p&gt;&lt;p&gt;===================================&amp;nbsp; &lt;/p&gt;&lt;p style="font-weight:bold;"&gt;SQL Server Agent and job history purging&lt;/p&gt;&lt;p&gt;Ranga Narasimhan pointed out that, depending on your retention settings and number of jobs, you can easily lose all of the history for a job.&amp;nbsp; I agree that this can be troublesome on busy servers where you often find out about job failures long after they've failed.&amp;nbsp; The item is marked as Closed (Won't Fix) but if you read the comments you'll see that this is a mistake that they haven't yet corrected. &lt;br&gt;&lt;/p&gt;&lt;div class="SubTitle"&gt;&lt;a href="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=368649" title="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=368649" target="_blank"&gt;#368649 : Leave at least one Job history entry for a job&lt;/a&gt;&lt;/div&gt;&lt;p&gt;===================================&amp;nbsp; &lt;/p&gt;&lt;p style="font-weight:bold;"&gt;Limited typing capabilities in "Edit Top N Rows"&lt;/p&gt;&lt;p&gt;Last week when I was trying to reproduce an end user issue, I came across an annoying behavior in the &lt;span style="text-decoration:line-through;"&gt;Open Table&lt;/span&gt; Edit Top N Rows dialog, where if you type SHIFT+SPACE (e.g. type "FOO BAR" while holding the Shift key) while editing the cell data, you get dumped out of the cell (however you can keep typing) and only "FOO" appears.&amp;nbsp; This can be pretty annoying and counter-intuitive; while my "workaround" is to revert to what I always do (write DML statements like a normal person), this is still something that should be fixed if they want people to continue trusting the UIs within SSMS.&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=473303" title="http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=473303" target="_blank"&gt;#473303 : SSMS : "Edit Top n Rows" mishandles a space character&lt;/a&gt;&lt;/p&gt;&lt;p&gt;===================================&amp;nbsp; &lt;/p&gt;

&lt;p style="font-weight:bold;"&gt;&lt;span style="font-weight:normal;"&gt;So, I hope those are enough items to keep you busy for a while.&amp;nbsp; :-)&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Hacking Social Security Numbers</title><link>http://sqlblog.com/blogs/michael_coles/archive/2009/07/12/hacking-social-security-numbers.aspx</link><pubDate>Mon, 13 Jul 2009 00:09:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:15230</guid><dc:creator>Mike C</dc:creator><description>&lt;P&gt;According to &lt;A title="PNAS: Predicting SSNs" href="http://www.pnas.org/content/106/27/10975.full.pdf+html?sid=f655da07-5374-4129-afe3-a09ba3f3fe69"&gt;this paper&lt;/A&gt; from the Proceedings of the National Academy of the Sciences (PNAS), social security numbers (SSNs) are pretty easy for hackers, identity thieves,&amp;nbsp;and other miscreants to predict based on publicly available data. I found this interesting partly because I just recently (a few months ago) wrote a chapter for a book discussing security&amp;nbsp;for SSNs.&lt;/P&gt;
&lt;P&gt;Here's the deal - all SSNs have a very regular structure that looks like this: &lt;EM&gt;xxx&lt;/EM&gt;-&lt;EM&gt;yy&lt;/EM&gt;-&lt;EM&gt;zzzz&lt;/EM&gt;. With&amp;nbsp;9 numeric digits there are 1 billion possible combinations that can be assigned.&amp;nbsp; And of course we have the same information that identity thieves have - the rules for SSN assignment are posted for the public at the &lt;A title="SSA Homepage" href="http://www.ssa.gov/"&gt;Social Security Administration website&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Here are some of the &lt;A title="SSA: SSN Assignment Rules" href="http://ssa-custhelp.ssa.gov/cgi-bin/ssa.cfg/php/enduser/std_adp.php?p_faqid=425&amp;amp;p_created=972930021&amp;amp;p_sid=h6SE_GCj&amp;amp;p_accessibility=0&amp;amp;p_redirect=&amp;amp;p_lva=&amp;amp;p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9MjAsMjAmcF9wcm9kcz0mcF9jYXRzPTE2LDU4JnBfcHY9JnBfY3Y9Mi41OCZwX3NlYXJjaF90eXBlPWFuc3dlcnMuc2VhcmNoX25sJnBfcGFnZT0x&amp;amp;p_li=&amp;amp;p_topview=1"&gt;key rules&lt;/A&gt; that determine how SSNs are assigned, summarized from the &lt;A title="SSA: Rules for SSN Assignment" href="http://ssa-custhelp.ssa.gov/cgi-bin/ssa.cfg/php/enduser/std_adp.php?p_faqid=425&amp;amp;p_created=972930021&amp;amp;p_sid=h6SE_GCj&amp;amp;p_accessibility=0&amp;amp;p_redirect=&amp;amp;p_lva=&amp;amp;p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9MjAsMjAmcF9wcm9kcz0mcF9jYXRzPTE2LDU4JnBfcHY9JnBfY3Y9Mi41OCZwX3NlYXJjaF90eXBlPWFuc3dlcnMuc2VhcmNoX25sJnBfcGFnZT0x&amp;amp;p_li=&amp;amp;p_topview=1"&gt;SSA website&lt;/A&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;EM&gt;xxx&lt;/EM&gt; is a 3-digit Area Number, and is assigned based on the ZIP Code from which the request to assign the SSN originates.&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;yy &lt;/EM&gt;is a 2-digit Group Number, which is assigned in a predictable (nonconsecutive) order. The order of assignment of Group Numbers is also documented on the SSA website as well.&amp;nbsp; It's always a number between "01" and "99".&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;zzzz&lt;/EM&gt; is a 4-digit Serial Number, which is a number between "0001" and "9999".&lt;/LI&gt;
&lt;LI&gt;There are a few stray SSNs that have been taken out of circulation for various reasons (used in marketing campaigns, etc.)&lt;/LI&gt;
&lt;LI&gt;And of course no SSN is ever reassigned.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;According to the rules a bad guy can narrow down the scope of his search substantially just by eliminating all SSNs that begin with 8&lt;EM&gt;xx&lt;/EM&gt;, 9&lt;EM&gt;xx&lt;/EM&gt;, 666, and 000.&amp;nbsp; That eliminates a couple 100 million+.&amp;nbsp; No SSNs have been assigned with a Group Number above 772, eliminating tens of millions in the 773 - 799 range.&amp;nbsp; No SSNs have, or will be, assigned with Group Numbers of 00 or Serial Numbers of 0000, eliminating millions more.&amp;nbsp; In addition the Group Numbers that have been assigned are available from the SSA website &lt;A title="SSA: High Group List" href="http://www.socialsecurity.gov/employer/ssnvhighgroup.htm"&gt;high group list&lt;/A&gt;, knocking hundreds of millions more possible SSNs off the list.&lt;/P&gt;
&lt;P&gt;This is just the beginning -- it gets better:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you know where a person applied for their SSN (in many cases this will be where they were born, or close to it) you can use the &lt;A title="SSA: SSN Allocations List" href="http://www.socialsecurity.gov/employer/stateweb.htm"&gt;SSN Allocations list&lt;/A&gt;&amp;nbsp;to narrow down the search substantially.&amp;nbsp; In some cases this won't work though, since some parents don't apply for an SSN for their child immediately at birth.&lt;/P&gt;
&lt;P&gt;All this is to show how an identity thief&amp;nbsp;can use the location and approximate date of birth to accurately guess the first 5 digits of the SSN.&amp;nbsp; The PNAS authors were able to correctly guess the first 5 digits of SSNs &lt;EM&gt;with a single try&lt;/EM&gt; for 44% of their test records.&lt;/P&gt;
&lt;P&gt;At the other end of the spectrum, identity thieves can use the SSA's &lt;A title="SSA: Death Master File" href="http://ssa-custhelp.ssa.gov/cgi-bin/ssa.cfg/php/enduser/std_adp.php?p_faqid=149"&gt;Death Master File&lt;/A&gt; (DMF) to narrow down the last 4 digits (the Serial Number).&amp;nbsp; The PNAS authors used the DMF to figure out statistical distributions of SSN Serial Numbers to dramatically narrow down the last 4 digits.&amp;nbsp; They correctly guessed the complete SSNs for 8.5% of the test records with less than 1,000 attempts each; making the SSN for 8.5% of those tested less secure than a 4-digit ATM card PIN (in fact the authors compared it to an insecure&amp;nbsp;3-digit financial PIN).&lt;/P&gt;
&lt;P&gt;The authors' testing showed that overall full SSNs can be guessed with an accuracy of between 0.08% to 10% with less than 1,000 attempts each.&amp;nbsp; In rural areas they guessed complete SSNs at the rate of &amp;gt;60% for rural areas &lt;EM&gt;on the very first attempt&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;To put some hard numbers to it, the authors estimated (based on various fairly reasonable assumptions), that an identity thief targeting a specific location (like a given state) could guess SSNs and obtain credit card accounts at the rate of about 47 per minute.&lt;/P&gt;
&lt;P&gt;Makes you wonder how secure your SSN is, really.&lt;/P&gt;</description></item></channel></rss>