<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rickey Whitworth&#039;s Blog &#187; MS Servers</title>
	<atom:link href="http://www.whitworth.org/category/ms-servers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.whitworth.org</link>
	<description>insights from managing a microsoft enterprise infrastructure</description>
	<lastBuildDate>Tue, 22 Jun 2010 17:12:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ten Common SQL Server Reporting Services Challenges and Solutions</title>
		<link>http://www.whitworth.org/2009/10/22/ten-common-sql-server-reporting-services-challenges-and-solutions/</link>
		<comments>http://www.whitworth.org/2009/10/22/ten-common-sql-server-reporting-services-challenges-and-solutions/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 03:11:26 +0000</pubDate>
		<dc:creator>rwhitworth</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Reporting Services]]></category>

		<guid isPermaLink="false">http://www.whitworth.org/2009/10/22/ten-common-sql-server-reporting-services-challenges-and-solutions/</guid>
		<description><![CDATA[Great article. I have tried to solve several of these problems before with no success. 
In every business there are several different groups of report users, from chief executives, to business analysts, to operational staff, who all need access to reliable and current data in order to track overall business performance, investigate the effectiveness of [...]]]></description>
			<content:encoded><![CDATA[<p>Great article. I have tried to solve several of these problems before with no success. </p>
<blockquote><p>In every business there are several different groups of report users, from chief executives, to business analysts, to operational staff, who all need access to reliable and current data in order to track overall business performance, investigate the effectiveness of individual business functions, or simply for ad-hoc day-to-day reporting. </p>
<p>In most organizations, at least some attempt has been made to meet these reporting needs. Historically, however, the problem has been that the available reports have not always been up-to-date, or even accurate. Furthermore, individual departments have tended to adopt a &quot;silo&quot; approach, using different tools/systems to create reports that are useful within their silo, but not necessarily consistent or compatible with those produced by other departments. In many cases, there doesn&#8217;t even exist a shared understanding of the business data that underpin these reports.</p>
<p>SQL Server Reporting Services (SSRS), when it arrived, offered a much-needed means to centralize and standardize reporting across the business, and it has largely delivered. Having used SSRS 2005 for the past 4 years, I&#8217;ve found that, with a little effort, it can satisfy most business, ad-hoc, embedded, portal integration, web, and custom reporting needs. However, I&#8217;ve also found that small &quot;gotchas&quot; can halt progress and cause considerable frustration, as it&#8217;s not always easy to find ways round them in the documentation.</p>
</blockquote>
<p><a href="http://www.simple-talk.com/sql/reporting-services/ten-common-sql-server-reporting-services-challenges-and-solutions/">Ten Common SQL Server Reporting Services Challenges and Solutions</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.whitworth.org/2009/10/22/ten-common-sql-server-reporting-services-challenges-and-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Use Computed Column in SQL Server Databases with Computed-Column Samples</title>
		<link>http://www.whitworth.org/2009/09/29/how-to-use-computed-column-in-sql-server-databases-with-computed-column-samples/</link>
		<comments>http://www.whitworth.org/2009/09/29/how-to-use-computed-column-in-sql-server-databases-with-computed-column-samples/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 14:04:11 +0000</pubDate>
		<dc:creator>rwhitworth</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.whitworth.org/2009/09/29/how-to-use-computed-column-in-sql-server-databases-with-computed-column-samples/</guid>
		<description><![CDATA[Very detailed description of computed columns in SQL Server, with plenty of examples.&#160; 
How to Use Computed Column SQL Server Databases
What is Computed Column ?
If you have columns in your sql database tables such that their values depend on other columns, you may use computed columns.     Using computed columns or calculated [...]]]></description>
			<content:encoded><![CDATA[<p>Very detailed description of computed columns in SQL Server, with plenty of examples.&#160; </p>
<blockquote><h3>How to Use Computed Column SQL Server Databases</h3>
<h4>What is Computed Column ?</h4>
<p>If you have columns in your sql database tables such that their values depend on other columns, you may use computed columns.     <br />Using computed columns or calculated columns will enable you save the calculation logic of such computed values in database.      <br />And will save you from extra coding everytime you have to do when you require the computed item.</p>
<p>A computed column can be defined as an expression which can use other columns in the same table as well as using other table values via user-defined functions.     <br />The expression of the computation can be directly a name of a noncomputed column (*), constants, functions including sql or user-defined functions or can contain all in the computed column definition.      <br />It is important that the computed column expression can not be a subquery which means you can not use SELECT statements in the expression. Even if you are selecting a constant value like &quot;SELECT 1&quot; . </p>
<p>(*) As a note :     <br />A computed column in a table is not allowed to be used in another computed-column definition in the same table.      <br />You are reference a computed column in another table by using a user defined function in the expression of the calculated column.</p>
</blockquote>
<p><a href="http://www.kodyaz.com/articles/sql-server-computed-column-calculated-column-sample.aspx">How to Use Computed Column in SQL Server Databases with Computed-Column Samples</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.whitworth.org/2009/09/29/how-to-use-computed-column-in-sql-server-databases-with-computed-column-samples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Katmai (Sql 2008) &#8211; MERGE &#8211; More than UPSERT (more advanced uses) &#8211; Chad Boyd</title>
		<link>http://www.whitworth.org/2009/09/14/katmai-sql-2008-merge-more-than-upsert-more-advanced-uses-chad-boyd/</link>
		<comments>http://www.whitworth.org/2009/09/14/katmai-sql-2008-merge-more-than-upsert-more-advanced-uses-chad-boyd/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 13:47:13 +0000</pubDate>
		<dc:creator>rwhitworth</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2008]]></category>

		<guid isPermaLink="false">http://www.whitworth.org/2009/09/14/katmai-sql-2008-merge-more-than-upsert-more-advanced-uses-chad-boyd/</guid>
		<description><![CDATA[&#160;
So, more than likely almost everyone has already heard that Sql 2008 will introduce a MERGE syntax, making it much easier to deal with scenarios where you need to perform &#8216;upsert&#8217; type logic (i.e., you have a source data set and you want to put records from that source set into a target set (table, [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<blockquote><p>So, more than likely almost everyone has already heard that Sql 2008 will introduce a MERGE syntax, making it much easier to deal with scenarios where you need to perform &#8216;upsert&#8217; type logic (i.e., you have a source data set and you want to put records from that source set into a target set (table, updateable view), but some of the records already exist in the target, and some don&#8217;t &#8211; for those that exist, you want to perform an update, for those that don&#8217;t exist, you want to insert&#8230;hence, upsert <img src='http://www.whitworth.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). A simple bullet list of what you do when using the MERGE statement would include: </p>
<ul>
<li>Specify the source and target data sets </li>
<li>Specify joining conditions between the source and target data set </li>
<li>Specify 1 or more &#8216;matching&#8217; clauses </li>
<li>Specify the action to occur when matches do/don&#8217;t exist </li>
</ul>
<p>However, there is much to the MERGE statement that far exceeds simply &#8216;upsert&#8217; operations, for example: </p>
<ul>
<li>There are 3 separate matching clauses you can specify, not only 2 (so it&#8217;s not just an upsert if you want). The 3 matching clauses are:
<ul>
<li>WHEN MATCHED </li>
<li>WHEN [TARGET] NOT MATCHED </li>
<li>WHEN SOURCE NOT MATCHED</li>
</ul>
</li>
</ul>
</blockquote>
<p><a href="http://blogs.mssqltips.com/blogs/chadboyd/archive/2007/11/01/katmai-sql-2008-merge-more-than-upsert-more-advanced-uses.aspx">Katmai (Sql 2008) &#8211; MERGE &#8211; More than UPSERT (more advanced uses) &#8211; Chad Boyd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.whitworth.org/2009/09/14/katmai-sql-2008-merge-more-than-upsert-more-advanced-uses-chad-boyd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SMS/ConfigMgr &#8211; SQL Function to Convert Integer8 (from Active Directory) to Datetime/Local Time &#8211; Number2 Blog &#8211; myITforum</title>
		<link>http://www.whitworth.org/2009/09/09/smsconfigmgr-sql-function-to-convert-integer8-from-active-directory-to-datetimelocal-time-number2-blog-myitforum/</link>
		<comments>http://www.whitworth.org/2009/09/09/smsconfigmgr-sql-function-to-convert-integer8-from-active-directory-to-datetimelocal-time-number2-blog-myitforum/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 18:01:47 +0000</pubDate>
		<dc:creator>rwhitworth</dc:creator>
				<category><![CDATA[Network Administration]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.whitworth.org/2009/09/09/smsconfigmgr-sql-function-to-convert-integer8-from-active-directory-to-datetimelocal-time-number2-blog-myitforum/</guid>
		<description><![CDATA[This is a great post. I had looked at trying to find a way to convert Integer-8 values to datetime format using SQL functions before, but could never figure it out. Here it is, the entire post in case it ever disappears from its original site. 
It&#8217;s possible you&#8217;re pulling a value from Active Directory [...]]]></description>
			<content:encoded><![CDATA[<p>This is a great post. I had looked at trying to find a way to convert Integer-8 values to datetime format using SQL functions before, but could never figure it out. Here it is, the entire post in case it ever disappears from its original site. </p>
<blockquote><p>It&#8217;s possible you&#8217;re pulling a value from Active Directory for discovery like LastLogonTimeStamp which stores it&#8217;s value as something known as Integer8 (<a href="http://www.rlmueller.net/Integer8Attributes.htm">http://www.rlmueller.net/Integer8Attributes.htm</a>).&#160; If that&#8217;s the case, you may notice the values you&#8217;ve got saved in SQL aren&#8217;t perhaps what you were expecting:</p>
<p>128462210724001300</p>
<p>Fields within AD that have integer8 numbers like this include </p>
<ol>
<li>accountExpires </li>
<li>badPasswordTime </li>
<li>lastLogon </li>
<li>lockoutTime </li>
<li>maxStorage </li>
<li>pwdLastSet </li>
<li>uSNChanged </li>
<li>uSNCreated </li>
<li>lockoutDuration </li>
<li>lockoutObservationWindow </li>
<li>maxPwdAge </li>
<li>minPwdAge </li>
<li>modifiedCount </li>
</ol>
<p>So&#8230;what to do with this odd string of digits?&#160; It doesn&#8217;t look like a date, you can&#8217;t just CONVERT() it to a datetime value directly and it doesn&#8217;t look like it can be picked apart visually.&#160; Well, if you read up on that link above, you&#8217;ll see a solution there in VBScript.&#160; Well, that&#8217;s not going to fly for us, so why don&#8217;t we convert it to T-SQL.&#160; I&#8217;ve also seen a few SQL functions out there that some people have written, but they all seem to either make things way too complicated, or get something just a little wrong.&#160; So instead of copying something from the internet that we don&#8217;t understand or that may be wrong, let&#8217;s just use the information we know about integer8 values to figure it out.</p>
<p><strong>BACKGROUND</strong></p>
<p>Alright, unless you understand it better, the solution just isn&#8217;t going to make sense.&#160; So let me just give a quick background before we get into code to do the conversion.</p>
<p>Integer8.&#160; So integer8 is this 64-bit (8-byte) integer that is the cornerstone of certain date fields in Active Directory (like listed above).&#160; It represents the number of 100-nanosecond intervals that have elapsed since 1/1/1601.&#160; A nanosecond is 1 billionth of a second (so 1 billion of them to a second), which means there are 10 Million of these 100-nanosecond intervals in a second and 60 Million of them in a minute.&#160; So, if we figure out how many minutes an integer8 number represents, we can figure out what date is that many minutes from 1/1/1601.</p>
<p>One of the things we have to work around in T-SQL is the fact that in SQL 2005, the DATE* functions use a &quot;Base Date&quot; of 1/1/1900, meaning that&#8217;s as far back as it will go.&#160; So you can&#8217;t calculate how many minutes have elapsed since 1/1/1601, you have to do it from 1/1/1900.&#160; Which means you have to subtract out the minutes from 1/1/1601 to 1/1/1900 first.&#160; This isn&#8217;t an issue in SQL 2008 because it supports the <strong>DATETIME2</strong> data type which goes from 1/1/0001 to 12/31/9999.</p>
<p>Perhaps we should just get to the steps so it makes more sense:</p>
<p><strong>STEPS CONVERT INTEGER8 TO DATETIME</strong></p>
<p>Using the above link as a guide, here are the steps you need to perform:</p>
<p>FOR SQL 2000</p>
<ol>
<li>Buy SQL 2008 or higher and follow those instructions&#8230;seriously&#8230; </li>
</ol>
<p>FOR SQL 2005</p>
<ol>
<li>Given an integer8 date, figure out how many minutes elapsed that it represents       <br />(Divide the number by 60 Million) </li>
<li>Calculate a &quot;Base Date&quot; offset&#8211;the number of minutes-elapsed between 1/1/1601 and 1/1/1900       <br />(157258080) </li>
<li>Calculate the timezone bias so the output is in local time </li>
<li>Calculate the new number of minutes that have elapsed since the base date given the timezone bias       <br />(take the minutes elapsed, subtract the base-date offset and add the timezone bias) </li>
<li>Add that number of minutes to the base-date and determine the resultant date </li>
</ol>
<p>FOR SQL 2008</p>
<p>Because SQL 2008 has a datetime2 datatype, it can go all the way back to 1/1/1601 and perform date functions on it so the &quot;Base Date&quot; step isn&#8217;t necessary. </p>
<ol>
<li>Given an integer8 date, figure out how many minutes-elapsed that it represents       <br />(Divide the number by 60 Million) </li>
<li>Calculate the timezone bias so the output is in local time </li>
<li>Calculate the new number of minutes that have elapsed since 1/1/1601 given the timezone bias       <br />(take the minutes elapsed, subtract the base-date offset and add the timezone bias) </li>
<li>Add that number of minutes to 1/1/1601 and determine the resultant date </li>
</ol>
<p><strong>NOW, THE T-SQL</strong></p>
<p>SQL 2005</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-     <br />&#8211; FULL, STEP-BY-STEP METHOD      <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>&#8211; Don&#8217;t worry, this is step-by-step to show the logic. It can all be put into      <br />&#8211; one statement or a function like we&#8217;ve done below      <br />&#8211; TAKE AN INTEGER8, WHICH IS THE NUMBER OF 100-NANOSECOND INTERVALS SINCE 12:00AM 1/1/1601      <br />DECLARE @Int8 BIGINT      <br />SET @Int8 = 128462210724001300</p>
<p>&#8211; AND FIGURE OUT HOW MANY MINUTES THAT IS&#8230;     <br />&#8211; THERE ARE 1 BILLION NANOSECONDS IN A SECOND, THUS 10MILLION 100-NANOSECOND INTERVALS      <br />&#8211; AND 60 TIMES THAT PER MINUTE SO INT8 DIVIDED BY (60 * 10MILLION) IS THE NUMBER OF       <br />&#8211; MINUTES THAT HAVE ELAPSED SINCE 12:00AM 1/1/1601      <br />DECLARE @MinutesElapsed BIGINT      <br />SET @MinutesElapsed = @Int8 / 600000000</p>
<p>&#8211; NOW, BECAUSE THE DATEADD FN USES A &quot;BASE DATE&quot; OF 1/1/1900, WE NEED TO TAKE THE MINUTES     <br />&#8211; ABOVE AND SUBTRACT NUMBER OF MINUTES THAT HAVE ELAPSED BETWEEN 1/1/1601 TO 1/1/1900      <br />DECLARE @BaseDateOffset BIGINT;      <br />SET @BaseDateOffset = 157258080</p>
<p>&#8211; NOW WE CALCULATE THE OFFSET FROM GMT/UTC THAT OUR TIMEZONE GIVES US SO THE OUTPUT IS IN LOCAL TIME     <br />declare @TimezoneBias INT;      <br />SET @TimezoneBias = DATEDIFF(Minute,GetUTCDate(),GetDate())</p>
<p>&#8211; LASTLY, LET&#8217;S TAKE THE NUMBER OF MINUTES ELAPSED, WITH THE BASE-DATE OFFSET AND THE LOCAL TIME BIAS     <br />&#8211; AND FIGURE OUT WHAT END-DATE THAT GIVES US      <br />SELECT DATEADD(mi,@MinutesElapsed &#8211; @BaseDateOffset + @TimezoneBias,0)      <br />GO</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;     <br />&#8211; OR TO PUT ALL OF THAT IN ONE STATEMENT      <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;      <br />DECLARE @Int8 BIGINT      <br />SET @Int8 = 128462210724001300      <br />SELECT DATEADD(mi,(@Int8 / 600000000) &#8211; 157258080 + DATEDIFF(Minute,GetUTCDate(),GetDate()),0)      <br />GO</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-     <br />&#8211; OR PUT IT INTO A FUNCTION      <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-      <br />CREATE FUNCTION dbo.udf_Int8_to_DateTime(      <br />&#160;&#160; @Int8 BIGINT      <br />)      <br />RETURNS DATETIME      <br />AS      <br />&#160;&#160; BEGIN      <br />&#160;&#160;&#160;&#160;&#160; RETURN (DATEADD(mi,(@Int8 / 600000000) &#8211; 157258080 + DATEDIFF(Minute,GetUTCDate(),GetDate()),0))      <br />&#160;&#160; END      <br />GO</p>
<p>&#8211; AND THEN CALL IT     <br />SELECT dbo.udf_Int8_to_DateTime(128462210724001300)      <br />GO</p>
<p>SQL 2008 </p>
<p>Like we said earlier, SQL 2008 doesn&#8217;t need one of the steps because it can handle DATETIME2 and do date math back to 1/1/1601, as long as you CAST or CONVERT the data to a DATETIME2 in the DATEADD as you see below.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-     <br />&#8211; FULL, STEP-BY-STEP METHOD      <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>&#8211; Don&#8217;t worry, this is step-by-step to show the logic. It can all be put into      <br />&#8211; one statement or a function like we&#8217;ve done below.&#160; Keep reading.</p>
<p>&#8211; TAKE AN INTEGER8, WHICH IS THE NUMBER OF 100-NANOSECOND INTERVALS SINCE 12:00AM 1/1/1601     <br />DECLARE @Int8 BIGINT      <br />SET @Int8 = 128462210724001300</p>
<p>&#8211; AND FIGURE OUT HOW MANY MINUTES THAT IS&#8230;     <br />&#8211; THERE ARE 1 BILLION NANOSECONDS IN A SECOND, THUS 10MILLION 100-NANOSECOND INTERVALS      <br />&#8211; AND 60 TIMES THAT PER MINUTE SO INT8 DIVIDED BY (60 * 10MILLION) IS THE NUMBER OF       <br />&#8211; MINUTES THAT HAVE ELAPSED SINCE 12:00AM 1/1/1601      <br />DECLARE @MinutesElapsed BIGINT      <br />SET @MinutesElapsed = @Int8 / 600000000      <br />SELECT @MinutesElapsed</p>
<p>&#8211; NOW WE CALCULATE THE OFFSET FROM GMT/UTC THAT OUR TIMEZONE GIVES US SO THE OUTPUT IS IN LOCAL TIME     <br />declare @TimezoneBias INT;      <br />SET @TimezoneBias = DATEDIFF(Minute,GetUTCDate(),GetDate())</p>
<p>&#8211; LASTLY, LET&#8217;S TAKE THE NUMBER OF MINUTES ELAPSED SINCE 1/1/1601, WITH THE LOCAL TIME BIAS     <br />&#8211; AND FIGURE OUT WHAT END-DATE THAT GIVES US. NEED TO CAST/CONVERT THE DATE TO DATETIME2 IN      <br />&#8211; ORDER TO ADD MINUTES FROM ALL THE WAY BACK ON 1/1/1601, OTHERWISE IT ASSUMES DATETIME WHICH      <br />&#8211; ONLY GOES BACK TO 1/1/1900.      <br />SELECT DATEADD(mi,@MinutesElapsed + @TimezoneBias,CAST(&#8217;1/1/1601&#8242; AS DATETIME2))      <br />GO</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;     <br />&#8211; OR TO PUT ALL OF THAT IN ONE STATEMENT      <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;      <br />DECLARE @Int8 BIGINT      <br />SET @Int8 = 128462210724001300      <br />SELECT DATEADD(mi,(@Int8 / 600000000) + DATEDIFF(Minute,GetUTCDate(),GetDate()),CAST(&#8217;1/1/1601&#8242; AS DATETIME2))      <br />GO</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-     <br />&#8211; OR PUT IT INTO A FUNCTION      <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-      <br />CREATE FUNCTION dbo.udf_Int8_to_DateTime(      <br />&#160;&#160; @Int8 BIGINT      <br />)      <br />RETURNS DATETIME2      <br />AS      <br />&#160;&#160; BEGIN      <br />&#160;&#160;&#160;&#160;&#160; RETURN (DATEADD(mi,@Int8 / 600000000 + DATEDIFF(Minute,GetUTCDate(),GetDate()),CAST(&#8217;1/1/1601&#8242; AS DATETIME2)))      <br />&#160;&#160; END      <br />GO</p>
<p>&#8211; AND THEN CALL IT     <br />SELECT dbo.udf_Int8_to_DateTime(128462210724001300)      <br />GO</p>
<p><strong>SUMMARY</strong></p>
<p>So that&#8217;s really it.&#160; It&#8217;s all about converting the 100-nanosecond intervals to minutes and doing some math.&#160; So we&#8217;ve got TSQL that will convert an Integer8 value (from Active Directory) into a DateTime/DateTime2 value.</p>
<p>Some notes:</p>
<ul>
<li>If you want it in UTC/GMT, then you can just skip the TimezoneBias part. </li>
<li>This may not be perfect, I don&#8217;t know how all of the leap seconds that have been added over the years play into this&#8230;do the DATEDIFF/DATEADD functions handle that? Dunno. </li>
<li>The <em>number</em> argument of the DATEADD function cannot exceed the range of INT (2147483647) so if the INTEGER8 number is obscenely huge (spans more than 4084 years, 24 days, 2 hours &amp; 7 minutes) then you&#8217;ll likely get an overflow error.&#160; But we shouldn&#8217;t hit that for more than a thousand years, right? </li>
</ul>
<p>This has been tested on SQL 2005 and SQL 2008, but you should always test on lab systems before moving any code to production.&#160; This is released &quot;AS IS&quot; and confers no rights.</p>
<p><strong>Number2 (John Nelson)&#160; <br /></strong><a href="http://posts.number2blog.com/">MyITForum &#8211; Forum Posts</a>      <br /><a href="http://www.number2blog.com/">MyITForum &#8211; Blog</a></p>
</blockquote>
<p><a href="http://myitforum.com/cs2/blogs/jnelson/archive/2009/08/25/140938.aspx">SMS/ConfigMgr &#8211; SQL Function to Convert Integer8 (from Active Directory) to Datetime/Local Time &#8211; Number2 Blog &#8211; myITforum</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.whitworth.org/2009/09/09/smsconfigmgr-sql-function-to-convert-integer8-from-active-directory-to-datetimelocal-time-number2-blog-myitforum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Goodbye Desk Phone, You Have Served Me Well</title>
		<link>http://www.whitworth.org/2009/05/28/goodbye-desk-phone-you-have-served-me-well/</link>
		<comments>http://www.whitworth.org/2009/05/28/goodbye-desk-phone-you-have-served-me-well/#comments</comments>
		<pubDate>Thu, 28 May 2009 20:22:22 +0000</pubDate>
		<dc:creator>rwhitworth</dc:creator>
				<category><![CDATA[OCS]]></category>
		<category><![CDATA[Live Meeting]]></category>
		<category><![CDATA[OCS 2007 R2]]></category>

		<guid isPermaLink="false">http://www.whitworth.org/?p=684</guid>
		<description><![CDATA[I have to admit that I try to avoid talking on the phone as much as possible, but I have a family, so I still need a phone. But now, thanks to our deployment of OCS 2007 R2, I have moved my Cisco 7960 IP Phone off of my desk for good. OCS is now [...]]]></description>
			<content:encoded><![CDATA[<p>I have to admit that I try to avoid talking on the phone as much as possible, but I have a family, so I still need a phone. But now, thanks to our deployment of OCS 2007 R2, I have moved my Cisco 7960 IP Phone off of my desk for good. OCS is now my voice client, but I am still tied into the corporate Call Manager phone system. My voice mail still sits on Unity but we are looking at a limited test deployment of Exchange Unified Messaging since we already own it as part of our licensing agreement. I can&#8217;t speak much to the technical aspects of our implementation and how it ties into Call Manager, but, luckily I have a great WAN Engineer who really gets this stuff.  The end result is that I now have a wireless plantronics headset, and I can make and receive all calls from my computer. And I can do Live Meetings with a dial-in phone number. And I can do multi-party conference calls with both pc audio and cisco phones. And its pretty cool that on top of that, the OCS client is delivered to my desktop as an App-V stream.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.whitworth.org/2009/05/28/goodbye-desk-phone-you-have-served-me-well/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Exchange Server 2010 Storage</title>
		<link>http://www.whitworth.org/2009/04/16/microsoft-exchange-server-2010-storage/</link>
		<comments>http://www.whitworth.org/2009/04/16/microsoft-exchange-server-2010-storage/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 21:31:00 +0000</pubDate>
		<dc:creator>rwhitworth</dc:creator>
				<category><![CDATA[MS Servers]]></category>
		<category><![CDATA[Office 14]]></category>

		<guid isPermaLink="false">http://www.whitworth.org/2009/04/16/microsoft-exchange-server-2010-storage/</guid>
		<description><![CDATA[From the Microsoft Exchange Server 2010 Site 
Storage
Exchange 2010 includes improvements in performance, reliability, and high availability that enable organizations to run Exchange on a wide range of storage options. Building on improvements to disk input/output (IO) that were introduced in Exchange 2007, the latest version of Exchange requires less storage performance and is more [...]]]></description>
			<content:encoded><![CDATA[<p>From the Microsoft Exchange Server 2010 Site </p>
<blockquote><h3>Storage</h3>
<p>Exchange 2010 includes improvements in performance, reliability, and high availability that enable organizations to run Exchange on a wide range of storage options. Building on improvements to disk input/output (IO) that were introduced in Exchange 2007, the latest version of Exchange requires less storage performance and is more tolerant of storage failures.</p>
<p>The improvements made to Exchange Server 2010 storage add new options to the menu of Exchange storage choices, including the use of Serial Advanced Technology Attachment (SATA) hard disk drives and Redundant Array of Inexpensive Disks (RAID)-less configurations. Whether administrators choose SAN, direct attached, or JBOD storage, Exchange helps them provide larger mailboxes at lower cost without sacrificing system availability.</p>
<h5>Functional Descriptions</h5>
<p><b>IO Reductions:</b> Exchange 2010 delivers up to a 50% reduction in disk IO from Exchange 2007 levels.&#160; This means that more disks meet the minimum performance required to run Exchange, driving down storage costs.</p>
<p><b>Optimizations for SATA Disks:</b> IO patterns are optimized so that disk writes do not come in bursts. This removes a barrier that had previously limited the use of Serial Advanced Technology Attachment (SATA) desktop class hard disk drives disks.</p>
<p><b>Automatic Page Patching:</b> Exchange Server 2010 is more resilient to storage problems. When corruption is caused by minor disk faults, Exchange automatically repairs the affected database pages using one of the database copies configured for high availability. Automatic detection and repair of data corruptions from minor disk errors means that you can take advantage of lower-cost storage options while maintaining system reliability.</p>
<p><b>JBOD Support:</b> Exchange 2010 can be deployed with up to 16 replicated copies of each mailbox database, and fast database-level failover makes it possible for administrators to swap failed drives with minimal impact to users. This application-level redundancy allows RAID-less (JBOD) storage configurations to be used, resulting in dramatic cost savings.</p>
</blockquote>
<p><a href="http://www.microsoft.com/exchange/2010/en/us/storage.aspx">Microsoft Exchange Server 2010 Storage</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.whitworth.org/2009/04/16/microsoft-exchange-server-2010-storage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Unveils Exchange 2010 With Public Beta: First in the next wave of Office-related products, Microsoft Exchange Server 2010 will help lower communications costs, improve user productivity and transform e-mail archiving.</title>
		<link>http://www.whitworth.org/2009/04/16/microsoft-unveils-exchange-2010-with-public-beta-first-in-the-next-wave-of-office-related-products-microsoft-exchange-server-2010-will-help-lower-communications-costs-improve-user-productivity-and/</link>
		<comments>http://www.whitworth.org/2009/04/16/microsoft-unveils-exchange-2010-with-public-beta-first-in-the-next-wave-of-office-related-products-microsoft-exchange-server-2010-will-help-lower-communications-costs-improve-user-productivity-and/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 21:25:17 +0000</pubDate>
		<dc:creator>rwhitworth</dc:creator>
				<category><![CDATA[MS Servers]]></category>
		<category><![CDATA[Office 14]]></category>

		<guid isPermaLink="false">http://www.whitworth.org/2009/04/16/microsoft-unveils-exchange-2010-with-public-beta-first-in-the-next-wave-of-office-related-products-microsoft-exchange-server-2010-will-help-lower-communications-costs-improve-user-productivity-and/</guid>
		<description><![CDATA[&#160;
REDMOND, Wash. — April 15, 2009 — Microsoft Corp. today released a public beta of Microsoft Exchange Server 2010, part of Microsoft’s unified communications family (http://www.microsoft.com/uc). 
Exchange 2010 is part of the next wave of Microsoft Office-related products and is the first server in a new generation of Microsoft server technology built from the ground [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<blockquote><p><b>REDMOND, Wash. — April 15, 2009 —</b> Microsoft Corp. today released a public beta of Microsoft Exchange Server 2010, part of Microsoft’s unified communications family (<a href="http://www.microsoft.com/uc">http://www.microsoft.com/uc</a>). </p>
<p>Exchange 2010 is part of the next wave of Microsoft Office-related products and is the first server in a new generation of Microsoft server technology built from the ground up to work on-premises and as an online service. This release of Exchange 2010 introduces a new integrated e-mail archive and features to help reduce costs and improve the user experience. A public beta of the server is available for download starting today at <a href="http://www.microsoft.com/exchange/2010">http://www.microsoft.com/exchange/2010</a>. </p>
<p>Exchange Server 2010 will become available in the second half of 2009. Microsoft Office 2010 and related products will enter technical preview in the third quarter of 2009 and become available in the first half of 2010.</p>
<p>“Exchange 2010 ushers in the next generation of Microsoft unified communications software as the first server designed from inception to work both on-premises and as an online service,” said Rajesh Jha, corporate vice president of Exchange at Microsoft. “This release raises the bar with new archiving and end-user innovations that will help companies save money and employees save time.”</p>
<p>Exchange 2010 will help organizations reduce costs, protect communications and delight e-mail users with capabilities to do the following:</p>
</blockquote>
<p><a href="http://www.microsoft.com/presspass/press/2009/apr09/04-15Exchange2010PR.mspx">Microsoft Unveils Exchange 2010 With Public Beta: First in the next wave of Office-related products, Microsoft Exchange Server 2010 will help lower communications costs, improve user productivity and transform e-mail archiving.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.whitworth.org/2009/04/16/microsoft-unveils-exchange-2010-with-public-beta-first-in-the-next-wave-of-office-related-products-microsoft-exchange-server-2010-will-help-lower-communications-costs-improve-user-productivity-and/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Todd McDermid&#8217;s Blog: An Alternative to SSIS&#8217;s SCD Wizard</title>
		<link>http://www.whitworth.org/2009/04/14/todd-mcdermids-blog-an-alternative-to-ssiss-scd-wizard/</link>
		<comments>http://www.whitworth.org/2009/04/14/todd-mcdermids-blog-an-alternative-to-ssiss-scd-wizard/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 18:08:21 +0000</pubDate>
		<dc:creator>rwhitworth</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://www.whitworth.org/2009/04/14/todd-mcdermids-blog-an-alternative-to-ssiss-scd-wizard/</guid>
		<description><![CDATA[&#160;
An Alternative to SSIS&#8217;s SCD Wizard
This will be the last time I plug this for a while &#8211; I promise! I just wanted to make sure this page would come up in Google for those who are struggling with the Slowly Changing Dimension Wizard in SSIS.     If you want an SCD [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<blockquote><h5><a href="http://toddmcdermid.blogspot.com/2008/10/alternative-to-ssiss-scd-wizard.html">An Alternative to SSIS&#8217;s SCD Wizard</a></h5>
<p>This will be the last time I plug this for a while &#8211; I promise! I just wanted to make sure this page would come up in Google for those who are struggling with the Slowly Changing Dimension Wizard in SSIS.     <br />If you want an SCD component for SQL Server Integration Services that is a single component and doesn&#8217;t take hours and hours to execute, you ought to try out this alternative. It&#8217;s available (open-source) on CodePlex &#8211; the <a href="http://www.codeplex.com/kimballscd">KimballSCD project</a>. It&#8217;s modeled on the Kimball Method of dimension processing, which ought to make some of it&#8217;s more advanced features recognizable and very useful.      <br />Here&#8217;s a short list of the advantages this component has over the stock SCD Wizard:</p>
</blockquote>
<p><a href="http://toddmcdermid.blogspot.com/2008/10/alternative-to-ssiss-scd-wizard.html">Todd McDermid&#8217;s Blog: An Alternative to SSIS&#8217;s SCD Wizard</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.whitworth.org/2009/04/14/todd-mcdermids-blog-an-alternative-to-ssiss-scd-wizard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New White Paper on Hyper-V and SQL Server Consolidation at Microsoft</title>
		<link>http://www.whitworth.org/2009/03/13/new-white-paper-on-hyper-v-and-sql-server-consolidation-at-microsoft/</link>
		<comments>http://www.whitworth.org/2009/03/13/new-white-paper-on-hyper-v-and-sql-server-consolidation-at-microsoft/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 21:36:24 +0000</pubDate>
		<dc:creator>rwhitworth</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://www.whitworth.org/2009/03/13/new-white-paper-on-hyper-v-and-sql-server-consolidation-at-microsoft/</guid>
		<description><![CDATA[Very timely. We were just having this discussion the other day. 
New White Paper on Hyper-V and SQL Server Consolidation at Microsoft 
A new white paper on how Microsoft IT is combining Hyper-V and SQL Server has just been published. This comes from a team that provides thousands of SQL Server instances for internal applications. [...]]]></description>
			<content:encoded><![CDATA[<p>Very timely. We were just having this discussion the other day. </p>
<blockquote><h4>New White Paper on Hyper-V and SQL Server Consolidation at Microsoft </h4>
<p>A new white paper on how Microsoft IT is combining Hyper-V and SQL Server has just been published. This comes from a team that provides thousands of SQL Server instances for internal applications. It includes a lot of interesting new information, including results of specific tests they performed to evaluate their options. This is something that I first saw on an internal-only presentation a few weeks back and I&#8217;m glad they posted it publicly.&#160; </p>
<p>Here&#8217;s are the topics covered in this 26-page white paper:</p>
<ul>
<li>Executive Overview </li>
<li>Introduction </li>
<li>Considerations for Consolidation and Virtualization
<ul>
<li>Identification of Underutilized Servers </li>
<li>Server temperature </li>
<li>Consolidation Approaches </li>
<li>Virtualization Platform: WSRM vs. Hyper-V</li>
</ul>
</li>
<li>Implementation of the SQL Utility
<ul>
<li>Service Offerings </li>
<li>Identification of Candidates for Migration</li>
</ul>
</li>
<li>Attributes of System Quality
<ul>
<li>Availability and Business Continuity </li>
<li>Environmental Sustainability </li>
<li>Manageability </li>
<li>Performance </li>
<li>Predictability and Repeatability </li>
<li>Reliability </li>
<li>Scalability </li>
<li>Security </li>
<li>Monitoring </li>
<li>Supportability</li>
</ul>
</li>
<li>Conclusion</li>
</ul>
<p>It also includes lots of interesting diagrams, including details on their specific hardward configuration. While not evident on the outline above, the white paper compares the options to use multiple instances of SQL without Hyper-V with having multiple virtual machines with single instances of SQL Server. Not only it looks at the different pros and cons, but also provides interesting performance information.</p>
<p> Download the white paper from <a href="http://technet.microsoft.com/en-us/library/dd557540.aspx">http://technet.microsoft.com/en-us/library/dd557540.aspx</a></p>
<p>Filed under: <a href="http://blogs.technet.com/josebda/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</a>, <a href="http://blogs.technet.com/josebda/archive/tags/SQL+Server/default.aspx">SQL Server</a>, <a href="http://blogs.technet.com/josebda/archive/tags/Storage/default.aspx">Storage</a>, <a href="http://blogs.technet.com/josebda/archive/tags/Hyper-V/default.aspx">Hyper-V</a></p>
</blockquote>
<p><a href="http://blogs.technet.com/josebda/archive/2009/03/11/new-white-paper-on-hyper-v-and-sql-server-consolidation-at-microsoft.aspx">Jose Barreto&#8217;s Blog : New White Paper on Hyper-V and SQL Server Consolidation at Microsoft</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.whitworth.org/2009/03/13/new-white-paper-on-hyper-v-and-sql-server-consolidation-at-microsoft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginning SQL Server 2005 Reporting Services Part 2</title>
		<link>http://www.whitworth.org/2008/08/10/beginning-sql-server-2005-reporting-services-part-2/</link>
		<comments>http://www.whitworth.org/2008/08/10/beginning-sql-server-2005-reporting-services-part-2/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 21:38:50 +0000</pubDate>
		<dc:creator>rwhitworth</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://blog.whitworth.org/?p=428</guid>
		<description><![CDATA[ A good primer I ran across about SQL Server 2005 Reporting Services.
In Part 1 of this article, we looked at the basics of SQL Server Reporting Services 2005 (SSRS). We built one report with the Report Wizard, and one report using the Report Designer. In Part 2, we are going to look in more [...]]]></description>
			<content:encoded><![CDATA[<p> A good primer I ran across about SQL Server 2005 Reporting Services.</p>
<blockquote><p>In <a href="http://www.simple-talk.com/sql/learn-sql-server/beginning-sql-server-2005-reporting-services-part-1/">Part 1</a> of this article, we looked at the basics of SQL Server Reporting Services 2005 (SSRS). We built one report with the Report Wizard, and one report using the Report Designer. In Part 2, we are going to look in more depth at the features that you can use everyday as an SSRS developer. </p>
<p>We will investigate:</p>
<ul>
<li>Use of <b>expressions </b>that allow you to dynamically control nearly every aspect of reporting from control properties to data binding </li>
<li><b>Common functions </b>that allow run calculations and manipulate data within the report itself<b> </b></li>
<li><strong>Custom code, </strong>used to build your own library of functions within the report.</li>
</ul>
<p><b></b></p>
<p>We&#8217;ll also set up a <b>Matrix control</b> and create a <strong>sub-report. </strong>Lastly, we will add some flair to the report by adding dynamic drills and sorting.</p>
</blockquote>
<p><a href="http://www.simple-talk.com/sql/learn-sql-server/beginning-sql-server-2005-reporting-services-part-2/">Beginning SQL Server 2005 Reporting Services Part 2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.whitworth.org/2008/08/10/beginning-sql-server-2005-reporting-services-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.605 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-07-12 23:57:49 -->
