Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Team Bloggers

Browse by Tags

All Tags » SQL   (RSS)

  • Microsoft SQL Server 2005 Compact Edition available now!

    You can get to the download and a bunch of information at http://www.microsoft.com/sql/editions/compact/default.mspx . Note that the Choosing Between SQL Server 2005 Compact Edition and SQL Server 2005 Express Edition whitepaper actually has some more content than the title would indicate, and does a pretty good job at putting the SQL Server 2005 Compact Edition in the context of all the other editions, not just Express Edition. Personally, I'm thrilled at the possibilities that the Compact Edition brings by virtue of having a very small footprint, an in-process architecture and being ClickOnce-enabled. There are some changes in development habits that need to kick in along with the new possibilities (read up on stored procedure support and the rationale for in-process databases in the "choosing" whitepaper, for example). It's going to be very cool to see where developers will take this! Read More...
  • STDEV? STEDEVP!

    Color-coding in SMSS just got me here... I needed to write STDEVP , but as soon as STDEV turned the right color, I went on to write the next expression, and didn't get the results I expected. Bad Marcelo. :) In any case, the rule is fairly straight forward to remember (and you can always see the list of aggregate functions here to reassure yourself): for a function that acts on a sample, a "P" suffix indicates that it acts on the population instead. And you can always look it up on Live if you can't remember which one you should use. Read More...
  • Dealing with renamed/localized user/group names with managed code

    If you are a regular reader of Michael Kaplan (I know I am), you might have run across his What's in a name? (once more) post. He comments on the use of localized account names and points to the KB 157234, How to deal with localized and renamed user and group names . For those of you running on managed code, be happy - the code to get well-known accounts is much simpler. A little bit of SecurityIdentifer , a dash of WellKnownSidType , and you should be ready to go. // Build with: %windir%\Microsoft.Net\Framework\v2.0.50727\csc.exe foo.cs using System; using System.Security.Principal; class DoIt { public static void Main(string[] args) { WellKnownSidType[] knownSids = new WellKnownSidType[] { WellKnownSidType.LocalServiceSid, WellKnownSidType.NetworkServiceSid, WellKnownSidType.LocalSystemSid, WellKnownSidType.BuiltinAdministratorsSid, }; foreach(WellKnownSidType knownSid in knownSids) { SecurityIdentifier identifier = new SecurityIdentifier(knownSid, null); NTAccount account = (NTAccount)identifier.Translate(typeof(NTAccount)); Read More...
  • Transfer data to an Excel workbook programmatically

    Just today I came across this excellent Knowledge Base article: How to transfer data to an Excel workbook by using Visual C# 2005 or Visual C# .NET It discusses a number of methods to get the task done, and seeing them all together in one page is quite handy. With the new Office Open XML file formats , however, there is yet another lightweight alternative for generation that combines rich formatting (which is missing in comma-separated value generation) with the ability to run without Excel running in the process (great for ASP.NET-like scenarios). Very, very cool stuff. Read More...
  • Character matching

    For some background on this, let me refer you to Michael Kaplan's excellent post at http://blogs.msdn.com/michkap/archive/2005/01/11/350482.aspx . Sometimes you will be an environment in which string comparisons don't quite work like you expect them to. One thing to quickly rule out is that your strings actually have the values you think you're looking for. select cast('(text)' as nvarchar(max)), cast(0x00 as varbinary(max)) union all select firstname, cast(firstname as varbinary(max)) from person.contact where contactid = 2 union all select N'Catherine', cast(N'Catherine' as varbinary(max)) union all select 'Catherine', cast('Catherine' as varbinary(max)) If you run with on the AdventureWorks database, you'll get these results back (text) 0x00 Catherine 0x43006100740068006500720069006E006500 Catherine 0x43006100740068006500720069006E006500 Catherine 0x436174686572696E65 All I'm doing here is showing the encoding for the string 'Catherine' as it appears in the database, and the one I'm Read More...

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us