<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6369017162723772053</id><updated>2012-01-30T10:56:21.807+02:00</updated><category term='SPACE'/><category term='Denali'/><category term='TDE'/><category term='Performance'/><category term='Locking Hints'/><category term='RESTORE'/><category term='SQL Server 2000'/><category term='DATETIME2'/><category term='PowerPivot'/><category term='ISNULL'/><category term='Administration'/><category term='CHARINDEX'/><category term='LEN'/><category term='LOWER'/><category term='Visual Studio 2008'/><category term='.NET Tools'/><category term='Community'/><category term='INETA'/><category term='Concatenation'/><category term='REPLICATE'/><category term='Screencasts'/><category term='RIGHT'/><category term='SQL Server Tools'/><category term='Events'/><category term='.NET 3.5'/><category term='Undocumented'/><category term='Windows Vista'/><category term='Backup Database'/><category term='Table-Valued Parameters'/><category term='SQL Server 2005'/><category term='MVP'/><category term='SQL Server Compact 3.5'/><category term='Tips'/><category term='Transparent Data Encryption'/><category term='Programmability'/><category term='TechEd'/><category term='PASS'/><category term='Error Messages'/><category term='TIME'/><category term='CHAR'/><category term='Development'/><category term='Grouping Sets'/><category term='Temporary Tables'/><category term='SQL Tips'/><category term='Backup Compression'/><category term='SUBSTRING'/><category term='Group by'/><category term='Entity Framework'/><category term='.NET'/><category term='Webcasts'/><category term='Microsoft'/><category term='SQL Server String Functions'/><category term='SQL Server'/><category term='Service Pack'/><category term='MERGE Statement'/><category term='DATALENGTH'/><category term='Row Constructors'/><category term='REPLACE'/><category term='Security'/><category term='Visual Studio 2010'/><category term='Empty'/><category term='Product Reviews'/><category term='Connectivity'/><category term='CDNUG'/><category term='LEFT'/><category term='DATETIME'/><category term='Insert Statement'/><category term='Resources'/><category term='Rebuild'/><category term='Index'/><category term='Awards'/><category term='SQL Azure'/><category term='Reorganize'/><category term='Windows Azure'/><category term='Datetime conversion'/><category term='AJAX .NET'/><category term='OPENROWSET'/><category term='Windows 7'/><category term='SQL Server 2008'/><category term='Red Gate'/><category term='Certification'/><category term='Cloud Computing'/><category term='Express Edition'/><category term='Subqueries'/><category term='NULL'/><category term='Machine Debug Manager'/><category term='ASCII'/><category term='SharePoint'/><category term='LTRIM'/><category term='UPPER'/><category term='Reporting Services'/><category term='C#'/><category term='Data Access'/><category term='REVERSE'/><category term='RTRIM'/><category term='Discussion'/><category term='The multi-part identifier could not be bound'/><category term='SQL Server 2011'/><category term='BI'/><category term='Event Reviews'/><category term='TVP'/><category term='ADO .NET'/><category term='SQL Server 2008 R2'/><category term='Microsoft SQL Server 2008 Feature Pack'/><category term='NULLIF'/><category term='DATE'/><category term='Utilities'/><category term='Surface Area Configuration'/><title type='text'>The SQL Server and .NET Blog</title><subtitle type='html'>Understanding Software Technology</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default?start-index=101&amp;max-results=100'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>124</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-8083360531700555866</id><published>2011-12-31T14:57:00.000+02:00</published><updated>2011-12-31T14:57:33.691+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Selected Tweets of Year 2011!</title><content type='html'>With just a few hours remaining for entering the new year 2012, I could do nothing else than preparing this blog post! In the end of every year, I gather up all my tweets for that year and post it here! &lt;br /&gt;&lt;br /&gt;It is a privilege to communicate with the SQL Server Community via all possible channels like blogs, forums, offline and online events, conferences and of course, Twitter!&lt;br /&gt;&lt;br /&gt;You can find 2011's tweets below:&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;b&gt;&lt;u&gt;Blog Posts/Articles and Announcements&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;[Blog] Dynamic T-SQL Generator v1.0 is now on CodePlex! - &lt;a href="http://bit.ly/rqG5F2"&gt;http://bit.ly/rqG5F2&lt;/a&gt; #in #fb #MVPBuzz #SQLServer #DynamicSQLGen&lt;br /&gt;&lt;br /&gt;[Blog] Useful SQL Server Knowledge - Set 1 - &lt;a href="http://bit.ly/sa3qqv"&gt;http://bit.ly/sa3qqv&lt;/a&gt; #in #fb #MVPBuzz #SQLServer&lt;br /&gt;&lt;br /&gt;[Blog] My #SQLServer utility Snippets Generator goes open source on CodePlex! - &lt;a href="http://bit.ly/vtDMC6"&gt;http://bit.ly/vtDMC6&lt;/a&gt; #MVPBuzz #in #fb&lt;br /&gt;&lt;br /&gt;[Blog] Webcast on #SQLServer Denali RC0 - Poll - &lt;a href="http://bit.ly/uzwbHR"&gt;http://bit.ly/uzwbHR&lt;/a&gt; #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;[Blog] Creating an instance of the COM component with CLSID ... &lt;a href="http://bit.ly/uACL8X"&gt;http://bit.ly/uACL8X&lt;/a&gt; #sqlserver #fb #in #MVPBuzz&lt;br /&gt;&lt;br /&gt;[Blog] Retrieving Only the Date from a Datetime Value in #SQLServer - &lt;a href="http://bit.ly/piFTjf"&gt;http://bit.ly/piFTjf&lt;/a&gt; #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;[Blog] Sequence Objects in #SQLServer - &lt;a href="http://bit.ly/qRckwS"&gt;http://bit.ly/qRckwS&lt;/a&gt; #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;[Blog] Using Proxy Accounts in #SQLServer Agent Jobs - &lt;a href="http://bit.ly/vX8dkh"&gt;http://bit.ly/vX8dkh&lt;/a&gt; #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;[Blog] Updating #SQLServer Tables Without Causing Blocking - &lt;a href="http://bit.ly/umv3ZQ"&gt;http://bit.ly/umv3ZQ&lt;/a&gt; #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;[Blog] Backing up a Database in a Network Folder - &lt;a href="http://bit.ly/oiWuWJ"&gt;http://bit.ly/oiWuWJ&lt;/a&gt; #MVPBuzz #in #fb #SQLServer&lt;br /&gt;&lt;br /&gt;[Blog] Tool that generates dynamic T-SQL! - &lt;a href="http://bit.ly/l7jxkm"&gt;http://bit.ly/l7jxkm&lt;/a&gt; #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;[Blog] Executing Heavy Set-Based Operations Against VLDBs in #SQLServer - &lt;a href="http://bit.ly/iFHKMR"&gt;http://bit.ly/iFHKMR&lt;/a&gt; #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;[Blog] Using Unicode in #SQLServer - &lt;a href="http://bit.ly/lgoLRj"&gt;http://bit.ly/lgoLRj&lt;/a&gt; #MVPBuzz #in #fb&lt;br /&gt;&lt;br /&gt;[Blog] Microsoft MVP for the third year in a row! - &lt;a href="http://bit.ly/gmUb0U"&gt;http://bit.ly/gmUb0U&lt;/a&gt; #in #fb #MVPBuzz #SQLServer&lt;br /&gt;&lt;br /&gt;[Blog] Using the NOLOCK Table Hint - &lt;a href="http://bit.ly/hqqQ9F"&gt;http://bit.ly/hqqQ9F&lt;/a&gt; #fb #in #MVPBuzz #SQLServer&lt;br /&gt;&lt;br /&gt;[Blog] Database [Database_Name] cannot be upgraded because it is read-only or has read-only files - &lt;a href="http://bit.ly/ftJhw8"&gt;http://bit.ly/ftJhw8&lt;/a&gt; #in #MVPBuzz #fb&lt;br /&gt;&lt;br /&gt;[Blog] No global profile is configured. Specify a profile name in the @profile_name parameter - &lt;a href="http://bit.ly/hdFcHA"&gt;http://bit.ly/hdFcHA&lt;/a&gt; #MVPBuzz #in #fb&lt;br /&gt;&lt;br /&gt;[Blog] Free Utility for SQL Server 2011 CTP1 - Snippets Generator v1.0 - &lt;a href="http://bit.ly/hnxImn"&gt;http://bit.ly/hnxImn&lt;/a&gt; #in #fb #MVPBuzz #SQLServer&lt;br /&gt;&lt;br /&gt;[Blog] Webcast: Introducing SQL Server "Denali" (CTP1) - &lt;a href="http://bit.ly/hN9srP"&gt;http://bit.ly/hN9srP&lt;/a&gt; #fb #in #MVPBuzz #INETA_EU #CDNUG&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Miscellaneous&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;Generating T-SQL snippets for SQL Denali with ease: Snippets Generator Project - &lt;a href="http://bit.ly/rKZFYS"&gt;http://bit.ly/rKZFYS&lt;/a&gt; #MVPBuzz #SQLSnippetsGen #SQLServer&lt;br /&gt;&lt;br /&gt;Preparing my session on #SQLServer Denali CTP 3! - The exciting part is yet to come: The demos!!! #MVPBuzz&lt;br /&gt;&lt;br /&gt;On a domain pc/server, in a cmd prompt you can type "echo %logonserver%" to find out which domain controller authenticates you.&lt;br /&gt;&lt;br /&gt;I am celebrating 100.000 (+) visits on my blog and I am giving away a utility I developed! The tool is: Dynamic T-SQL Generator! #MVPBuzz&lt;br /&gt;&lt;br /&gt;Today my blog has reached 100.000 visits! Thank you for your support!!! - &lt;a href="http://bit.ly/PKBi9"&gt;http://bit.ly/PKBi9&lt;/a&gt; #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;I am a #Microsoft #SQLServer MVP for a third year in a row! A huge thanks to you, the Community, for supporting my efforts! #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;RT @CDNUG: The #Microsoft Cloud Power Event in Cyprus! - &lt;a href="http://bit.ly/emiPUh"&gt;http://bit.ly/emiPUh&lt;/a&gt; - Save the date: March 10, 2011 #MVPBuzz #fb&lt;br /&gt;&lt;br /&gt;[Personal Website Updated] New section added: Webcasts &amp; Screencasts - &lt;a href="http://bit.ly/hXPnMZ"&gt;http://bit.ly/hXPnMZ&lt;/a&gt; #in #MVPBuzz&lt;br /&gt;&lt;br /&gt;Just finished recording my Webcast on #SQLServer Denali! I will upload it tomorrow! Make sure you check out my blog at: &lt;a href="http://bit.ly/PKBi9"&gt;http://bit.ly/PKBi9&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A really cool feature! RT @mssqlserver: SEQUENCE in SQL Server 2011 &lt;a href="http://bit.ly/gMfC68"&gt;http://bit.ly/gMfC68&lt;/a&gt; #SQLServer&lt;br /&gt;&lt;br /&gt;Preparing a webcast for introducing #SQLServer "Denali"! More info soon! #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;I really like the T-SQL code snippets enhancement in #SQLServer Denali! #MVPBuzz #in&lt;br /&gt;&lt;br /&gt;AdventureWorks Sample Database for #SQLServer "Denali" CTP 1 - &lt;a href="http://bit.ly/9hBGub"&gt;http://bit.ly/9hBGub&lt;/a&gt; #in #fb&lt;br /&gt;&lt;br /&gt;Wishing a &lt;b&gt;Happy New Year 2012&lt;/b&gt; full of health and of course ... SQL Server!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-8083360531700555866?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/8083360531700555866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=8083360531700555866' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8083360531700555866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8083360531700555866'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/12/selected-tweets-of-year-2011.html' title='Selected Tweets of Year 2011!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-2789713417696333136</id><published>2011-12-21T18:05:00.000+02:00</published><updated>2011-12-21T18:05:24.064+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET Tools'/><title type='text'>Dynamic T-SQL Generator v1.0 is now on CodePlex!</title><content type='html'>Earlier this year, in one of my blog posts, I presented &lt;a href="http://aartemiou.blogspot.com/2011/06/tool-that-generates-dynamic-t-sql.html"&gt;Dynamic T-SQL Generator&lt;/a&gt;: a tool I developed that generates dynamic T-SQL based on a given static T-SQL script and vice versa.&lt;br /&gt;&lt;br /&gt;Dynamic T-SQL can be used in many cases when you develop SQL Server routines. An example is embedding T-SQL scripts in SQL Server functions and stored procedures (i.e. sp_send_dbmail).&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;As i believe that the Technical Community might find the tool useful, I decided to create a relevant open source project on &lt;a href="http://www.codeplex.com"&gt;CodePlex&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Feel free to visit my &lt;a href="http://dynamicsqlgen.codeplex.com/"&gt;project's page on CodePlex&lt;/a&gt; and provide your valuable feedback!&lt;br /&gt;&lt;br /&gt;Here's a screenshot of the tool:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-QIdYUtEb71o/TvG4eJXCD8I/AAAAAAAAAgY/RdAJHgcpgRQ/s1600/MainScreen.jpg" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"&gt;&lt;img border="0" height="181" width="400" src="http://2.bp.blogspot.com/-QIdYUtEb71o/TvG4eJXCD8I/AAAAAAAAAgY/RdAJHgcpgRQ/s400/MainScreen.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's the &lt;a href="http://dynamicsqlgen.codeplex.com/"&gt;link&lt;/a&gt; to Dynamic T-SQL Generator.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-2789713417696333136?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/2789713417696333136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=2789713417696333136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2789713417696333136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2789713417696333136'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/12/dynamic-t-sql-generator-v10-is-now-on.html' title='Dynamic T-SQL Generator v1.0 is now on CodePlex!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-QIdYUtEb71o/TvG4eJXCD8I/AAAAAAAAAgY/RdAJHgcpgRQ/s72-c/MainScreen.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-4444311310068392543</id><published>2011-12-14T16:57:00.002+02:00</published><updated>2011-12-14T17:01:54.491+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Useful SQL Server Knowledge - Set 1</title><content type='html'>A few days ago I started writing an article that it would provide a set of useful tips on SQL Server topics that are met in the everyday life of DBA/Database Developer.&lt;br /&gt;&lt;br /&gt;The article is now completed and you can find it below!&amp;nbsp;It is organized in the following categories:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Solutions to common issues&lt;/li&gt;&lt;li&gt;Basic string functions&lt;/li&gt;&lt;li&gt;Performance-related tips&lt;/li&gt;&lt;li&gt;Maintenance&lt;/li&gt;&lt;li&gt;Miscellaneous&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;b&gt;--&lt;/b&gt;&lt;br /&gt;&lt;b&gt;-- A: Solutions to common issues&lt;/b&gt;&lt;br /&gt;&lt;b&gt;--&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--1: Resolving the "Divide by zero" error (by example)&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;DECLARE @denominator INT&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SET @denominator = 0&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT  1 / ISNULL(NULLIF(@denominator, 0), 1)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--2: Handling NULL and empty values&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;----Step 1: Create the IsEmpty user-defined function&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;CREATE FUNCTION IsEmpty&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;@input AS VARCHAR(250),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;@newValue VARCHAR(250)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;RETURNS VARCHAR(250)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;AS &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;BEGIN&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;-- First handle the case where the input value is a NULL&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;DECLARE @inputFiltered AS VARCHAR(250)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SET @inputFiltered = ISNULL(@input, '')&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;-- The main logic goes here&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;RETURN (CASE RTRIM(LTRIM(@inputFiltered)) WHEN '' THEN RTRIM(LTRIM(@newValue)) ELSE RTRIM(LTRIM(@inputFiltered)) END)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;----Step 2: Usage&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT  dbo.IsEmpty(@column_to_check, @new_value);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--3: Handling the error "A transport-level error has occurred when sending the request to the server"&lt;/b&gt;&lt;br /&gt;If the problem occurs in a SSMS Query Window, just open a new one and run the T-SQL statements again. In a different case, re-initiate the request to the SQL Server instance.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--4: Handling the error "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value"&lt;/b&gt;&lt;br /&gt;Change the default language to "us_english" for the given SQL Server login:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [master];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;ALTER LOGIN "LOGIN_NAME" WITH DEFAULT_LANGUAGE = us_english;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Best practice: Always use the ISO date format in your data applications/T-SQL scripts: &lt;b&gt;YYYY-MM-DD&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--5: Handling the error "The multi-part identifier ... could not be bound"&lt;/b&gt;&lt;br /&gt;Be careful with the use of subqueries and table aliases. Don't forget to reference the correct table aliases in your T-SQL code. &lt;br /&gt;&lt;br /&gt;Also, keep in mind that subqueries can only provide their results to their outer queries and not references to the subqueries' tables.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--6: Handling the error "String or binary data would be truncated"&lt;/b&gt;&lt;br /&gt;Either use an adequate size for the table columns in which the data is inserted or cast the data by removing redundant characters. I suggest the first approach.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--7: Handling the error "Error converting data type varchar to float"&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;----Step 1: Create the Varchar2Float user-defined function&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;CREATE FUNCTION [dbo].[Varchar2Float]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;( @inputString VARCHAR(50) )&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;RETURNS FLOAT&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;AS &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;BEGIN&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;--Prepare the string for casting/conversion&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SET @inputString = REPLACE(@inputString, '.', '') &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SET @inputString = REPLACE(@inputString, ',', '.')&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;--Perform the conversion and return the result&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;RETURN CAST(@inputString AS FLOAT)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;END;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;----Step 2: Usage&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT dbo.Varchar2Float(@value) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--8: Handling the error "Database [Database_Name] cannot be upgraded because it is read-only or has read-only files"&lt;/b&gt;&lt;br /&gt;Make sure that the user account on which the SQL Server instance database engine is running has full access to the database files. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--&lt;/b&gt;&lt;br /&gt;&lt;b&gt;-- B: Basic string functions&lt;/b&gt;&lt;br /&gt;&lt;b&gt;--&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--1: Returns @length characters from @expression starting from @start_index&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT  SUBSTRING(@expression, @start_index, @length)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--2: Finds the given @pattern in the @string and replaces it with the @replacement_string&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT  REPLACE(@string, @pattern, @replacement_string)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--3: Returns the size of @string in terms of number of characters&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT  LEN(@string)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--4: Returns the first @num_chars characters of the @string counting from the left&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT  LEFT(@string, @num_chars)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--5: Returns the first @num_chars characters of the @string counting from the right&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT  RIGHT(@string, @num_chars)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--6: Removes the leading blank spaces&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT  LTRIM(@expression)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--7: Removes the trailing blank spaces&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT  RTRIM(@expression)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--&lt;/b&gt;&lt;br /&gt;&lt;b&gt;-- C: Performance-related tips&lt;/b&gt;&lt;br /&gt;&lt;b&gt;--&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--1: Avoiding locking when reading data (however, dirty reads are allowed)&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT  [columnName]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;FROM    [tableName] WITH (NOLOCK)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--2: Rebuilding indexes in SQL Server 2005 or later&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;----Rebuild a specific index with using parameters&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DATABASE_NAME];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;ALTER INDEX [INDEX_NAME] ON [SCHEMA.TABLE]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;REBUILD WITH (FILLFACTOR=[FILL_FACTOR_VALUE_BETWEEN_0_100], ONLINE=[ON|OFF]);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;----Rebuild all indexes in a table with using parameters&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DATABASE_NAME];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;ALTER INDEX ALL ON [SCHEMA.TABLE]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;REBUILD WITH (FILLFACTOR=[FILL_FACTOR_VALUE_BETWEEN_0_100], ONLINE=[ON|OFF]);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--3: Rebuilding all the indexes in a database&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;----Rebuild all indexes online with keeping the default fill factor for each index&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DATABASE_NAME];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;EXEC sp_MSforeachtable @command1="print '?'", @command2="ALTER INDEX ALL ON ? REBUILD WITH (ONLINE=ON)";&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;----Rebuild all indexes offline with keeping the default fill factor for each index&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DATABASE_NAME];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;EXEC sp_MSforeachtable @command1="print '?'", @command2="ALTER INDEX ALL ON ? REBUILD WITH (ONLINE=OFF)";&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;----Rebuild all indexes online with specifying the fill factor&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DATABASE_NAME];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;EXEC sp_MSforeachtable @command1="print '?'", @command2="ALTER INDEX ALL ON ? REBUILD WITH (FILLFACTOR=[FILL_FACTOR_PERC],ONLINE=ON)";&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;----Rebuild all indexes offline with specifying the fill factor&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DATABASE_NAME];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;EXEC sp_MSforeachtable @command1="print '?'", @command2="ALTER INDEX ALL ON ? REBUILD WITH (FILLFACTOR=[FILL_FACTOR_PERC],ONLINE=OFF)";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--4: Updating database tables without causing blocking&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;UPDATE [TABLE_NAME] WITH (READPAST)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SET ...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;WHERE ...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--&lt;/b&gt;&lt;br /&gt;&lt;b&gt;-- D: Maintenance&lt;/b&gt;&lt;br /&gt;&lt;b&gt;--&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--1: Shrinking an entire database&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;DBCC SHRINKDATABASE([DBName],[PercentageOfFreeSpace]);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--2: Truncating an entire database&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;DBCC SHRINKDATABASE([DBName],TRUNCATEONLY);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--3: Shrinking a data/log file&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DBName];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;DBCC SHRINKFILE ([Data_Log_LogicalName],[TargetMBSize]);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--4: Truncating a data/log file&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DBName];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;DBCC SHRINKFILE ([Data_Log_LogicalName],TRUNCATEONLY);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--5: Renaming a Windows login&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;ALTER LOGIN "[Domain or Server Name]\[Windows Username]"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;WITH NAME="[New Domain or New Server Name]\[Windows Username]";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--6: Renaming a SQL Server login&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;ALTER LOGIN "[SQL Server Login Name]"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;WITH NAME="[New SQL Server Login Name]";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--7: Creating Logins for orphaned SQL Server users&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DBName];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;EXEC sp_change_users_login 'Auto_Fix', '[UserName]', NULL, '[Password]';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--8: Changing the Database Owner in a SQL Server Database (SQL Login)&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DBName];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;EXEC sp_changedbowner '[SQL_Login_Name]';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--9: Changing the Database Owner in a SQL Server Database (Windows Login)&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [DBName];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;EXEC sp_changedbowner '[DomainName\UserName]';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--10: Backing up a Database in a Network Folder (creating the destination media)&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;USE [master];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;EXEC sp_addumpdevice 'disk', 'NetworkDeviceName','\\serverName\backupFolder\BackupFileName.bak';&lt;/span&gt;&lt;br /&gt;--Now you can backup databases onto the network device created above&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--&lt;/b&gt;&lt;br /&gt;&lt;b&gt;-- E: Miscellaneous&lt;/b&gt;&lt;br /&gt;&lt;b&gt;--&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--1: Gets basic information on the current SQL Server instance&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SELECT &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SERVERPROPERTY('ProductVersion') AS ProductVersion, &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SERVERPROPERTY ('ProductLevel') AS ProductLevel, &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SERVERPROPERTY ('Edition') AS Edition,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SERVERPROPERTY('MachineName') AS ServerName,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;SERVERPROPERTY('ServerName') AS Server_and_Instance_Names&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--2: Gets basic table index information&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;EXEC sp_helpindex 'schema.table_name'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;--3: Connecting to Windows Internal Database (SSEE)&lt;/b&gt;&lt;br /&gt;From within SSMS (Express Edition works as well):&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Server Type: Database Engine&lt;/li&gt;&lt;li&gt;Server Name: \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query&lt;/li&gt;&lt;li&gt;Authentication: Windows Authentication&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;* Make sure that the Named Pipes protocol is enabled!&lt;br /&gt;&lt;br /&gt;I hope you found this article useful!&lt;br /&gt;&lt;br /&gt;Cheers!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-4444311310068392543?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/4444311310068392543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=4444311310068392543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4444311310068392543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4444311310068392543'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/12/useful-sql-server-knowledge-set-1.html' title='Useful SQL Server Knowledge - Set 1'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-2206279760448198881</id><published>2011-12-12T19:49:00.000+02:00</published><updated>2011-12-12T19:49:52.001+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Denali'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='MVP'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Snippets Generator is now on CodePlex!</title><content type='html'>Early this year, in one of my &lt;a href="http://aartemiou.blogspot.com/2011/01/free-utility-for-sql-server-2011-ctp1.html"&gt;blog posts&lt;/a&gt;, I presented &lt;a href="http://aartemiou.blogspot.com/2011/01/free-utility-for-sql-server-2011-ctp1.html"&gt;Snippets Generator&lt;/a&gt;: a tool I developed that generates snippets for SQL Server Denali.&lt;br /&gt;&lt;br /&gt;Snippets can become quite handy when you want to write code fast, without having to repeat/type certain sets of T-SQL statements that are often used.&lt;br /&gt;&lt;br /&gt;As the purpose of this blog and generally the purpose of my entire Community activity is to exchange knowledge with fellow Community members and support the technical Community, I decided to take it one step further and publish Snippets Generator as an open source project on &lt;a href="http://www.codeplex.com"&gt;CodePlex&lt;/a&gt;. CodePlex is Microsoft's open source project hosting web site and there you can find thousands of great open source projects/applications that you can freely use. &lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Feel free to visit my &lt;a href="http://snippetsgen.codeplex.com/"&gt;project's page&lt;/a&gt; on CodePlex and provide your valuable feedback!&lt;br /&gt;&lt;br /&gt;Here's the &lt;a href="http://snippetsgen.codeplex.com/"&gt;link&lt;/a&gt; to &lt;a href="http://snippetsgen.codeplex.com/"&gt;Snippets Generator&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-2206279760448198881?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/2206279760448198881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=2206279760448198881' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2206279760448198881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2206279760448198881'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/12/snippets-generator-is-now-on-codeplex.html' title='Snippets Generator is now on CodePlex!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-1328327411393366024</id><published>2011-12-06T21:42:00.001+02:00</published><updated>2011-12-06T21:43:25.527+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Denali'/><category scheme='http://www.blogger.com/atom/ns#' term='Webcasts'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Webcast on SQL Server Denali RC0 - Poll</title><content type='html'>With SQL Server Denali RC0 released a few weeks ago, I am thinking of recording a webcast with topic its Database Engine features mainly focusing on the programmability area.&lt;br /&gt;&lt;br /&gt;To this end, I am conducting a poll in order to see if you are interested in attending such a webcast.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;If you are interested you just need to complete the following poll!&lt;br /&gt;&lt;br /&gt;&lt;iframe src="https://docs.google.com/spreadsheet/embeddedform?formkey=dDcyOVZ0M0VQMlRDU1JFYkh4NkhQa1E6MQ" width="760" height="638" frameborder="0" marginheight="0" marginwidth="0"&gt;Loading...&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;When the webcast is available, you will receive an email notification!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-1328327411393366024?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/1328327411393366024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=1328327411393366024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1328327411393366024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1328327411393366024'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/12/webcast-on-sql-server-denali-rc0.html' title='Webcast on SQL Server Denali RC0 - Poll'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-1062863563960028363</id><published>2011-11-18T16:57:00.003+02:00</published><updated>2011-11-18T16:58:46.718+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><title type='text'>Creating an instance of the COM component with CLSID {AA40D1D6-CAEF-4A56-B9BB-D0D3DC976BA2} from the IClassFactory failed...</title><content type='html'>If you ever encounter issues when trying to create, add, or edit steps for a SQL Server Agent job in SQL Server Management Studio 2008 R2 don't worry!&lt;br /&gt;&lt;br /&gt;The error popup you might get is the following:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-ZTw_0p507JM/TsYoAPb8KEI/AAAAAAAAAgI/5kMJit7b0bY/s1600/Agent_Job_Edit_Issue.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-ZTw_0p507JM/TsYoAPb8KEI/AAAAAAAAAgI/5kMJit7b0bY/s1600/Agent_Job_Edit_Issue.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;There is a &lt;a href="http://support.microsoft.com/kb/2315727" target="_blank"&gt;fix &lt;/a&gt;for this issue. You can find it &lt;a href="http://support.microsoft.com/kb/2315727" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The fix applies to the following products:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Microsoft SQL Server 2008 R2 Developer&lt;/li&gt;&lt;li&gt;Microsoft SQL Server 2008 R2 Enterprise&lt;/li&gt;&lt;li&gt;Microsoft SQL Server 2008 R2 Workgroup&lt;/li&gt;&lt;li&gt;Microsoft SQL Server 2008 R2 Datacenter&lt;/li&gt;&lt;li&gt;Microsoft SQL Server 2008 R2 Standard&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-1062863563960028363?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/1062863563960028363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=1062863563960028363' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1062863563960028363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1062863563960028363'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/11/creating-instance-of-com-component-with.html' title='Creating an instance of the COM component with CLSID {AA40D1D6-CAEF-4A56-B9BB-D0D3DC976BA2} from the IClassFactory failed...'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-ZTw_0p507JM/TsYoAPb8KEI/AAAAAAAAAgI/5kMJit7b0bY/s72-c/Agent_Job_Edit_Issue.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-3501997530527627466</id><published>2011-10-10T20:42:00.003+03:00</published><updated>2011-10-10T20:55:23.361+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2000'/><title type='text'>Retrieving Only the Date from a Datetime Value in SQL Server</title><content type='html'>There are many times where you might need to only retrieve the date from a datetime value. &lt;br /&gt;&lt;br /&gt;For example, you may have today's datetime (2011-10-10 20:30:28.230) and you want to only get the following value: 2011-10-10.&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://www.microsoft.com/sqlserver/en/us/default.aspx"&gt;SQL Server 2008&lt;/a&gt; or later, you can easily do this by casting/converting the datetime value to the datatype &lt;a href="http://msdn.microsoft.com/en-us/library/bb675168.aspx"&gt;&lt;b&gt;DATE&lt;/b&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;A typical example is the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;--Datetime variable declaration&lt;/div&gt;&lt;div style="color: #274e13;"&gt;DECLARE @dateTimeValue as datetime&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SET @dateTimeValue=GETDATE()&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;--Cast the datetime value to the DATE datatype&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT CAST(@dateTimeValue as DATE) as OnlyDate&lt;/div&gt;&lt;div style="color: #274e13;"&gt;GO&lt;/div&gt;&lt;br /&gt;However, in earlier versions of SQL Server the DATE type is not available.&lt;br /&gt;So, if you have a SQL Server 2005 instance or earlier and you want to get the date value from a datetime value you can just create and use a simple scalar-valued function like the following:&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;---------------------------------&lt;/div&gt;&lt;div style="color: #274e13;"&gt;-- Create scalar-valued function -&lt;/div&gt;&lt;div style="color: #274e13;"&gt;---------------------------------&lt;/div&gt;&lt;div style="color: #274e13;"&gt;CREATE FUNCTION dateOnly&lt;/div&gt;&lt;div style="color: #274e13;"&gt;( &lt;/div&gt;&lt;div style="color: #274e13;"&gt;@dateInput datetime&lt;/div&gt;&lt;div style="color: #274e13;"&gt;)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;RETURNS varchar (10)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;AS&lt;/div&gt;&lt;div style="color: #274e13;"&gt;BEGIN&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;declare @tempRes as varchar(10) &lt;/div&gt;&lt;div style="color: #274e13;"&gt;declare @tempYear as varchar(4)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;declare @tempMonth as varchar(2)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;declare @tempDay as varchar(2)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;set @tempYear=(select cast ((datepart(yyyy,@dateInput)) as varchar(4)))&lt;/div&gt;&lt;div style="color: #274e13;"&gt;set @tempMonth=(select cast ((datepart(MM,@dateInput)) as varchar(4)))&lt;/div&gt;&lt;div style="color: #274e13;"&gt;set @tempDay=(select cast ((datepart(dd,@dateInput)) as varchar(4)))&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;set @tempRes=@tempYear+'-'+@tempMonth+'-'+@tempDay&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;RETURN @tempRes&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;END&lt;/div&gt;&lt;div style="color: #274e13;"&gt;GO&lt;/div&gt;&lt;div style="color: #274e13;"&gt;-----------------------------&lt;/div&gt;&lt;br /&gt;Now that the function is created, the first example changes to:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;--Datetime variable declaration&lt;/div&gt;&lt;div style="color: #274e13;"&gt;DECLARE @dateTimeValue as datetime&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SET @dateTimeValue=GETDATE()&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;--Get only the date value by calling the scalar-valued function&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT &lt;b&gt;dbo.dateOnly(@dateTimeValue)&lt;/b&gt; as OnlyDate&lt;/div&gt;&lt;div style="color: #274e13;"&gt;GO&lt;/div&gt;&lt;br /&gt;.... and that's it! :)&lt;br /&gt;&lt;br /&gt;I hope you found the article useful!&lt;br /&gt;&lt;br /&gt;Until next time!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-3501997530527627466?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/3501997530527627466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=3501997530527627466' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3501997530527627466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3501997530527627466'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/10/retrieving-only-date-from-datetime.html' title='Retrieving Only the Date from a Datetime Value in SQL Server'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-4218740493959050267</id><published>2011-09-30T23:08:00.002+03:00</published><updated>2011-09-30T23:10:15.292+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Sequence Objects in SQL Server</title><content type='html'>SQL Server "&lt;a href="http://www.microsoft.com/sqlserver/en/us/future-editions.aspx"&gt;Denali&lt;/a&gt;" among other introduces &lt;b&gt;Sequence Objects&lt;/b&gt;. I am sure that sequence objects are widely known but let's provide their definition in plain words:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;A sequence object allows you to set a global counter of values within the scope of a DBMS instance.&lt;br /&gt;Whenever you call the sequence object it returns a unique value based on its configuration (i.e. the numbers 1,2,3,4, etc.).&lt;/i&gt;&lt;br /&gt;Even though you can use this feature in SQL Server "Denali", what about if you need to use it in an earlier version of SQL Server?&lt;br /&gt;&lt;br /&gt;It is a fact that sequence objects are not available in earlier versions of SQL Server but guess what; there are many workarounds that can be used instead! :)&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Further below I'm describing one such workaround. The main idea is the following:&lt;br /&gt;&lt;br /&gt;1. &lt;b&gt;Create a table with two columns: &lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An identity column of the type bigint.&lt;/li&gt;&lt;li&gt;A value column of the type bigint.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;2. &lt;b&gt;Create a stored procedure that will be doing the following upon its execution:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Insert a value in the respective value column (this will be causing the identity column to be automatically increased).&lt;/li&gt;&lt;li&gt;Delete the previously inserted record and always keep the last one.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;3. Whenever you need a unique value, you simply call the stored procedure and then you retrieve the identity column's value from the respective table.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4. That's it! You are now using a sequence-like object! &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's the T-SQL for the above logic:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;--Select the proper database&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;USE [DB_Name]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;--Step 1: Create the table for storing the data (once-off)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;CREATE TABLE [tblSeq](&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [SeqID] [int] IDENTITY(1,1) NOT NULL,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [SeqVal] [bigint] NULL&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;--Step 2: Create the stored procedure for manipulating the data (once-off)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;CREATE PROCEDURE [GetNewSeqVal_tblSeq]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;AS&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;BEGIN&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert into tblSeq (SeqVal) values (1)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; if ((select max(seqid) from tblSeq))!=1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; delete from tblSeq where seqid &amp;lt; (select max(seqid) from tblSeq)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="color: #274e13;"&gt;-- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;-- Whenever a new, unique number is required, you just run the following two T-SQL statements&lt;/span&gt;:&lt;br /&gt;&lt;span style="color: #274e13;"&gt;--&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;-- Step 1: Execute the stored procedure for increasing the identity by 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;EXEC [GetNewSeqVal_tblSeq]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;-- Step 2: Get the new, unique value&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;SELECT MAX(seqid) FROM [tblSeq]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope you found the article useful!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-4218740493959050267?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/4218740493959050267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=4218740493959050267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4218740493959050267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4218740493959050267'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/09/sequence-objects-in-sql-server.html' title='Sequence Objects in SQL Server'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-7237116343935649716</id><published>2011-08-30T22:20:00.000+03:00</published><updated>2011-08-30T22:20:27.369+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Using Proxy Accounts in SQL Server Agent Jobs</title><content type='html'>When using SQL Server, in many cases you will might need to set up a SQL Server Agent job that will be accessing a resource within&amp;nbsp;the domain.&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;For example, you want to include a step in a SQL Server Agent job that based on some logic, will be handling a Windows service on a server within the domain by using the Operating System (CmdExec) SQL Server subsystem. &lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;In order for the job to be successfully executed, the specific job's execution context should be allowed access to the target resource in the domain.&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;If you are using a domain user as a service account for the SQL Server Agent in the specific instance, you can assign the necessary access rights to that user account.&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;However, there is also another way which I personally prefer; &lt;em&gt;&lt;strong&gt;using a Proxy Account for executing the specific job step&lt;/strong&gt;&lt;/em&gt; :)&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;div&gt;In order to be able to do this you must perform the following actions within the instance of SQL Server:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Create a credential&lt;/li&gt;&lt;li&gt;Create a Proxy Account that uses the credential you created in the first step&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;strong&gt;&lt;u&gt;For creating a credential, in SSMS you navigate to: Security&amp;nbsp;-- Credentials&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;You can then create the credential by providing an identity (i.e. a domain user) along with its password.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;u&gt;For creating a Proxy Account, in SSMS you navigate to: SQL Server Agent -- Proxies&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;You can then create a new Proxy Account by giving it a name and performing the following:&lt;br /&gt;- Provide the credential you earlier created&lt;br /&gt;- Enter a description (optional)&lt;br /&gt;- Set the subsystems for which the Proxy Account will be active. These are: &lt;br /&gt;------- ActiveX Script &lt;br /&gt;------- Operating system (CmdExec)&lt;br /&gt;------- Replication Distributor&lt;br /&gt;------- Replication Merge&lt;br /&gt;------- Replication Queue Reader&lt;br /&gt;------- Replication Snapshot&lt;br /&gt;------- Replication Transaction-Log Reader&lt;br /&gt;------- SQL Server Analysis Services Command&lt;br /&gt;------- SQL Server Analysis Services Query&lt;br /&gt;------- SQL Server Integration Services Package&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;u&gt;That's it!&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;You can now proceed and set up the SQL Server Agent job along with its steps, and in the step you want to use the Proxy Account you select it in the "&lt;strong&gt;Run as&lt;/strong&gt;" drop down box.&lt;br /&gt;&lt;br /&gt;Whenever the specific job step runs, it will be executed in the context of the provided Proxy Account.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;* Note that in order to be able to use a Proxy Account in a specific job step, the Proxy Account needs to be activated for the specific subsystem (i.e. Operating system - CmdExec).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I hope you found this post useful!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-7237116343935649716?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/7237116343935649716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=7237116343935649716' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7237116343935649716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7237116343935649716'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/08/using-proxy-accounts-in-sql-server.html' title='Using Proxy Accounts in SQL Server Agent Jobs'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-1234084552695891336</id><published>2011-08-27T10:19:00.000+03:00</published><updated>2011-08-27T10:19:01.512+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Locking Hints'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Updating SQL Server Tables Without Causing Blocking</title><content type='html'>Even though the SQL Server Database Engine automatically sets the best possible locking hints on the underlying database objects of the various T-SQL operations that executes, there are cases&lt;br /&gt;where we need to manually control locking as a part of the business logic&amp;nbsp;in our T-SQL script.&lt;br /&gt;&lt;br /&gt;A popular locking hint is the &lt;a href="http://aartemiou.blogspot.com/2011/03/using-nolock-table-hint.html"&gt;NOLOCK &lt;/a&gt;as it is being used many times in environments with high concurrency. By using the NOLOCK hint, the transaction isolation level for the SELECT statement is READ UNCOMMITTED. Of course, this means that the query may see inconsistent data (dirty reads), that is data not yet committed, etc. The NOLOCK hint can only be used in SELECT statements.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Now imagine the following scenario: You need to design a special UPDATE statement that will be updating an unknown number of records in a table which is being concurrently accessed by several other T-SQL statements (mostly UPDATE statements). The above statement will be updating the table with non-critical information meaning that if it skips some records the first time, it can update them the second time and so on.&lt;br /&gt;&lt;br /&gt;If even one of the other UPDATE statements has locked a row&amp;nbsp;that needs to be modified by your UPDATE statement, this will cause the latter to wait (blocking). However, in the case where waiting is not a very "desired" option what should you do? That leads us to the following question: &lt;strong&gt;&lt;em&gt;What table hint can be used?&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;Answer: The &lt;strong&gt;READPAST&lt;/strong&gt; locking hint :)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://msdn.microsoft.com/en-us/library/ms187373.aspx"&gt;READPAST&lt;/a&gt; locking hint&amp;nbsp;when used, instructs the SQL Server Database Engine to &lt;u&gt;skip row-level locks&lt;/u&gt;.&lt;br /&gt;This means that the UPDATE statement using READPAST will only update the table rows that are not locked by another operation. In the opposite case, the Database Engine would block the UPDATE statement's execution until the rest of the target rows' locks are released. A typical UPDATE statement with the READPAST locking hint would look like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;UPDATE [TABLE_NAME] WITH (READPAST)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;SET ...&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;WHERE ...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Even if the above locking hint can become quite handy, as well as the rest of the locking hints, you always need to have in mind that you should use them very carefully as you might cause&amp;nbsp;locking issues in the database. SQL Server Query Optimizer typically selects the best execution plan for a query, so it is not recommended for inexperienced developers and administrators to make use of the locking hints.&lt;br /&gt;&lt;br /&gt;As a last note, the READPAST hint can only be specified in transactions operating at the READ COMMITTED or REPEATABLE READ isolation levels.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-1234084552695891336?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/1234084552695891336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=1234084552695891336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1234084552695891336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1234084552695891336'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/08/updating-sql-server-tables-without.html' title='Updating SQL Server Tables Without Causing Blocking'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-8175109568675163958</id><published>2011-08-12T21:55:00.003+03:00</published><updated>2011-08-12T21:56:26.483+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Backing up a Database in a Network Folder</title><content type='html'>Hi! I hope you are all doing well and having a great summer time!&lt;br /&gt;&lt;br /&gt;It's been a while since the last time I have posted an article but hey, besides the heavy workload, it's summer time and the beaches in Cyprus are really great! :)&lt;br /&gt;&lt;br /&gt;This post discusses about a quite simple task in SQL Server: &lt;b&gt;backing up a database in a network folder / remote server&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;To cut the long story short, imagine the following scenario:&lt;br /&gt;&lt;br /&gt;You have a SQL Server Instance located on a server with only one local drive (&lt;b&gt;!&lt;/b&gt;) and you urgently need to backup a database somewhere! Well, the first thing that comes on my mind, is to backup the database on a remote location (yep, you do not have physical access to the server and cannot mount a USB flash drive :)&lt;br /&gt;&lt;br /&gt;In order to do this you first need to mount the remote location (network folder) as a backup device.&lt;br /&gt;&lt;br /&gt;To this end, let's say you have the network folder &lt;b&gt;\\serverName\backupFolder&lt;/b&gt; and you want to mount it as a backup device. For doing that, you have to run the following stored procedure:&lt;br /&gt;&lt;div style="color: #38761d;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;USE master&lt;/div&gt;&lt;div style="color: #274e13;"&gt;GO&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;EXEC sp_addumpdevice 'disk','NetWorkDeviceName','\\serverName\backupFolder\BackupFileName.bak'&lt;/div&gt;&lt;div style="color: #274e13;"&gt;GO&lt;/div&gt;&lt;br /&gt;Then from SSMS you can select to backup the database on the mounted backup device and that's it!&lt;br /&gt;&lt;br /&gt;However, there is one consideration; &lt;b&gt;the service account which runs the SQL Server Instance needs to have read/write permissions on the network folder (shared permissions)&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;In the opposite case you will receive the following error message:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-C5ruM7wKOco/TkV1-T1GFBI/AAAAAAAAAgE/w3VhiBKmyTE/s1600/error_network_device.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="116" src="http://3.bp.blogspot.com/-C5ruM7wKOco/TkV1-T1GFBI/AAAAAAAAAgE/w3VhiBKmyTE/s400/error_network_device.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope you found this post useful! &lt;br /&gt;&lt;br /&gt;Until next time!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-8175109568675163958?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/8175109568675163958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=8175109568675163958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8175109568675163958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8175109568675163958'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/08/backing-up-database-in-network-folder.html' title='Backing up a Database in a Network Folder'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-C5ruM7wKOco/TkV1-T1GFBI/AAAAAAAAAgE/w3VhiBKmyTE/s72-c/error_network_device.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-1193929002343911061</id><published>2011-06-01T17:20:00.019+03:00</published><updated>2011-06-01T17:54:20.155+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Tool that generates Dynamic T-SQL!</title><content type='html'>A few days ago, my blog reached &lt;strong&gt;100.000&lt;/strong&gt; visits. Given this opportunity I decided to try to do something special, for example write a pretty cool article or even better, build a SQL-Related tool and give it as a freeware via my blog!&lt;br /&gt;&lt;br /&gt;Before talking about the tool, first of all I would like to say a huge THANK YOU for your support. The 100.000 visits did not take place by machines (oh well, some visits might came from bots :)) but real persons. Persons that are passionate about technology, persons just like me.&lt;br /&gt;&lt;br /&gt;I have always believed in technical communities and the exchange of knowledge within them. To share technical knowledge is a different way of communication; a communication based on the same passion for technology. You want to know something; you just ask about it. You want to share something; you just answer a question or write about it. You want to discuss something; you leave a comment. The communication within a technical community is quite simple. I think that I have just described its main principles :) I believe that this is the reason that there are so many technical communities worldwide as well as so many distinguished community leaders.&lt;br /&gt;&lt;br /&gt;So, I would just like thank you again for your support and jump immediately to the description of the tool!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;First, here’s a screenshot of the tool:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-_xlmqkaK2ZU/TeZNE37EstI/AAAAAAAAAf4/8WAhzN2dPs8/s1600/sc_DynamicTSQLGen_Main.jpg" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"&gt;&lt;img border="0" height="181" width="400" src="http://4.bp.blogspot.com/-_xlmqkaK2ZU/TeZNE37EstI/AAAAAAAAAf4/8WAhzN2dPs8/s400/sc_DynamicTSQLGen_Main.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As you can see the tool’s name is “&lt;b&gt;Dynamic T-SQL Generator&lt;/b&gt;”.&lt;br /&gt;&lt;br /&gt;The rationale behind this tool is quite simple. There is many times where you might need to embed a T-SQL statement for dynamic execution. For example you may have the following query:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;SELECT * FROM tCustomer WHERE NAME=’JOHN’&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then let's say you want to include the above query to a Database Mail send statement:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;EXEC msdb.dbo.sp_send_dbmail&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;@recipients=N'email_address@goes.here',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;@importance='Normal',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;@body='Email body goes here.', &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;@subject ='Email subject goes here',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;@profile_name ='Profile_name',&lt;br /&gt;@query ='SELECT * FROM tCustomer WHERE NAME=''JOHN''',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;@attach_query_result_as_file = 1,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;@query_attachment_filename ='Query_Results.txt'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As you can see in the above example, the query needed to be enclosed in single quotation marks as well as the name value "JOHN" in the WHERE clause needed two additional single quotation marks. Now, if your query is a very simple one, it is not a hassle to manually add the single quotation marks. However, most of the times this is not the case :) You usually have a really large query that you may need to embed it as a parameter to a stored procedure, etc.&lt;br /&gt;&lt;br /&gt;To this end, wouldn’t it be cool to have a tool that transforms a static T-SQL statement into a dynamic one and vice versa? Guess what; this is what exactly “Dynamic T-SQL Generator” does!&lt;br /&gt;&lt;br /&gt;Analytically the functionality of the tool is the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Given a static T-SQL statement it generates the corresponding dynamic T-SQL statement.&lt;/li&gt;&lt;li&gt;Given a dynamic T-SQL statement it generates the corresponding static T-SQL statement.&lt;/li&gt;&lt;li&gt;Ability to restore the original T-SQL statement.&lt;/li&gt;&lt;li&gt;Ability to convert the T-SQL statement to uppercase.&lt;/li&gt;&lt;li&gt;Ability to convert the T-SQL statement to lowercase.&lt;/li&gt;&lt;li&gt;Ability to copy the T-SQL statement to the clipboard.&lt;/li&gt;&lt;li&gt;Ability to paste the contents of the clipboard into the text box.&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;&lt;u&gt;Prerequisites&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The only prerequisite for executing the tool is having installed &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=d0e5dea7-ac26-4ad7-b68c-fe5076bba986"&gt;Microsoft .NET Framework 3.5 SP1&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Downloading the Tool&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;If you like to get the tool, you can download it from &lt;a href="http://cid-f7a5cb9a0405dcb5.office.live.com/self.aspx/.Public/Utilities/Dynamic%20T-SQL%20Generator%20v1.0.zip"&gt;here&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;I hope you find it useful! &lt;br /&gt;&lt;br /&gt;By the way, drop me a line if you liked the tool!&lt;br /&gt;&lt;br /&gt;Cheers!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-1193929002343911061?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/1193929002343911061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=1193929002343911061' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1193929002343911061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1193929002343911061'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/06/tool-that-generates-dynamic-t-sql.html' title='Tool that generates Dynamic T-SQL!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-_xlmqkaK2ZU/TeZNE37EstI/AAAAAAAAAf4/8WAhzN2dPs8/s72-c/sc_DynamicTSQLGen_Main.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-1503507360178146045</id><published>2011-05-20T18:31:00.001+03:00</published><updated>2011-05-20T18:47:00.205+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Executing Heavy Set-Based Operations Against VLDBs in SQL Server</title><content type='html'>Recently I had to design and execute some heavy set-based T-SQL operations against a large number of very large databases (VLDBs) within a SQL Server 2005 instance.&lt;br /&gt;&lt;br /&gt;I won't enter the debate of Row-Based vs. Set-Based processing right now, as I plan to write an article on this in the near future, but I will rather discuss some concerns that need to be taken into account when performing such operations.&lt;br /&gt;&lt;br /&gt;First of all, in terms of hardware resources you will need enough RAM and of course, more than one processor (remember to check the Processor affinity setting in your SQL Server instance).&lt;br /&gt;&lt;br /&gt;Now, the most important aspect when executing such operations (set-based) against large databases is the log space. &lt;br /&gt;&lt;br /&gt;As the execution of the operation continues, a significant amount of transaction log space is being reserved thus requiring more storage. The reason this is happening is that the operation is not committed until it completes its execution against the entire data set. So, if your target database's recovery model is set to "FULL" it means that any changes performed by the set-based operation will be logged up to the latest detail thus requiring more storage.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;So, how can you ensure that the set-based operation will be completed without any problems such as full disk spaces, etc. and thus avoid the possibility of having the operation abnormally terminated?&lt;br /&gt;&lt;br /&gt;Well, there are two approaches (if not more); the easy one and the complex one.&lt;br /&gt;&lt;br /&gt;The complex approach is to break-up the set-based operation thus targeting smaller data sets within the database. Not so good right? I don't like it either! In my opinion, this should be the very last option as “segmenting” the target data set is not a trivial task, mainly in terms of data consistency.&lt;br /&gt;&lt;br /&gt;And here’s the simple approach: &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Find a date and time where there are not operations targeting the database (this is actually a downtime :)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Set the database's recovery model to SIMPLE as in the following example:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color: #38761d;"&gt;ALTER DATABASE [Database_Name] SET RECOVERY SIMPLE&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color: #38761d;"&gt;GO&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Execute the set-based operation.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Set the database's recovery model to FULL as in the following example:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;&lt;strong&gt;ALTER DATABASE [Database_Name] SET RECOVERY FULL&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;&lt;strong&gt;GO&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When your database uses the Full Recovery Model, SQL Server preserves the transaction log until you back it up. By doing this, it allows you to recover the database to a specific point of time based on the entries in the transaction log. That’s why when this recovery model is selected SQL Server logs everything in the database’s log file. Of course this requires more disk space and slightly affects performance but it enables you to fully recover your database in the case of a disaster.&lt;br /&gt;&lt;br /&gt;When you use the Simple Recovery Model, SQL Server keeps only a minimal amount of information in the log file. Also the file is automatically truncated by SQL Server whenever the database reaches a transaction checkpoint. Even though this is not the best choice for disaster recovery purposes, it allows the processing on the database to be faster.&lt;br /&gt;&lt;br /&gt;So, as I had to execute some really heavy set-based T-SQL operations I changed the recovery model to Simple in order for the processing to be faster and to ensure (up to the possible limit) that I wouldn’t experience any disk space issues due to the size increase of the transaction log files.&lt;br /&gt;&lt;br /&gt;Hope this helps!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-1503507360178146045?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/1503507360178146045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=1503507360178146045' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1503507360178146045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1503507360178146045'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/05/executing-heavy-set-based-operations.html' title='Executing Heavy Set-Based Operations Against VLDBs in SQL Server'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-1850192631090555063</id><published>2011-05-19T15:27:00.002+03:00</published><updated>2011-05-19T15:29:56.280+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Using Unicode in SQL Server</title><content type='html'>Unicode is the &lt;a href="http://www.unicode.org/"&gt;standard&lt;/a&gt; used in the computing industry for encoding and representing any text in the most written languages (&lt;a href="http://en.wikipedia.org/wiki/Unicode"&gt;…&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;SQL Server supports Unicode, thus allowing the easy storage and manipulation of data in the most languages.&lt;br /&gt;&lt;br /&gt;As I wanted to test this functionality I performed a simple experiment with the Cyrillic alphabet.&lt;br /&gt;&lt;br /&gt;To this end I created two tables in SQL Server 2005, the one in non-Unicode and the other one in Unicode:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;CREATE TABLE tStandard(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;[name] varchar(100)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;CREATE TABLE tUnicode(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;[name] nvarchar(100)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As you can see, in the &lt;b&gt;tStandard&lt;/b&gt; table the “&lt;b&gt;name&lt;/b&gt;” field’s data type is &lt;b&gt;&lt;u&gt;varchar&lt;/u&gt;&lt;/b&gt; and in the &lt;b&gt;tUnicode&lt;/b&gt; table the “&lt;b&gt;name&lt;/b&gt;” field’s data type is &lt;u&gt;&lt;b&gt;nvarchar&lt;/b&gt;&lt;/u&gt;. &lt;br /&gt;&lt;br /&gt;The difference between the varchar and nvarchar data types is that the former uses 1 byte for representing characters where the later uses 2 bytes thus supporting Unicode.&lt;br /&gt;&lt;br /&gt;Then I created a text file in Unicode containing three records with my name in Russian:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-cx5qX0p8pyE/TdT3g4DCnOI/AAAAAAAAAfY/VF9H70e6TxQ/s1600/sc0_Source_Text.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-cx5qX0p8pyE/TdT3g4DCnOI/AAAAAAAAAfY/VF9H70e6TxQ/s1600/sc0_Source_Text.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;The next step was to import the data into the two tables using the &lt;a href="http://msdn.microsoft.com/en-us/library/ms141209.aspx"&gt;SQL Server Import and Export Wizard&lt;/a&gt;. As you can see from the screenshot below, when I tried to import the data into the&amp;nbsp;&lt;b&gt;tStandard &lt;/b&gt;table the process failed because of the fact that the data did not match the target code page (&lt;b&gt;GREEK_CI_AS&lt;/b&gt;):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-hdaO03bj_9s/TdT3ubBuWGI/AAAAAAAAAfg/kJrRBy9r3B4/s1600/sc2_Error_Message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-hdaO03bj_9s/TdT3ubBuWGI/AAAAAAAAAfg/kJrRBy9r3B4/s1600/sc2_Error_Message.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;But what about if we want to represent any language without relying on the target database’s code page/collation?&lt;br /&gt;&lt;br /&gt;The answer is easy; Use &lt;b&gt;nvarchar(s)&lt;/b&gt;!&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Let’s see what happened with the rest of my experiment.&lt;br /&gt;&lt;br /&gt;Here’s the result of trying to import the data into the &lt;b&gt;tUnicode&lt;/b&gt; table:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-f46mK8CX4UU/TdT4CeiLh_I/AAAAAAAAAfk/wt0P-vbelNc/s1600/sc3_Message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-f46mK8CX4UU/TdT4CeiLh_I/AAAAAAAAAfk/wt0P-vbelNc/s1600/sc3_Message.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Yep, the data was imported successfully!&lt;br /&gt;And here’s the SELECT * query’s results when executed against the two tables:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-VUvas2W8XO8/TdT4W9BMsSI/AAAAAAAAAfo/czuTu1Hs8FY/s1600/sc4_Query_Result.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-VUvas2W8XO8/TdT4W9BMsSI/AAAAAAAAAfo/czuTu1Hs8FY/s1600/sc4_Query_Result.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;The conclusion out of this experiment is that by using &lt;b&gt;nvarchar&lt;/b&gt;, SQL Server can easily support the storage and representation of data in most written languages. &lt;br /&gt;&lt;br /&gt;The only thing you need to have in mind, is that when using Unicode data types such as the nvarchar, the required storage will be doubled in comparison with using non-Unicode data types (i.e. varchar).&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-1850192631090555063?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/1850192631090555063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=1850192631090555063' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1850192631090555063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1850192631090555063'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/05/using-unicode-in-sql-server.html' title='Using Unicode in SQL Server'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-cx5qX0p8pyE/TdT3g4DCnOI/AAAAAAAAAfY/VF9H70e6TxQ/s72-c/sc0_Source_Text.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-6391191558503279117</id><published>2011-04-01T23:21:00.003+03:00</published><updated>2011-04-01T23:22:29.110+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVP'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Microsoft MVP for the third year in a row!</title><content type='html'>Today is a very special day! I just got re-awarded with the Microsoft &lt;a href="http://mvp.support.microsoft.com/"&gt;MVP Award&lt;/a&gt; on SQL Server for the third year in a row!&lt;br /&gt;&lt;br /&gt;------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-hcaq1K33KFw/TZYyw9XJb4I/AAAAAAAAAfQ/sK82ywjKCnw/s1600/mvplogo.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-hcaq1K33KFw/TZYyw9XJb4I/AAAAAAAAAfQ/sK82ywjKCnw/s1600/mvplogo.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Dear Artemakis Artemiou,&lt;br /&gt;&lt;br /&gt;Congratulations! We are pleased to present you with the 2011 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in SQL Server technical communities during the past year.&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;------------------------------------------&lt;br /&gt;&lt;br /&gt;I feel really honored and happy by receiving once again the MVP Award. The strongest motivation for contributing within the SQL Server Community is the Community itself. It is the willingness to share knowledge with fellow Community members, the joy of belonging to a broader technical group of people who share the same passion for technology and above all, the love and enthusiasm for SQL Server! &lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;I would like to say a huge &lt;b&gt;thank you&lt;/b&gt; to the SQL Server Community for being just awesome! It is a privilege to be a part of this Community.&lt;br /&gt;&lt;br /&gt;Also, many thanks to Microsoft for strongly and continuously supporting the technical communities around the globe!&lt;br /&gt;&lt;br /&gt;I would also like to thank the SQL Server Product Group for developing such great technologies and everyone involved in the MVP Award Program.&lt;br /&gt;&lt;br /&gt;On my end, as I did in the last two years, I promise that I will keep on doing my best regarding my involvement in the SQL Server community and keep on sharing knowledge!!!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-6391191558503279117?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/6391191558503279117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=6391191558503279117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/6391191558503279117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/6391191558503279117'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/04/microsoft-mvp-for-third-year-in-row.html' title='Microsoft MVP for the third year in a row!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-hcaq1K33KFw/TZYyw9XJb4I/AAAAAAAAAfQ/sK82ywjKCnw/s72-c/mvplogo.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-3356125540532089049</id><published>2011-03-21T21:23:00.003+02:00</published><updated>2011-03-21T21:25:19.413+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Locking Hints'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Using the NOLOCK Table Hint</title><content type='html'>Each time you write and execute a T-SQL Query in SQL Server, the Database Engine selects the most optimized query plan for executing the query.&lt;br /&gt;&lt;br /&gt;The SQL Server Database Engine component that undertakes this task is the &lt;a href="http://msdn.microsoft.com/en-us/library/ff650689.aspx"&gt;Query Optimizer&lt;/a&gt;. Given the T-SQL query itself as well as the underlying database(s) design, the Query Optimizer selects the best execution plan for the query and then it executes the query.&lt;br /&gt;&lt;br /&gt;Now, in SQL Server you can make use of several &lt;a href="http://technet.microsoft.com/en-us/library/ms181714.aspx"&gt;query hints&lt;/a&gt;, such as &lt;a href="http://aartemiou.blogspot.com/2009/01/table-level-locking-hints-in-sql-server.html"&gt;locking hints&lt;/a&gt;. Though, as SQL Server Query Optimizer typically selects the best execution plan for a query, it is not recommended for inexperienced developers and administrators to make use of them.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Nevertheless, today I will talk about a special table hint, that is the &lt;a href="http://msdn.microsoft.com/en-us/library/ms187373.aspx"&gt;NOLOCK hint&lt;/a&gt;. This hint is equivalent to the READUNCOMMITTED hint.&lt;br /&gt;&lt;br /&gt;A typical example of using the NOLOCK hint is the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT *&lt;br /&gt;FROM TABLE_NAME WITH (NOLOCK)&lt;br /&gt;GO &lt;/div&gt;&lt;br /&gt;Similar examples:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT *&lt;br /&gt;FROM TABLE_NAME A WITH (NOLOCK)&lt;br /&gt;GO &lt;/div&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT *&lt;br /&gt;FROM TABLE_NAME (NOLOCK)&lt;br /&gt;GO &lt;/div&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT *&lt;br /&gt;FROM TABLE_NAME A (NOLOCK)&lt;br /&gt;GO &lt;/div&gt;&lt;br /&gt;For environments where many concurrent queries are executed against the same database objects (i.e. Web Applications), the NOLOCK hint can become quite handy. By using this hint, the transaction isolation level for the SELECT statement is READ UNCOMMITTED. Of course, this means that the query may see inconsistent data, that is data not yet committed, etc. So, if this is not a problem for you, it might solve many concurrency issues.&lt;br /&gt;&lt;br /&gt;Though note that in general is not a good idea to apply the above practice as a rule.&lt;br /&gt;&lt;br /&gt;I hope you found this post useful!&lt;br /&gt;&lt;br /&gt;Until next time!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-3356125540532089049?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/3356125540532089049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=3356125540532089049' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3356125540532089049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3356125540532089049'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/03/using-nolock-table-hint.html' title='Using the NOLOCK Table Hint'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-1121205601213176701</id><published>2011-03-20T09:56:00.000+02:00</published><updated>2011-03-20T09:56:47.141+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Database [Database_Name] cannot be upgraded because it is read-only or has read-only files</title><content type='html'>A few days ago I was trying to attach some databases on a SQL Server 2005 instance. The database files were copied over the network and located on a drive on the DBMS server.&lt;br /&gt;&lt;br /&gt;Though, while I was trying to attach the databases I was getting an error message of the following type:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;Msg 3415, Level 16, State 3, Line 1&lt;/div&gt;&lt;div style="color: red;"&gt;Database &lt;b&gt;[database_name]&lt;/b&gt; cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.&lt;/div&gt;&lt;div style="color: red;"&gt; Msg 1813, Level 16, State 2, Line 1&lt;/div&gt;&lt;div style="color: red;"&gt; Could not open new database &lt;b&gt;[database_name&lt;/b&gt;]. CREATE DATABASE is aborted.&lt;/div&gt;&lt;br /&gt;As the error message was saying, I checked the permissions of the database files and ensured that they were &lt;b&gt;not &lt;/b&gt;read-only. Also, the service user account running the SQL Server instance had full access on the files.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;As I did not have much time for fully troubleshooting the issue, I provided full access to "&lt;b&gt;Everyone&lt;/b&gt;" on all the database files I wanted to attach, and tried again.&lt;br /&gt;&lt;br /&gt;Guess what? It worked :)&lt;br /&gt;&lt;br /&gt;After the databases were successfully attached, I removed the full access from the "&lt;b&gt;Everyone&lt;/b&gt;" entity and so everything was back to normal!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-1121205601213176701?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/1121205601213176701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=1121205601213176701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1121205601213176701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1121205601213176701'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/03/database-databasename-cannot-be.html' title='Database [Database_Name] cannot be upgraded because it is read-only or has read-only files'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-7212526200850374039</id><published>2011-02-22T17:46:00.000+02:00</published><updated>2011-02-22T17:46:10.951+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Error Messages'/><title type='text'>No global profile is configured. Specify a profile name in the @profile_name parameter</title><content type='html'>Yesterday I set up a maintenance plan in one SQL Server 2005 Instance for rapidly tuning up a set of databases with some simple tasks such as index rebuild, etc. &lt;br /&gt;&lt;br /&gt;Whenever you set up a maintenance plan is always a good idea to add in the end the “Notify Operator” Task in order to get notified on the outcome of the maintenance plan’s execution.&lt;br /&gt;&lt;br /&gt;Here’s a screenshot of my simple maintenance task:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-UUMfb6Jv55k/TWOD9Xv5mcI/AAAAAAAAAfM/24L5mGEWGSA/s1600/Maintenance+Plan+-+simple.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" j6="true" src="http://1.bp.blogspot.com/-UUMfb6Jv55k/TWOD9Xv5mcI/AAAAAAAAAfM/24L5mGEWGSA/s1600/Maintenance+Plan+-+simple.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Even though the first three tasks were executed successfully, when I checked the history of the job that undertakes the execution of the maintenance plan, there was an error message on the last task that is the “Notify Operator” Task.&lt;br /&gt;&lt;br /&gt;A part of the error message is the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color: red;"&gt;"No global profile is configured. Specify a profile name in the @profile_name parameter.”&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;So, what does the above error message tell us? It actually says that upon the task’s execution, it cannot find a Database Mail profile in order to use it for sending the email notification. &lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;To overcome this problem, you can set one of the available Database Mail profiles as the &lt;u&gt;&lt;strong&gt;default&lt;/strong&gt;&lt;/u&gt; one.&lt;br /&gt;&lt;br /&gt;In SQL Server 2005 you can do this in the following way through SSMS:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Management -- Database Mail (double-click or right-click - Configure Database Mail).&lt;/li&gt;&lt;li&gt;Click on Next.&lt;/li&gt;&lt;li&gt;Manage profile security.&lt;/li&gt;&lt;li&gt;Click on Next.&lt;/li&gt;&lt;li&gt;Then you will see a list with all the available database mail profiles. You have the option to select one of these profiles to be the Default Profile (be selecting ‘Yes’ in the combo box).&lt;/li&gt;&lt;li&gt;Click on Next.&lt;/li&gt;&lt;li&gt;Click on Finish.&lt;/li&gt;&lt;/ol&gt;That should do it!&lt;br /&gt;&lt;br /&gt;At least in my scenario I tried it and worked perfectly! :)&lt;br /&gt;&lt;br /&gt;Of course, the above assumes that you have at least one Database Mail profile up and working! :) &lt;br /&gt;&lt;br /&gt;Until next time!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-7212526200850374039?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/7212526200850374039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=7212526200850374039' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7212526200850374039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7212526200850374039'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/02/no-global-profile-is-configured-specify.html' title='No global profile is configured. Specify a profile name in the @profile_name parameter'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-UUMfb6Jv55k/TWOD9Xv5mcI/AAAAAAAAAfM/24L5mGEWGSA/s72-c/Maintenance+Plan+-+simple.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-6560369230415329008</id><published>2011-01-08T13:59:00.002+02:00</published><updated>2011-12-12T19:51:34.575+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Denali'/><category scheme='http://www.blogger.com/atom/ns#' term='Utilities'/><category scheme='http://www.blogger.com/atom/ns#' term='MVP'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Free Utility for SQL Server 2012 CTP1 - Snippets Generator v1.0</title><content type='html'>T-SQL code snippets is a very handy new feature in &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6a04f16f-f6be-4f92-9c92-f7e5677d91f9"&gt;SQL Server 2012 CTP1&lt;/a&gt; (codenamed "Denali").&lt;br /&gt;&lt;br /&gt;Using code snippets you can save time when you write code and you just need to enter code that does common tasks. Code reuse has always been useful and it really increases productivity!&lt;br /&gt;&lt;br /&gt;In SQL Server 2012 CTP1 you can import your own snippets. However, prior to that, you need to create a snippet.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Each snippet is an XML file that specifies some header information regarding the snippet and then it includes the T-SQL code.&lt;br /&gt;&lt;br /&gt;A sample T-SQL code snippet for SQL Server 2012 CTP1 is illustrated in the following image:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/TSc5wgJPbaI/AAAAAAAAAfA/hs-RW4nZzGk/s1600/SnippetSampleSyntax.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/TSc5wgJPbaI/AAAAAAAAAfA/hs-RW4nZzGk/s1600/SnippetSampleSyntax.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Yesterday while I was recording my Webcast on Denali, I thought to myself: "&lt;i&gt;By the time the XML structure is common for all T-SQL code snippets for SQL Server Denali why not creating a Windows Forms Application that can server as T-SQL code snippets generator?&lt;/i&gt;"&lt;br /&gt;&lt;br /&gt;Today I implemented my idea and the outcome is "&lt;b&gt;Snippets Generator v1.0&lt;/b&gt;" :)&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/TSc5x8SR7EI/AAAAAAAAAfE/xlSvqA-Wn1g/s1600/SnippetGeneratorScreenshot.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/TSc5x8SR7EI/AAAAAAAAAfE/xlSvqA-Wn1g/s1600/SnippetGeneratorScreenshot.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using this tool you can generate T-SQL code snippets for SQL Server "Denali", save it into a directory and then add the directory, and consequently your custom snippets, into SQL Server "Denali" via the Code Snippets Manager! The directory's name will be the snippet category name in Code Snippet Manager and its contents will be the snippets!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can download the tool from here:&lt;br /&gt;&lt;br /&gt;&lt;iframe title ="Preview" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:98px;height:115px;padding:0;background-color:#fcfcfc;" src="http://cid-f7a5cb9a0405dcb5.office.live.com/embedicon.aspx/.Public/Utilities/SnippetsGenerator%20v1.0.zip"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Prerequisites:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;.NET Framework 3.5 SP1&lt;/li&gt;&lt;li&gt;SQL Server 2012 CTP1 (for importing the generated snippets(s) :)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Drop me a line if you like the tool! Your valuable feedback is always welcome and much appreciated! &lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;* Please note that this is a freeware. I will not be responsible for illegal actions or damage caused by the misuse of this software.&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-6560369230415329008?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/6560369230415329008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=6560369230415329008' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/6560369230415329008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/6560369230415329008'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/01/free-utility-for-sql-server-2011-ctp1.html' title='Free Utility for SQL Server 2012 CTP1 - Snippets Generator v1.0'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_tEowgAvs-mQ/TSc5wgJPbaI/AAAAAAAAAfA/hs-RW4nZzGk/s72-c/SnippetSampleSyntax.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-8548978490039009719</id><published>2011-01-07T15:40:00.004+02:00</published><updated>2011-01-07T15:59:27.123+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Webcasts'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2011'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Webcast: Introducing SQL Server "Denali" (CTP1)</title><content type='html'>Hello and &lt;b style="color: red;"&gt;Happy New Year 2011&lt;/b&gt;! Wishing all the best, always in good health!&lt;br /&gt;&lt;br /&gt;Microsoft has recently released &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6a04f16f-f6be-4f92-9c92-f7e5677d91f9"&gt;CTP1&lt;/a&gt; of SQL Server 2011 codenamed "&lt;a href="http://blogs.technet.com/b/dataplatforminsider/archive/2010/11/10/microsoft-dives-deeper-into-sql-server-code-named-denali-the-next-version-of-sql-server.aspx"&gt;Denali&lt;/a&gt;".&lt;br /&gt;&lt;br /&gt;This new version of SQL Server Server introduces many new features that increase productivity and reduce the development and administration effort.&lt;br /&gt;&lt;br /&gt;One of my main observations is that there is a convergence of technologies. For example, SSMS is now powered by Visual Studio and that means a lot!&lt;br /&gt;&lt;br /&gt;A solid example is the fact that the debugging functionality in SSMS was significantly enhanced with the introduction of breakpoint conditions, hit counts and many more! Debugging now seems even more similar to the Debugging functionality of Visual Studio. Another example are the T-SQL code snippets.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;By having a glimpse on these features, the following major enhancements can be listed:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Advanced debugging of T-SQL scripts with: breakpoint conditions,hit counts,filter limits, actions and editing of breakpoint locations.&lt;/li&gt;&lt;li&gt;The Watch window and Quick Watch support watching T-SQL Expressions.&lt;/li&gt;&lt;li&gt;Breakpoint validation.&lt;/li&gt;&lt;li&gt;T-SQL code snippets.&lt;/li&gt;&lt;li&gt;Contained Databases.&lt;/li&gt;&lt;li&gt; Metadata Discovery.&lt;/li&gt;&lt;li&gt;WITH RESULT SETS argument.&lt;/li&gt;&lt;li&gt;Ad-hoc Query Paging Implementation.&lt;/li&gt;&lt;li&gt;Sequence Objects.&lt;/li&gt;&lt;li&gt;New Permissions.&lt;/li&gt;&lt;li&gt;New Role Management: You can now created user-defined server roles.&lt;/li&gt;&lt;li&gt;New Hashing Algorithms.&lt;/li&gt;&lt;li&gt;Object Impact and Data Lineage Analysis.&lt;/li&gt;&lt;li&gt;... and much more!&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;However, as this is my first blog post for 2011, I decided to publish something even more exciting instead of an article. So I thought to myself: "&lt;i&gt;Why not recording a Webcast for SQL Server Denali?&lt;/i&gt;" And so I did! :)&lt;br /&gt;&lt;br /&gt;In this Webcast I am introducing the major new features shipped with SQL Server "Denali". Along with the presentation I am performing live demos presenting some of these features in action!&lt;br /&gt;&lt;br /&gt;OK, enough talking! Here's the Webcast:&lt;br /&gt;&lt;br /&gt;&lt;object id="scPlayer" class="embeddedObject" width="640" height="480" type="application/x-shockwave-flash" data="http://content.screencast.com/users/Artemios/folders/Webcasts/media/a3299fb5-b373-4ddd-97be-aca769d34c1d/mp4h264player.swf" &gt;&lt;param name="movie" value="http://content.screencast.com/users/Artemios/folders/Webcasts/media/a3299fb5-b373-4ddd-97be-aca769d34c1d/mp4h264player.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;param name="flashVars" value="thumb=http://content.screencast.com/users/Artemios/folders/Webcasts/media/a3299fb5-b373-4ddd-97be-aca769d34c1d/FirstFrame.jpg&amp;containerwidth=640&amp;containerheight=480&amp;content=http://content.screencast.com/users/Artemios/folders/Webcasts/media/a3299fb5-b373-4ddd-97be-aca769d34c1d/Introducing%20SQL%20Server%20Denali%20CTP1.mp4&amp;blurover=false" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="scale" value="showall" /&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="base" value="http://content.screencast.com/users/Artemios/folders/Webcasts/media/a3299fb5-b373-4ddd-97be-aca769d34c1d/" /&gt;&lt;iframe type="text/html" frameborder="0" scrolling="no" style="overflow:hidden;" src="http://www.screencast.com/users/Artemios/folders/Webcasts/media/a3299fb5-b373-4ddd-97be-aca769d34c1d/embed" height="480" width="640" &gt;&lt;/iframe&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Well, I hope you enjoyed the Webcast as I enjoyed creating it! :)&lt;br /&gt;&lt;br /&gt;Please remember to complete the &lt;a href="https://spreadsheets.google.com/viewform?hl=en&amp;amp;formkey=dFY3OEtYZV9BNmlHRzFwdXFOcmo1cFE6MQ#gid=0"&gt;evaluation form&lt;/a&gt; for the Webcast by clicking on &lt;a href="https://spreadsheets.google.com/viewform?hl=en&amp;amp;formkey=dFY3OEtYZV9BNmlHRzFwdXFOcmo1cFE6MQ#gid=0"&gt;this link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Your feedback is always valuable and highly appreciated!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-8548978490039009719?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/8548978490039009719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=8548978490039009719' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8548978490039009719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8548978490039009719'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2011/01/webcast-introducing-sql-server-denali.html' title='Webcast: Introducing SQL Server &quot;Denali&quot; (CTP1)'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-8808329991984359417</id><published>2010-12-31T14:51:00.004+02:00</published><updated>2010-12-31T15:12:54.845+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Selected Tweets of Year 2010!</title><content type='html'>Well, I guess that's it. It's time to say goodbye to 2010 and welcome a brand new year: 2011!&lt;br /&gt;&lt;br /&gt;Like last year, in this post I am presenting a set of selected tweets I did in 2010 grouped into different categories. &lt;br /&gt;&lt;br /&gt;Again, it was a great experience communicating with the SQL Server Community among other, via Twitter. I hope you find my tweets useful!&lt;br /&gt;&lt;br /&gt;The categories of my tweets are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SQL Server Performance Tips&lt;/li&gt;&lt;li&gt;Events-Related – Screencasts – Webcasts&lt;/li&gt;&lt;li&gt;Blog Announcements&lt;/li&gt;&lt;li&gt;Microsoft DevDays 2010 - Cyprus&lt;/li&gt;&lt;li&gt;Regional CEE MVP Open Days 2010&lt;/li&gt;&lt;li&gt;Miscellaneous&lt;/li&gt;&lt;/ul&gt;OK! Enough "talking!" Here are the tweets!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;u&gt;&lt;b&gt;[SQL Server Performance Tips]&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;When running "heavy" T-SQL batches free the transaction log space often by using: DBCC SHRINKFILE (log_file_name, target_size) #in #MVPBuzz &lt;br /&gt;&lt;br /&gt;How to troubleshoot #SQLServer performance issues - &lt;a href="http://bit.ly/4Uav3u"&gt;http://bit.ly/4Uav3u&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;[Events-Related – Screencasts – Webcasts]&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;RT @CDNUG: [Website Updated]: Review of #CDNUG event on #SQLServer 2008 Clustering / Microsoft and Openness - &lt;a href="http://bit.ly/ha2AF1"&gt;http://bit.ly/ha2AF1&lt;/a&gt; #in #fb &lt;br /&gt;&lt;br /&gt;Upcoming #CDNUG Event on #Microsoft and Openness / Clustering in #SQLServer 2008: &lt;a href="http://bit.ly/9nu83E"&gt;http://bit.ly/9nu83E&lt;/a&gt; #in #fb #MVPBuzz &lt;br /&gt;&lt;br /&gt;RT @CDNUG: Save the date: November 24, 2010. CDNUG is back with its regular series of Community events! More info soon! #in #fb #CDNUG&lt;br /&gt;&lt;br /&gt;RT @CDNUG: [Website Updated]: Review of #CDNUG event on Windows 7 Development and #SQLServer 2008 R2 - &lt;a href="http://bit.ly/9MJnRJ"&gt;http://bit.ly/9MJnRJ&lt;/a&gt; #in #fb #MVPBuzz &lt;br /&gt;&lt;br /&gt;RT @CDNUG: [Website Updated]: Review of #CDNUG event on ASP.NET 4.0 - &lt;a href="http://bit.ly/bSN39L"&gt;http://bit.ly/bSN39L&lt;/a&gt; #in #fb #MVPBuzz &lt;br /&gt;&lt;br /&gt;RT @CDNUG: Review of #Microsoft DevDays 2010 in #Cyprus - #CDNUG participated with 2 of its members! - &lt;a href="http://bit.ly/aPpjXc"&gt;http://bit.ly/aPpjXc&lt;/a&gt; #in #fb #MVPBuzz &lt;br /&gt;&lt;br /&gt;Join us to the last #CDNUG event before summer holidays! &lt;a href="http://bit.ly/aBaCkR"&gt;http://bit.ly/aBaCkR&lt;/a&gt; #INETA_EU #Cyprus #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;RT @CDNUG: Upcoming #CDNUG Event: ASP.NET 4.0! - &lt;a href="http://bit.ly/9ILxKz"&gt;http://bit.ly/9ILxKz&lt;/a&gt; #in #INETA_EU&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;[Blog Announcements]&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;[Blog] Dynamically Generating T-SQL Statements! &lt;a href="http://bit.ly/h9ddGC"&gt;http://bit.ly/h9ddGC&lt;/a&gt; #in #fb #MVPBuzz #SQLServer &lt;br /&gt;&lt;br /&gt;[Blog] Segmenting Strings in #SQLServer - &lt;a href="http://bit.ly/eq8DPU"&gt;http://bit.ly/eq8DPU&lt;/a&gt; #in #fb #MVPBuzz &lt;br /&gt;&lt;br /&gt;[Blog] Upcoming CDNUG Event - #Microsoft and Openness / Clustering in #SQLServer 2008 - &lt;a href="http://bit.ly/gYFKZy"&gt;http://bit.ly/gYFKZy&lt;/a&gt; #fb #in #MVPBuzz #CDNUG &lt;br /&gt;&lt;br /&gt;[Blog] Software Systems in the 21st Century: Integration is the Key - &lt;a href="http://bit.ly/96YS6D"&gt;http://bit.ly/96YS6D&lt;/a&gt; #in #fb #MVPBuzz &lt;br /&gt;&lt;br /&gt;[Blog] Categorization of Blog Posts - &lt;a href="http://bit.ly/cJInGi"&gt;http://bit.ly/cJInGi&lt;/a&gt; #in #fb #MVPBuzz&lt;br /&gt;&lt;br /&gt;[Blog] Eliminating Blank Spaces in #SQLServer Tables - &lt;a href="http://bit.ly/bzeZX8"&gt;http://bit.ly/bzeZX8&lt;/a&gt; #MVPBuzz #in #fb &lt;br /&gt;&lt;br /&gt;[Blog] Security Changes in #SQLServer 2008 - &lt;a href="http://bit.ly/9A331U"&gt;http://bit.ly/9A331U&lt;/a&gt; #in #fb #MVPBuzz &lt;br /&gt;&lt;br /&gt;[Blog] #DevReach 2010! - &lt;a href="http://bit.ly/a3XzqA"&gt;http://bit.ly/a3XzqA&lt;/a&gt; #in #fb #INETA_EU #MVPBuzz &lt;br /&gt;&lt;br /&gt;[Blog] Changing the Database Owner in a #SQLServer Database - &lt;a href="http://bit.ly/aanHcO"&gt;http://bit.ly/aanHcO&lt;/a&gt; #MVPBuzz #in #fb &lt;br /&gt;&lt;br /&gt;[Blog] #CDNUG Event Review - July 15, 2010 - #Windows7 Development / #SQLServer 2008 R2 - &lt;a href="http://bit.ly/dD4eJY"&gt;http://bit.ly/dD4eJY&lt;/a&gt; #MVPBuzz #in #fb&lt;br /&gt;&lt;br /&gt;[Blog] Data Access and Consumption with WCF Data Services and #PowerPivot - &lt;a href="http://bit.ly/bxTDAM"&gt;http://bit.ly/bxTDAM&lt;/a&gt; #MVPBuzz #in #fb&lt;br /&gt;&lt;br /&gt;[Blog] Product Review: SQL Search - Searching for SQL Text Within SQL Server DB Objects - &lt;a href="http://bit.ly/dBi2zx"&gt;http://bit.ly/dBi2zx&lt;/a&gt; #MVPBuzz #in #fb &lt;br /&gt;&lt;br /&gt;[Blog] The #PowerPivot Experiment - Importing 100+ Million Records into Excel in 8 minutes! - &lt;a href="http://bit.ly/5VrCRp"&gt;http://bit.ly/5VrCRp&lt;/a&gt; #MVPBuzz #in #fb &lt;br /&gt;&lt;br /&gt;[Blog] Policy-Based Management in SQL Server 2008 - &lt;a href="http://bit.ly/aljD4X"&gt;http://bit.ly/aljD4X&lt;/a&gt; #SQLServer #MVPBuzz #in #fb &lt;br /&gt;&lt;br /&gt;[Blog] The Significance of Technical Communities - &lt;a href="http://bit.ly/clZIKp"&gt;http://bit.ly/clZIKp&lt;/a&gt; #in #MVPBuzz&lt;br /&gt;&lt;br /&gt;[Blog] #Microsoft DevDays 2010 in Cyprus! - &lt;a href="http://bit.ly/9rNbMc"&gt;http://bit.ly/9rNbMc&lt;/a&gt; #in #MVPBuzz #DevDays&lt;br /&gt;&lt;br /&gt;[Blog] Building Data Relationships in PowerPivot - &lt;a href="http://bit.ly/deqgWO"&gt;http://bit.ly/deqgWO&lt;/a&gt; #PowerPivot #in &lt;br /&gt;&lt;br /&gt;[Blog] Using PowerPivot’s Copy-Paste Support for Importing Data from Word - &lt;a href="http://bit.ly/9nDXRn"&gt;http://bit.ly/9nDXRn&lt;/a&gt; #in &lt;br /&gt;&lt;br /&gt;[Blog] Creating Logins for Orphaned SQL Server Users - &lt;a href="http://bit.ly/b6i0TZ"&gt;http://bit.ly/b6i0TZ&lt;/a&gt; #in #SQLServer &lt;br /&gt;&lt;br /&gt;[Blog] Cleaning up Backup and Restore History Logs in MSDB - &lt;a href="http://bit.ly/a1slKQ"&gt;http://bit.ly/a1slKQ&lt;/a&gt; #SQLServer #in &lt;br /&gt;&lt;br /&gt;[Blog] The "PowerPivot Experiment" - &lt;a href="http://bit.ly/5VrCRp"&gt;http://bit.ly/5VrCRp&lt;/a&gt; #PowerPivot #MVPBuzz #in&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;[Microsoft DevDays 2010 - Cyprus]&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;#DevDays 2010 in Cyprus was a big success! A huge thanks to @ikarld for organizing this great event for Cypriot software developers!! &lt;br /&gt;&lt;br /&gt;See you at #Microsoft #DevDays 2010 in #Cyprus! - &lt;a href="http://bit.ly/aGA85p"&gt;http://bit.ly/aGA85p&lt;/a&gt; #in #MVPBuzz &lt;br /&gt;&lt;br /&gt;Session testing completed within time. All set for tomorrow! &lt;br /&gt;&lt;br /&gt;My presentation for #Microsoft DevDays 2010 is ready! Heading for the demos tomorrow! #in #CDNUG &lt;br /&gt;&lt;br /&gt;Preparing my session for #Microsoft DevDays - It's all about data! - &lt;a href="http://bit.ly/9G8qhs"&gt;http://bit.ly/9G8qhs&lt;/a&gt; #MVPBuzz #in&lt;br /&gt;&lt;br /&gt;All set! Now let's talk about Data Access! &lt;br /&gt;&lt;br /&gt;OK, I think it is time for some Greek frappe coffee and a final test of my session for tomorrow's #DevDays 2010 in Cyprus! #in &lt;br /&gt;&lt;br /&gt;Tomorrow it will be a great day for software developers in #Cyprus! #Microsoft #DevDays 2010 will be taking place! #in &lt;br /&gt;&lt;br /&gt;Less than a day left for MS #DevDays 2010 in #Cyprus! #in &lt;br /&gt;&lt;br /&gt;I guess that's it! My demos for #Microsoft #DevDays 2010 are fully completed! Who knows? I'll might prepare a bonus demo as well! :-) #in &lt;br /&gt;&lt;br /&gt;Playing around with Fiddler2 and my WCF data service, i really like this tool! :) #in &lt;br /&gt;&lt;br /&gt;@dgkanatsios Totally agree. Fiddler is a great tool! I always use it in my demos when WCF data services (and not only) are involved :) &lt;br /&gt;&lt;br /&gt;When testing a WCF data service in IE8 remember to uncheck "Turn on feed reading view" in Internet Options-Content-Feeds and Web Slices. &lt;br /&gt;&lt;br /&gt;Great Visual Studio 2010 Theme Pack for Windows 7 &lt;a href="http://bit.ly/bCEcNA"&gt;http://bit.ly/bCEcNA&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;@Damir Great idea! I am sure they will like it! :-) &lt;br /&gt;&lt;br /&gt;WCF Data Service completed! "Consuming" the service in IE8 :) &lt;br /&gt;&lt;br /&gt;LINQ to Entities demos completed. It is time to build a WCF data service... &lt;br /&gt;&lt;br /&gt;Demos set 1 completed. Already 1 am. Tomorrow I will complete the rest of my demo sets: LINQ to Entities and WCF Data Services! &lt;br /&gt;&lt;br /&gt;Working on my first set of demos on Entity Framework for #DevDays 2010. Working with Visual Studio 2010 is so cool!&lt;br /&gt;&lt;br /&gt;#Microsoft #DevDays 2010 in Cyprus! Save the date: April 15, 2010 #in&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;[Regional CEE MVP Open Days 2010]&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;RT @jacquesdp: World Bank frees statistics. &lt;a href="http://bit.ly/9HyMav"&gt;http://bit.ly/9HyMav&lt;/a&gt;. (VM: Another good dataset to use with #PowerPivot: &lt;a href="http://bit.ly/bUQisU"&gt;http://bit.ly/bUQisU&lt;/a&gt;) &lt;br /&gt;&lt;br /&gt;Another great #Microsoft event completed! A huge thanks to @alead for making this possible! #in #ceemvp10 #mvpbuzz &lt;br /&gt;&lt;br /&gt;some really long discussions are taking place! #in #ceemvp10 #mvpbuzz &lt;br /&gt;&lt;br /&gt;It's time for Community Roundtables! #in #ceemvp10 #MVPBuzz &lt;br /&gt;&lt;br /&gt;@ikarld delivered a great session on Windows Phone 7 #in #ceemvp10 &lt;br /&gt;&lt;br /&gt;Learning some more on Windows identity foundation #ceemvp10 #in &lt;br /&gt;&lt;br /&gt;@alead Feeling great! Excitement is very high! Great people, great event! #ceemvp10 #in &lt;br /&gt;&lt;br /&gt;time for dinner! #in #ceemvp10 &lt;br /&gt;&lt;br /&gt;listening to Luka talking... #CEEMVP10 &lt;br /&gt;&lt;br /&gt;Flying to Athens in 2 hours. See you there! #CEEMVP10 &lt;br /&gt;&lt;br /&gt;Packing completed! #CEEMVP10 #in &lt;br /&gt;&lt;br /&gt;Too tired but so excited! Started packing for #CEEMVP10 !!! #MVPBuzz #in &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;[Miscellaneous]&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;My interview on MicrosoftFeed - &lt;a href="http://bit.ly/c7ctNP"&gt;http://bit.ly/c7ctNP&lt;/a&gt; #in #MVPBuzz #INETA_EU &lt;br /&gt;&lt;br /&gt;My second year as a #SQLServer MVP started today! A huge thanks to the SQL Server Community and #Microsoft! #MVPBuzz #in&lt;br /&gt;&lt;br /&gt;I have just passed #Microsoft Exam 70-451. I am now a MCITP: Database Developer 2008!!! #MVPBuzz #in #fb&lt;br /&gt;&lt;br /&gt;SELECT 'ALTER DATABASE ' + name + ' SET READ_WRITE WITH ROLLBACK IMMEDIATE' FROM SYS.DATABASES | The gen. T-SQL switches the DBs to R/W mode &lt;br /&gt;&lt;br /&gt;A simple advise: always double-check your T-SQL code which is to be used for manipulating multiple databases! #MVPBuzz&lt;br /&gt;&lt;br /&gt;Wishing a &lt;b&gt;&lt;u&gt;Happy New Year 2011&lt;/u&gt;&lt;/b&gt; full of health and of course ... SQL Server!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-8808329991984359417?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/8808329991984359417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=8808329991984359417' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8808329991984359417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8808329991984359417'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/12/selected-tweets-of-year-2010.html' title='Selected Tweets of Year 2010!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-1653809309842687241</id><published>2010-12-16T23:50:00.000+02:00</published><updated>2010-12-16T23:50:14.256+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='Programmability'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>Dynamically Generating T-SQL Statements!</title><content type='html'>So you have many databases, objects, etc. and you want to massively administer it right?&lt;br /&gt;&lt;br /&gt;In some of my previous posts I explained the undocumented stored procedures "&lt;a href="http://aartemiou.blogspot.com/2009/07/spmsforeachdb.html"&gt;sp_msforeachdb&lt;/a&gt;" and "&lt;a href="http://aartemiou.blogspot.com/2009/06/how-to-rebuild-all-indexes-of-database.html"&gt;sp_msforeachtable&lt;/a&gt;" that allow you to massively perform changes on all databases and tables within a SQL Server instance.&lt;br /&gt;&lt;br /&gt;But isn't it handier to generate dynamic T-SQL for doing that? I believe it is!&lt;br /&gt;&lt;br /&gt;By using some of the &lt;a href="http://msdn.microsoft.com/en-us/library/ms180163.aspx"&gt;catalog views&lt;/a&gt; in SQL Server 2005 or later you can easily do that. &lt;br /&gt;&lt;br /&gt;The idea is to use a basic SELECT statement and then dynamically build the T-SQL expression that eventually will generate the desired T-SQL code.&lt;br /&gt;&lt;br /&gt;Here are some examples (before running the code, right-click in the query window, then select "Results To" and finally "Results to Text"):&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;u&gt;&lt;b&gt;Example 1: See the physical files used for each database&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT &lt;/div&gt;&lt;div style="color: #274e13;"&gt;'USE '+ name +';'+' SELECT name,physical_name FROM SYS.DATABASE_FILES' FROM SYS.databases &lt;/div&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Example 2: Change the schema owner for all tables within a database&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT&lt;/div&gt;&lt;div style="color: #274e13;"&gt;'ALTER SCHEMA [NEW_SCHEMA_NAME] TRANSFER ' + s.Name + '.' + t.Name FROM sys.Tables t INNER JOIN &lt;/div&gt;&lt;div style="color: #274e13;"&gt;sys.Schemas s on t.schema_id = s.schema_id WHERE s.Name = ['OLD_SCHEMA_NAME']&lt;/div&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Example 3: Change the schema owner for all stored procedures within a database&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT&lt;/div&gt;&lt;div style="color: #274e13;"&gt;'ALTER SCHEMA [NEW_SCHEMA_NAME] TRANSFER ' + s.Name + '.' + sp.Name FROM sys.Procedures sp INNER JOIN &lt;/div&gt;&lt;div style="color: #274e13;"&gt;sys.Schemas s on sp.schema_id = s.schema_id WHERE s.Name = ['OLD_SCHEMA_NAME']&lt;/div&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Example 4: See all the views for each database&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT &lt;/div&gt;&lt;div style="color: #274e13;"&gt;'USE '+ s.name +';'+' SELECT * FROM sys.views' FROM SYS.databases s&lt;/div&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Example 5: Change the compatibility level for all the databases to 100 (SQL Server 2008)&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT&lt;/div&gt;&lt;div style="color: #274e13;"&gt;'ALTER DATABASE '+ name + ' SET COMPATIBILITY_LEVEL = 100' FROM SYS.DATABASES&lt;/div&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Example 6: Set all the databases to READ ONLY mode&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT&lt;/div&gt;&lt;div style="color: #274e13;"&gt;'ALTER DATABASE '+ name + ' SET READ_ONLY WITH ROLLBACK IMMEDIATE' FROM SYS.DATABASES&lt;/div&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Example 7: Set all the databases to READ/WRITE mode&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT&lt;/div&gt;&lt;div style="color: #274e13;"&gt;'ALTER DATABASE '+ name + ' SET READ_WRITE WITH ROLLBACK IMMEDIATE' FROM SYS.DATABASES&lt;/div&gt;&lt;br /&gt;... and the list goes on!&lt;br /&gt;&lt;br /&gt;When using this technique along with the information retrieved from the catalog views, the possibilities are endless!&lt;br /&gt;&lt;br /&gt;Yes, you still need to manually execute each generated T-SQL statement but the good thing is that the statements are being generated dynamically and by manually executing them, you have more control over your SQL Server instance.&lt;br /&gt;&lt;br /&gt;I hope this helps!&lt;br /&gt;&lt;br /&gt;Until next time!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #990000;"&gt;P.S. The above sample code is intended only for demo purposes. Do not use it on Production systems. Whenever you massively modify database objects you need to be very careful with your data. Always backup your data!&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-1653809309842687241?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/1653809309842687241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=1653809309842687241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1653809309842687241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1653809309842687241'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/12/dynamically-generating-t-sql-statements.html' title='Dynamically Generating T-SQL Statements!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-3681157821902776331</id><published>2010-12-16T19:26:00.002+02:00</published><updated>2010-12-16T19:30:28.489+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server String Functions'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2000'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Segmenting Strings in SQL Server</title><content type='html'>Lately I have been dealing a lot with SQL Server development that involves among other, segmenting strings.&lt;br /&gt;&lt;br /&gt;So, I decided to post an example-based article that discusses some simple ways of segmenting strings with T-SQL mainly by using the &lt;a href="http://msdn.microsoft.com/en-us/library/ms187748.aspx"&gt;SUBSTRING &lt;/a&gt;built-in function and some other built-in functions such as &lt;a href="http://msdn.microsoft.com/en-us/library/ms186323.aspx"&gt;CHARINDEX&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/ms177601.aspx"&gt;LEFT&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/ms177532.aspx"&gt;&lt;span id="goog_170646062"&gt;&lt;/span&gt;RIGHT&lt;/a&gt; &lt;span id="goog_170646063"&gt;&lt;/span&gt;and &lt;a href="http://msdn.microsoft.com/en-us/library/ms190329.aspx"&gt;LEN&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Additionally, in one of my &lt;a href="http://aartemiou.blogspot.com/2009/01/commonly-used-string-functions-in-sql.html"&gt;previous posts&lt;/a&gt;, I described the basic String built-in functions in SQL Server.&lt;br /&gt;&lt;br /&gt;Enough theory, let’s see some examples!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;u&gt;&lt;b&gt;Baseline&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;DECLARE @expression AS VARCHAR(20)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SET @expression='Hello World'&lt;/div&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Original Expression&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;SELECT @expression&lt;/div&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Requirement 1: Get the first word only&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;-- Methodology 1: Using the SUBSTRING built-in function&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT SUBSTRING(@expression,0,CHARINDEX(' ',@expression))&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;-- Methodology 2: Using the LEFT and CHARINDEX built-in functions&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT LEFT(@expression,CHARINDEX(' ',@expression))&lt;/div&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Requirement 2: Get the second word only&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;-- Methodology: Using the SUBSTRING built-in function&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT SUBSTRING(@expression,CHARINDEX(' ',@expression)+1,(LEN(@expression)-CHARINDEX(' ',@expression)))&lt;/div&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Requirement 3: Get the first letters of each word&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;-- Methodology: This is a little bit complex requirement and SUBSTRING is not enough. &lt;br /&gt;-- We also need to use the CHARINDEX, LEN and LEFT built-in functions.&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT LEFT(@expression,1)+LEFT(SUBSTRING(@expression,CHARINDEX(' ',@expression)+1,(LEN(@expression)-CHARINDEX(' ',@expression))),1)&lt;/div&gt;&lt;br /&gt;This post provided simple examples on how strings can be segmented in SQL Server. I did not get into complex scenarios as if I did that I am sure that I would need many hours for finishing the article as the scenarios can vary a lot!&lt;br /&gt;&lt;br /&gt;If you have another string segmentation scenario and/or its solution feel free to add it by commenting this post!&lt;br /&gt;&lt;br /&gt;I hope you found this post useful!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-3681157821902776331?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/3681157821902776331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=3681157821902776331' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3681157821902776331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3681157821902776331'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/12/segmenting-strings-in-sql-server.html' title='Segmenting Strings in SQL Server'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-5707563094133953201</id><published>2010-11-24T00:35:00.009+02:00</published><updated>2010-11-24T00:47:42.097+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='INETA'/><category scheme='http://www.blogger.com/atom/ns#' term='CDNUG'/><title type='text'>Upcoming CDNUG Event - Microsoft and Openness / Clustering in SQL Server 2008</title><content type='html'>Cyprus .NET User Group (&lt;a href="http://www.cdnug.net/"&gt;CDNUG&lt;/a&gt;) brings another event to you, &lt;b&gt;&lt;u&gt;by/for the Community!&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This month's event features two sessions:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Microsoft and Openness&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Clustering in SQL Server 2008&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;The first session, with speaker Andreas Hadjipanayi (Technical Account Manager at the local Microsoft Office in Cyprus)&amp;nbsp;discusses how Microsoft has become more open over time.&lt;br /&gt;&lt;br /&gt;The major discussion points during this session are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Microsoft’s contribution in standards and open source.&lt;/li&gt;&lt;li&gt;Microsoft’s commitment to listen to customers who want to deploy cool new solutions that combine Microsoft and other technologies.&lt;/li&gt;&lt;li&gt;Microsoft’s effort to make the transition to the cloud in an open manner.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The second session, with speaker Michael Theodoulou (MCITP: SQL Server 2008 Database Administrator and DBA team leader)&amp;nbsp;discusses the&amp;nbsp;several methods that SQL Server 2008 (and R2) offers for High-Availability (HA) and Disaster Recovery (DR) and how these can be used to maximize application uptime, data availability and reduce data-loss.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Among other, the session will cover installation of a SQL Server 2008 clustered instance:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Overview of SQL Server clustering. What it is and what it is not.&lt;/li&gt;&lt;li&gt;Possible configurations of clustered instances.&lt;/li&gt;&lt;li&gt;Requirements for Windows cluster.&lt;/li&gt;&lt;li&gt;Requirements for SQL Server 2008 cluster.&lt;/li&gt;&lt;li&gt;Domain &amp;amp; network requirements.&lt;/li&gt;&lt;li&gt;Possible issues and troubleshooting steps for AD environments.&lt;/li&gt;&lt;li&gt;Installation demo.&lt;/li&gt;&lt;/ul&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Event details:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;Topic 1 : &lt;b&gt;Microsoft and Openness&lt;/b&gt;&lt;br /&gt;Speaker: Andreas Hadjipanayi (Technical Account Manager at Microsoft-Cyprus)&lt;br /&gt;&lt;br /&gt;Topic 2 : &lt;b&gt;Clustering in SQL Server 2008&lt;/b&gt;&lt;br /&gt;Speaker: Michael Theodoulou (Leader of the DBA team at a private international organization, MCITP: SQL Server 2008 Database Administrator)&lt;br /&gt;&amp;nbsp;&lt;br /&gt;When: &lt;b&gt;Wednesday, November 24, 2010&lt;/b&gt;&lt;br /&gt;Time: &lt;b&gt;19:00&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Duration: 2 Hours&lt;br /&gt;Where: Microsoft Office (11 Limassol Avenue, Nicosia)&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Registration: Please sign-up on the following CDNUG Yahoo &lt;a href="http://tech.groups.yahoo.com/group/CDNUG/surveys?id=2334385"&gt;poll&lt;/a&gt;.&lt;br /&gt;&lt;b&gt;-------------------&lt;/b&gt;&lt;br /&gt;For more details check our website at &lt;a href="http://www.cdnug.net/"&gt;http://www.cdnug.net&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So, if it happens and you are in Cyprus, join us for our November's event and learn exciting new things!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-5707563094133953201?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/5707563094133953201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=5707563094133953201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5707563094133953201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5707563094133953201'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/11/upcoming-cdnug-event-microsoft-and.html' title='Upcoming CDNUG Event - Microsoft and Openness / Clustering in SQL Server 2008'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-3122579692267285261</id><published>2010-10-16T14:28:00.000+03:00</published><updated>2010-10-16T14:28:57.664+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Discussion'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Software Systems in the 21st Century: Integration is the Key</title><content type='html'>As this is my &lt;b&gt;100th post&lt;/b&gt; on my blog, I decided to write an article which is rather different than the previous ones. It was quite difficult to decide the topic for this post as there are so many aspects of the Database Technology that can be discussed.  Finally, I decided to write on the significance of integration in software systems of today and specifically on database systems as I find it a very trending topic.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;---&lt;/b&gt; &lt;br /&gt;Before proceeding with the article, I would like to express my gratitude to all of you that support my Community efforts by visiting my blog and expressing your ideas via your comments. It is really a great experience when technical discussions are initiated via your comments. &lt;br /&gt;&lt;br /&gt;After all, this is the purpose of this blog: &lt;i&gt;to exchange knowledge with fellow members of the broader Technical Community.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Thank you very much for your support! &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I hope you enjoy the article!&lt;br /&gt;&lt;b&gt;--- &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;In these modern times we live in, there are thousands (if not millions) of Software Systems for almost anything that can be automated using different sets of algorithms. These can vary from simple systems that can just be forms allowing data input and reporting, to sophisticated enterprise systems that perform complex tasks such as monitoring other systems and services, reporting on their health, taking corrective actions and so on. In this post I am going to talk about &lt;b&gt;Enterprise Systems&lt;/b&gt; and specifically Relational Database Management Systems (RDBMs) within the Enterprise. &lt;br /&gt;&lt;br /&gt;In the Enterprise, there is always the need for integration.  Integration can be defined as the set of practices and procedures that are used for building large systems that consist of other smaller systems that can be called subsystems. &lt;br /&gt;&lt;br /&gt;Having several "isolated" systems in the enterprise cannot be so efficient and can be quite costly both in terms of resources and money, as it increases the administration and maintenance effort. In such cases different professionals deal with each system separately thus making the entire process quite complex as there is always the requirement for collaboration between these systems.Additionally, each system lives in its own world making it difficult to collaborate with other systems.&lt;br /&gt;&lt;br /&gt;It is not random the fact that the majority of large software systems in the market, provide Application Programming Interfaces (APIs) allowing their integration with other systems. Furthermore, along with these APIs, you can also find in the market ready-made API implementations for many of these systems. These implementations can be found under different flavors such as: middleware, web services, source code libraries, etc.&lt;br /&gt;&lt;br /&gt;In the RDBMS world you can often find these API implementations as &lt;i&gt;Data Providers&lt;/i&gt;. To this end, if you are using &lt;i&gt;RDBMS A&lt;/i&gt; you can interconnect it with &lt;i&gt;RDBMS B&lt;/i&gt; via a provider. The significance of Data Providers is huge!&lt;br /&gt;&lt;br /&gt;Some examples of such integrations include: creating a &lt;a href="http://msdn.microsoft.com/en-us/library/ms188279.aspx"&gt;linked server&lt;/a&gt; in SQL Server targeting another RDBMS in order to access the data from within SQL Server, retrieving data from different RDBMSs in &lt;a href="http://aartemiou.blogspot.com/2009/12/introduction-to-sql-server-powerpivot.html"&gt;PowerPivot&lt;/a&gt;, building an &lt;a href="http://technet.microsoft.com/en-us/library/ms141026.aspx"&gt;SSIS &lt;/a&gt;package that retrieves and transforms data from several data sources and so on. &lt;br /&gt;&lt;br /&gt;With Data Providers, you can do many things. Using these API implementations, the system that supports their usage (host) can never be isolated in the Enterprise, as you can always interconnect it with other systems (guest), in our case, other RDBMSs.&lt;br /&gt;&lt;br /&gt;Someone might say: “&lt;i&gt;But why integrating SQL Server with another RDBMS?&lt;/i&gt;” Here’s a simple explanation. Consider the scenario where you host a &lt;a href="http://en.wikipedia.org/wiki/Data_warehouse"&gt;Data Warehouse&lt;/a&gt; in SQL Server. Data warehouses typically contain vast volumes of data in order to be able to perform analysis against this data, that is &lt;a href="http://en.wikipedia.org/wiki/Business_intelligence"&gt;Business Intelligence&lt;/a&gt; (BI).  An Enterprise environment can consist of hundreds of systems. It is highly likely that some of these systems are built on different technologies and their data is organized in different RDBMs than SQL Server. If you want to load this data and perform BI on it using the &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/data-warehousing.aspx"&gt;SQL Server Data Warehouse&lt;/a&gt; engine, how can you achieve that without a set of proper Data Providers? The answer is simple; &lt;i&gt;you cannot do this without a Data Provider&lt;/i&gt;! Without Data Providers you will not be able to retrieve data from other RDBMSs. Of course, in real life, most Enterprise systems have their own Data Providers thus allowing access to other systems via API implementations. These providers are developed by either the vendor that owns the “host” RDBMS or the vendor that owns the “guest” RDBMS or both. Most of the times, Data Providers are developed by all the involved vendors.&lt;br /&gt;&lt;br /&gt;So, a professional with the required knowledge and by using the Data Providers, can always integrate these systems thus allowing the Enterprise’s operations to run on a more efficient way. This professional needs to have a broad range of database skills, not only restricted on a specific RDBMS, but rather have a breadth of knowledge on all the involved RDBMSs. Of course, the professional can always have an expertise on a specific RDBMS and basic knowledge on other RDBMs in order to be able to perform the integration. After all, besides the additional functionality (which is what that actually makes the difference), the standard RDBMS concepts are implemented in most RDBMSs. &amp;nbsp; &lt;br /&gt;&lt;br /&gt;To this end, when evaluating different software systems (and in this case, an RDBMS) that are to be used in an Enterprise environment, it is always vital to ensure that these systems provide API implementations or at least an API that can allow integrating the system with other critical systems within the Enterprise.&lt;br /&gt;&lt;br /&gt;As we move forward, we see that the Enterprises become even more demanding on the efficiency of their Software Systems as these are the backbone that supports the everyday operations of the Enterprise. The lack of collaboration between Software Systems within the Enterprise can negatively affect the everyday operations and that is why it is vital that these systems should interact between them via API implementations.&lt;br /&gt;&lt;br /&gt;That is why &lt;i&gt;&lt;b&gt;Integration is the Key&lt;/b&gt;&lt;/i&gt;! &amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-3122579692267285261?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/3122579692267285261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=3122579692267285261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3122579692267285261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3122579692267285261'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/10/software-systems-in-21st-century.html' title='Software Systems in the 21st Century: Integration is the Key'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-7445737947428008949</id><published>2010-09-25T16:34:00.000+03:00</published><updated>2010-09-25T16:34:10.090+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Categorization of Blog Posts</title><content type='html'>Sometimes I get asked; "Hey Artemis, are you a SQL Server Administrator or a Developer?" I then answer: "none of the two" :)&lt;br /&gt;&lt;br /&gt;I would rather prefer calling myself a Data Architect as I believe it is more accurate. In a relevant &lt;a href="http://aartemiou.blogspot.com/2009/08/dba-or-database-developer.html"&gt;article&lt;/a&gt; I posted a year ago, I talked about the responsibilities of database developers and administrators and how these responsibilities are often interconnected. The key point of that article was that by the time you are professionally involved with Database Systems you cannot only just know one of the two aspects. So, we often meet Database professionals that are administrators with development skills and vice versa.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;If we take a look in &lt;a href="http://en.wikipedia.org/"&gt;Wikipedia&lt;/a&gt;, we can see that the role of a &lt;a href="http://en.wikipedia.org/wiki/Data_architect"&gt;Data Architect&lt;/a&gt; is described as follows: &lt;i&gt;"A data architect is a person responsible for ensuring that the data assets of an organization are supported by an architecture supporting the organization in achieving its strategic goals." &lt;/i&gt;I fully agree.&lt;br /&gt;&lt;br /&gt;As you can see, on my blog I post articles having to do with SQL Server administration, development, SQL, security, Business Intelligence, etc. I don't like restricting my quest for knowledge in just one aspect of SQL Server and that's why I mainly focus on Administration as well as on Development and some other topics.&lt;br /&gt;&lt;br /&gt;Anyways, after this introduction, I would like to mention that I've just finished updating my personal website and guess what; I've added a page for SQL Server there as well! :)&lt;br /&gt;&lt;br /&gt;This page, will be providing a list of most of my blog posts categorized in order for presenting my posts in a more structured way. It will actually be an index for all my articles posted here.&lt;br /&gt;&lt;br /&gt;So, here's the &lt;a href="http://www.aartemiou.com/blog_posts.html"&gt;link&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;Have a nice weekend!&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #990000;"&gt;P.S.&lt;/span&gt; This is my 99th post. I am wondering; what topic should my &lt;b&gt;100th &lt;/b&gt;post be featuring? :)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-7445737947428008949?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/7445737947428008949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=7445737947428008949' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7445737947428008949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7445737947428008949'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/09/categorization-of-blog-posts.html' title='Categorization of Blog Posts'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-2446119330913257915</id><published>2010-09-20T21:57:00.008+03:00</published><updated>2010-09-20T22:04:09.601+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server String Functions'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Eliminating Blank Spaces in SQL Server Tables</title><content type='html'>Blank spaces always needed special handling in many programming languages.&lt;br /&gt;&lt;br /&gt;This is not an exception in the case of the SQL programming language.&lt;br /&gt;&lt;br /&gt;In SQL Server, a variety of built-in &lt;a href="http://aartemiou.blogspot.com/2009/01/commonly-used-string-functions-in-sql.html"&gt;string functions&lt;/a&gt; exist for assisting, among other, the developer to solve data-related problems in the case of undesired blank spaces.&lt;br /&gt;&lt;br /&gt;However, the blank spaces scenarios vary and sometimes it is necessary to use a combination of various built-in string functions for solving the problem.&lt;br /&gt;&lt;br /&gt;For example, consider having one or more columns within a record as the following:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TJerypta1BI/AAAAAAAAAdQ/5qVH3dOgZjY/s1600/BlankSpaces_sc1a.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TJerypta1BI/AAAAAAAAAdQ/5qVH3dOgZjY/s1600/BlankSpaces_sc1a.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;An approach could be the following, using just the REPLACE built-in function like this:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/TJerz_tfeoI/AAAAAAAAAdY/FkkscB-OuUY/s1600/BlankSpaces_sc2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/TJerz_tfeoI/AAAAAAAAAdY/FkkscB-OuUY/s1600/BlankSpaces_sc2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also, you could try this:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TJer1OSwHFI/AAAAAAAAAdg/y7r8Nx0rM9k/s1600/BlankSpaces_sc3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TJer1OSwHFI/AAAAAAAAAdg/y7r8Nx0rM9k/s1600/BlankSpaces_sc3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The above two approaches do not fully solve the problem of the specific blank spaces scenario.&lt;br /&gt;&lt;br /&gt;As you can see, it started getting a little bit tricky regarding how it is possible to efficiently handle the specific blank spaces problem.&lt;br /&gt;&lt;br /&gt;Further below I am suggesting a workaround on how to resolve such issues.&lt;br /&gt;&lt;br /&gt;To this end, first we need to create a sample data set with a column containing blank spaces:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TJer2RUXi2I/AAAAAAAAAdo/busemmrqUS4/s1600/BlankSpaces_sc4.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TJer2RUXi2I/AAAAAAAAAdo/busemmrqUS4/s1600/BlankSpaces_sc4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now let's take a look at the data:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TJer3p8abUI/AAAAAAAAAdw/h4j2sDCK4SY/s1600/BlankSpaces_sc5.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TJer3p8abUI/AAAAAAAAAdw/h4j2sDCK4SY/s320/BlankSpaces_sc5.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, it's time to implement the actual logic for addressing the blank spaces problem.&lt;br /&gt;As it will be too complex to include the logic within a single T-SQL statement, I preferred to create a function because it will be much easier to use it again in the future and the code looks more structured.&lt;br /&gt;&lt;br /&gt;Here's the DDL for my function:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;--&lt;/div&gt;&lt;div style="color: #274e13;"&gt;--Function Name: NoBlankSpaces&lt;/div&gt;&lt;div style="color: #274e13;"&gt;--Purpose: Eliminate blank spaces (up to three words)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;--Author: Artemakis Artemiou&lt;/div&gt;&lt;div style="color: #274e13;"&gt;--Input Parameter: Varchar(250)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;--Output: Varchar(250)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;--&lt;/div&gt;&lt;div style="color: #274e13;"&gt;CREATE FUNCTION [dbo].[NoBlankSpaces]&lt;/div&gt;&lt;div style="color: #274e13;"&gt;(&lt;/div&gt;&lt;div style="color: #274e13;"&gt;@string varchar(250)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;RETURNS varchar(250)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;AS&lt;/div&gt;&lt;div style="color: #274e13;"&gt;BEGIN&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;declare @part1 as varchar(100)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;declare @part2 as varchar(100)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;declare @part3 as varchar(100)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;declare @part4 as varchar(100)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;declare @temp as varchar(100)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;set @part1=(rtrim(substring(@string,0,(charindex('   ',ltrim(@string))))))&lt;/div&gt;&lt;div style="color: #274e13;"&gt;set @temp=ltrim(substring(@string,(charindex('   ',@string)),len(@string)+1))&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;set @part2=SUBSTRING(@temp,0,CHARINDEX('   ',@temp))&lt;/div&gt;&lt;div style="color: #274e13;"&gt;set @temp=SUBSTRING(@temp,0,250)&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;set @part3=ltrim(SUBSTRING(@temp,CHARINDEX('   ',@temp),250))&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;set @string=rtrim(ltrim(@part1+' '+@part2+' '+@part3))&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;RETURN @string&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;END&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;GO&lt;/div&gt;&lt;div style="color: #274e13;"&gt;-------------End of Function DDL-----------------&lt;/div&gt;&lt;br /&gt;As you can see in the above DDL code, I am using a combination of the &lt;b&gt;SUBSTRING&lt;/b&gt;, &lt;b&gt;LTRIM&lt;/b&gt;, &lt;b&gt;RTRIM&lt;/b&gt; and the &lt;b&gt;CHARINDEX &lt;/b&gt;SQL Server built-in string functions for achieving my goal.&lt;br /&gt;&lt;br /&gt;Now, let's use the function and see what the outcome will be:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/TJer5HNXEYI/AAAAAAAAAd4/3tB-QjnnGGg/s1600/BlankSpaces_sc6.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/TJer5HNXEYI/AAAAAAAAAd4/3tB-QjnnGGg/s1600/BlankSpaces_sc6.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cool! No more blank spaces! :)&lt;br /&gt;&lt;br /&gt;The combination of the SQL Server built-in functions worked great towards the solution of the blank spaces issue. &lt;br /&gt;&lt;br /&gt;You can download the code I used for this example from &lt;a href="http://cid-f7a5cb9a0405dcb5.office.live.com/self.aspx/.Public/Source%20Code%20Samples/Blank%20Spaces%20Blog%20Post/BlankSpacesPost%5E_SampleCode.sql"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I hope you found this post useful.&lt;br /&gt;&lt;br /&gt;Drop me a line if you have any questions or comments!&lt;br /&gt;&lt;br /&gt;Cheers!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-2446119330913257915?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/2446119330913257915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=2446119330913257915' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2446119330913257915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2446119330913257915'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/09/eliminating-blank-spaces-in-sql-server.html' title='Eliminating Blank Spaces in SQL Server Tables'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_tEowgAvs-mQ/TJerypta1BI/AAAAAAAAAdQ/5qVH3dOgZjY/s72-c/BlankSpaces_sc1a.png' height='72' width='72'/><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-2756711626134236801</id><published>2010-09-08T21:40:00.003+03:00</published><updated>2010-09-08T21:44:57.911+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><title type='text'>Security Changes in SQL Server 2008</title><content type='html'>SQL Server 2008, among other introduced significant security changes that enhance the database administrators applying an even stricter security policy on the SQL Server instances.&lt;br /&gt;&lt;br /&gt;Besides the changes in the Windows local groups that are created during the SQL Server setup process, the changes in surface control tools where now you can use the &lt;a href="http://aartemiou.blogspot.com/2010/04/policy-based-management-in-sql-server.html"&gt;Policy-Based Management&lt;/a&gt; feature that is much more powerful than the Surface Area Configuration tool, and the Kerberos support for named pipes and shared memory protocols, the change that has a strong effect on the way that many of us used to work, is that the local Windows Group &lt;b&gt;BUILTIN\Administrator&lt;/b&gt; is no longer by default included in the SQL Server sysadmin fixed server role on new SQL Server 2008 and R2 installations.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;So, what does this mean? It means that if you try to access a SQL Server 2008 (or later) instance using a local administrator user account without explicitly granting him the sysadmin server role on the instance, you will not be able to have administrative rights on the instance. Actually, if this user has not any permissions on the specific instance, he will not be able to access the instance at all!&lt;br /&gt;&lt;br /&gt;Someone might say that this makes things more complicated but the truth is that it does not. It is an excellent security enhancement that actually separates Windows administrator accounts from SQL Server administrators.&lt;br /&gt;&lt;br /&gt;And by the way be careful when you install and perform the initial setup of a SQL Server 2008 (or later) instance because if you don’t include at least one user in the sysadmin role, you will be locked out of that instance :)&lt;br /&gt;&lt;br /&gt;For more information on the security changes in SQL Server 2008 and SQL Server 2008 R2 you can visit &lt;a href="http://msdn.microsoft.com/en-us/library/cc280562.aspx"&gt;this&lt;/a&gt; MSDN Library &lt;a href="http://msdn.microsoft.com/en-us/library/cc280562.aspx"&gt;article&lt;/a&gt;. Make sure that you read it before configuring the security of your new SQL Server instance!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-2756711626134236801?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/2756711626134236801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=2756711626134236801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2756711626134236801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2756711626134236801'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/09/security-changes-in-sql-server-2008.html' title='Security Changes in SQL Server 2008'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-1372725567377170923</id><published>2010-08-23T21:44:00.002+03:00</published><updated>2010-08-23T21:45:39.766+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='INETA'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>DevReach 2010!</title><content type='html'>&lt;a href="http://www.devreach.com/"&gt;DevReach 2010&lt;/a&gt;, the premier developer conference on Microsoft technologies in Central and Eastern Europe will be taking place on &lt;b&gt;October 18&lt;/b&gt; and &lt;b&gt;19&lt;/b&gt; in &lt;b&gt;Sofia, Bulgaria&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;This year, DevReach celebrates its &lt;b&gt;fifth anniversary&lt;/b&gt;. To this end it has a new fifth track!&lt;br /&gt;The event includes &lt;b&gt;60 &lt;/b&gt;unique sessions with more than &lt;b&gt;30 &lt;/b&gt;rock star speakers!&lt;br /&gt;&lt;br /&gt;DevReach 2010 features a wide variery of topics such as:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Web development (HTML 5 in ASP.NET)&lt;/li&gt;&lt;li&gt;Windows Workflow &lt;/li&gt;&lt;li&gt;jQuery, Visual Studio 2010 and ASP.NET&lt;/li&gt;&lt;li&gt;SQL Server 2008 R2 development&lt;/li&gt;&lt;li&gt;Agile development methodologies&lt;/li&gt;&lt;li&gt;Silverlight 4.0&lt;/li&gt;&lt;li&gt;Sharepoint 2010&amp;nbsp;&lt;/li&gt;&lt;li&gt;Windows Phone 7 Series development&lt;/li&gt;&lt;li&gt;... and much more!&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The full list of topics can be found &lt;a href="http://www.devreach.com/Event/Sessions.aspx"&gt;here&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Some highlights of the event include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Exclusive keynote from &lt;a href="http://devreach.com/Event/Speakers.aspx#ScottStanfield"&gt;Scott Stanfield&lt;/a&gt; (CEO Vertigo Software), &lt;a href="http://devreach.com/Event/Speakers.aspx#RichardCampbell"&gt;Richard Campbell&lt;/a&gt; (.NET Rocks! and RunAs Radio) and &lt;a href="http://devreach.com/Event/Speakers.aspx#BethMassi"&gt;Beth Massi&lt;/a&gt; (Senior Program Manager Visual Studio Team).&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.devreach.com/AttendingDevReach/Pricing.aspx"&gt;Early Bird 20% discount&lt;/a&gt; is available until 15 Sept. All Early Bird attendees enter drawing for XBOX 360.&lt;/li&gt;&lt;li&gt;All MVPs and INETA UG members receive special discount. Register through the MVP or UG lead.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.devreach.com/AttendingDevReach/Pricing.aspx"&gt;The VIP pass&lt;/a&gt; gives you access to all video recordings and exclusive party with all speakers! &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;To see how #DevReach 2009 looked like you can visit this &lt;a href="http://bit.ly/aSYqPX"&gt;link&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Additionally, On &lt;b&gt;September 9&lt;/b&gt;, 2010, &lt;a href="http://www.devreach.com/Event/devreach-online.aspx"&gt;DevReach 2010 Online&lt;/a&gt;, a FREE online event will be taking place with speakers from DevReach 2010.&lt;br /&gt;&lt;br /&gt;You can join &lt;a href="http://www.facebook.com/DevReach"&gt;DevReach Facebook page&lt;/a&gt; and &lt;a href="http://twitter.com/devreach"&gt;follow DevReach&lt;/a&gt; on Twitter and get the chance to win a free pass!&lt;br /&gt;&lt;br /&gt;So if you have the chance to attend the event, you will sure be able to deepen your knowledge on the latest Microsoft technologies and learn many new ways of being more productive with less effort when it comes to software development!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-1372725567377170923?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/1372725567377170923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=1372725567377170923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1372725567377170923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1372725567377170923'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/08/devreach-2010.html' title='DevReach 2010!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-7068449180761370365</id><published>2010-08-04T22:03:00.001+03:00</published><updated>2010-08-04T22:08:41.004+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2000'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Changing the Database Owner in a SQL Server Database</title><content type='html'>In SQL Server 2000, the &lt;b&gt;dbo &lt;/b&gt;(Database Owner) is a special user that has all the necessary permissions to perform all activities in the database. This user exists in all SQL Server databases.&lt;br /&gt;&lt;br /&gt;Usually, there are SQL Server or Windows logins mapped to the dbo user, thus "inheriting" the permissions of the database's dbo user and being able to perform all the activities in the database that the dbo user can perform.&lt;br /&gt;&lt;br /&gt;In some cases, due to various changes a DBA might perform in SQL Server, you may discover that the dbo user is orphaned, meaning that there is not any login mapped to this user.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;If you would like to change this, thus mapping a login to the dbo user you can make use of the "&lt;b&gt;sp_changedbowner&lt;/b&gt;" system stored procedure.&lt;br /&gt;&lt;br /&gt;The syntax as provided in the T-SQL &lt;a href="http://msdn.microsoft.com/en-us/library/aa259622%28SQL.80%29.aspx"&gt;reference library&lt;/a&gt; is the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;sp_changedbowner [ @loginame= ] 'login'&lt;/div&gt;&lt;div style="color: #274e13;"&gt;[ , [ @map= ] remap_alias_flag ]&lt;/div&gt;&lt;br /&gt;For example, if you want to make the SQL Server Login '&lt;b&gt;Tom&lt;/b&gt;' the owner of the database "&lt;b&gt;TestDB&lt;/b&gt;" you can use the following T-SQL script:&lt;br /&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;USE TestDB&lt;/div&gt;&lt;div style="color: #274e13;"&gt;GO&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;EXEC sp_changedbowner 'Tom'&lt;/div&gt;&lt;div style="color: #274e13;"&gt;GO&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;/div&gt;&lt;br /&gt;Additionally, if you want to make a Windows Login, for example '&lt;b&gt;SampleDomain\TestUser&lt;/b&gt;' the owner of the database "&lt;b&gt;TestDB&lt;/b&gt;" you can use the following T-SQL script:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;USE TestDB&lt;/div&gt;&lt;div style="color: #274e13;"&gt;GO&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;EXEC sp_changedbowner 'SampleDomain\TestUser'&lt;/div&gt;&lt;div style="color: #274e13;"&gt;GO&lt;/div&gt;&lt;br /&gt;Please also note that only members of the &lt;b&gt;sysadmin&lt;/b&gt; fixed server role can execute the stored procedure sp_changedbowner.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In SQL Server 2005 or later, you can make use of the "&lt;a href="http://technet.microsoft.com/en-us/library/ms187359.aspx"&gt;ALTER AUTHORIZATION&lt;/a&gt;" command as sp_changedbowner will be removed in a future version of SQL Server.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-7068449180761370365?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/7068449180761370365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=7068449180761370365' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7068449180761370365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7068449180761370365'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/08/changing-database-owner-in-sql-server.html' title='Changing the Database Owner in a SQL Server Database'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-2180498483593973734</id><published>2010-07-31T00:16:00.005+03:00</published><updated>2010-07-31T00:35:54.098+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='Event Reviews'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='INETA'/><category scheme='http://www.blogger.com/atom/ns#' term='CDNUG'/><title type='text'>CDNUG Event Review - July 15, 2010 - Windows 7 Development / SQL Server 2008 R2</title><content type='html'>A great &lt;a href="http://www.cdnug.net/"&gt;CDNUG &lt;/a&gt;event took place on July 15, 2010! As it was the last event before summer holidays, it was a celebratory one of course!&lt;br /&gt;&lt;br /&gt;After having some sweets and Greek frappé coffee, the event started!&lt;br /&gt;&lt;br /&gt;Due to the nature of this event, we had two sessions. The first session, dedicated to &lt;a href="http://www.microsoft.com/windows/windows-7/default.aspx"&gt;Windows 7&lt;/a&gt; Development was presented by my good friend and CDNUG member Ioannis Stavrinides (MCP, MCTS) - (&lt;a href="http://dnetexperience.blogspot.com/"&gt;Blog&lt;/a&gt;, &lt;a href="http://twitter.com/indigocy"&gt;Twitter&lt;/a&gt;). The second session was presented by me and it was dedicated to &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/r2.aspx"&gt;SQL Server 2008 R2&lt;/a&gt;, where I introduced the main features shipped with this release both for Developers and IT Pros.&lt;br /&gt;&lt;br /&gt;Ioannis started his presentation by first introducing to us WPF. Then he showed with many live demos how developers can use WPF and the Windows API Code Pack for Microsoft .NET Framework through Visual Studio 2010, thus being able to build Jump Lists, Progress Bars, Tabbed Thumbnails and Tabbed Toolbars. Also, we saw how we can make use of the Icon Overlay feature.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Right after Ioannis's great session, my session started taking place. During my session I talked about some of the amazing new features shipped with SQL Server 2008 R2.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Main Features&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Database Engine - Manageability Enhancements&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Connectivity to SQL Azure.&lt;/li&gt;&lt;li&gt;Data-tier Application Upgrade.&lt;/li&gt;&lt;li&gt;SQL Server Utility.&lt;/li&gt;&lt;li&gt;The VIA protocol has been deprecated.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Service Broker&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Option to turn on and off poison message handling on a queue.&lt;/li&gt;&lt;li&gt;A queue that has poison message turned off will not be disabled after consecutive transaction rollbacks.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Master Data Services&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The technology, tools, and processes required to create and maintain consistent and accurate lists of master data. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;StreamInsight&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A powerful platform that you can use to develop and deploy complex event processing (CEP) applications. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Reporting Services - Features&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;“Grab and Go” reporting experience enabled through the Report Part Gallery.&lt;/li&gt;&lt;li&gt;Support for maps and geospatial visualizations with integration to Bing maps and support for SQL spatial data types.&lt;/li&gt;&lt;li&gt;Additional visualizations including indicators, sparklines and data bars.&lt;/li&gt;&lt;li&gt;Support for consuming SharePoint lists and PowerPivot models as data sources.&lt;/li&gt;&lt;li&gt;Support for Madison and SQL Azure data sources.&lt;/li&gt;&lt;li&gt;Render any report as a data source to PowerPivot or other applications through ATOM data feeds.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Report Builder 3 &lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Integration with Bing maps.&lt;/li&gt;&lt;li&gt;...and much more! &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;SQL Server PowerPivot&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An Add-on for Excel 2010 / SharePoint 2010.&lt;/li&gt;&lt;li&gt;Brings the full power of SQL Server Analysis Services right into Excel.&lt;/li&gt;&lt;li&gt;In-memory column based compression.&lt;/li&gt;&lt;li&gt;Millions of rows of data can now be stored, sorted &amp;amp; aggregated.&lt;/li&gt;&lt;li&gt;Support for a wide variety of sources.&lt;/li&gt;&lt;li&gt;Rich set of mathematical functionality.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Existing functions already in Excel&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&lt;/li&gt;&lt;li&gt;Data Analysis eXpressions (DAX)&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;Along with the presentation I performed many demos, showing live how developers / IT Pros can take advantage of these new features and be more productive with even less effort. Some of the live demos included SQL Server Utility Explorer, Data-Tier Applications design and deployment, Master Data Services, and of course, the series of demos could not be considered as completed without showing a live demo of SQL Server PowerPivot!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;PowerPoint Presentation&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;Please find below my PowerPoint presentation for this session:&lt;br /&gt;&lt;br /&gt;&lt;div style="width:425px" id="__ss_4875008"&gt;&lt;strong style="display:block;margin:12px 0 4px"&gt;&lt;a href="http://www.slideshare.net/artemakis/sql-server-2008-r2-features-for-developers-and-it-pros" title="SQL Server 2008 R2: Features for Developers and IT Pros"&gt;SQL Server 2008 R2: Features for Developers and IT Pros&lt;/a&gt;&lt;/strong&gt;&lt;object id="__sse4875008" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sqlserver2008r2-featuresfordevelopersanditpros-100730155318-phpapp01&amp;stripped_title=sql-server-2008-r2-features-for-developers-and-it-pros" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse4875008" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sqlserver2008r2-featuresfordevelopersanditpros-100730155318-phpapp01&amp;stripped_title=sql-server-2008-r2-features-for-developers-and-it-pros" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="padding:5px 0 12px"&gt;View more &lt;a href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/artemakis"&gt;artemakis&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;The event was a success and we really enjoyed it!&lt;br /&gt;&lt;br /&gt;See you at another event soon!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-2180498483593973734?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/2180498483593973734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=2180498483593973734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2180498483593973734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2180498483593973734'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/07/cdnug-event-review-july-15-2010-windows.html' title='CDNUG Event Review - July 15, 2010 - Windows 7 Development / SQL Server 2008 R2'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-2630558799170570044</id><published>2010-06-23T17:38:00.002+03:00</published><updated>2010-06-23T17:48:51.927+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Access'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='BI'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='PowerPivot'/><title type='text'>Data Access and Consumption with WCF Data Services and PowerPivot</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;It’s been a while since my last post but I’ve changed job a few weeks ago and I was in the process of adapting to the new environment :)&lt;br /&gt;&lt;br /&gt;OK! It is time to sit back, relax a bit, have a cold beer, put some music on, and start writing! &lt;br /&gt;&lt;br /&gt;A few weeks ago the number of visits on my blog exceeded the number of 50.000! So I decided to write a rather big article with a “celebratory” flavour :)&lt;br /&gt;&lt;br /&gt;Though, before proceeding with the article, I would like to say a huge &lt;b&gt;thank you&lt;/b&gt; to the SQL Server community and to each of you for supporting my efforts by visiting my blog, reading and referencing my articles, and commenting my posts. &lt;br /&gt;&lt;br /&gt;As &lt;a href="http://en.wikipedia.org/wiki/Data_access"&gt;Data Access&lt;/a&gt; and &lt;a href="http://www.powerpivot.com/"&gt;PowerPivot &lt;/a&gt;are my favourite topics, in this article I will talk about a combination of two great technologies; WCF Data Services and PowerPivot.&lt;br /&gt;&lt;br /&gt;To this end I am going to build a WCF Data Service that will be exposing data from a &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/r2.aspx"&gt;SQL Server 2008 R2&lt;/a&gt; database as an &lt;a href="http://en.wikipedia.org/wiki/RSS"&gt;RSS feed&lt;/a&gt;, then consume the data using PowerPivot and see how the data in PowerPivot is updated when the RSS feed is updated too.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Let’s begin by taking a look at the database schema that is used for this post:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITFZBbksI/AAAAAAAAAaY/CntUaPa3pEo/s1600/wcf_pv_1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="296" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITFZBbksI/AAAAAAAAAaY/CntUaPa3pEo/s400/wcf_pv_1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now let’s start building that WCF Data Service!&lt;br /&gt;&lt;br /&gt;We launch Visual Studio 2010 and we start building an ASP.NET Web Application:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITH5TAVJI/AAAAAAAAAag/ILJ2f30GEaE/s1600/wcf_pv_2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="276" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITH5TAVJI/AAAAAAAAAag/ILJ2f30GEaE/s400/wcf_pv_2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We then add a new item to our solution of the type "ADO.NET Entity Data Model":&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITJk4xHJI/AAAAAAAAAao/J8QNeuIP8IY/s1600/wcf_pv_3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="442" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITJk4xHJI/AAAAAAAAAao/J8QNeuIP8IY/s640/wcf_pv_3.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We choose to generate the data model directly from the database:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITLNLfIiI/AAAAAAAAAaw/v2SmonJkEo4/s1600/wcf_pv_4.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="356" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITLNLfIiI/AAAAAAAAAaw/v2SmonJkEo4/s400/wcf_pv_4.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We set up the data connection:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITMZQm45I/AAAAAAAAAa4/RydXtrb_St8/s1600/wcf_pv_5.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITMZQm45I/AAAAAAAAAa4/RydXtrb_St8/s400/wcf_pv_5.png" width="273" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITNsFzUfI/AAAAAAAAAbA/aix62sdsQ6Y/s1600/wcf_pv_6.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="356" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITNsFzUfI/AAAAAAAAAbA/aix62sdsQ6Y/s400/wcf_pv_6.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We then select the database objects to be included in the data model that will be generated:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITO7ImMQI/AAAAAAAAAbI/bEyoks-TCXE/s1600/wcf_pv_7.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="356" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITO7ImMQI/AAAAAAAAAbI/bEyoks-TCXE/s400/wcf_pv_7.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The data model is ready:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/TCITQGEO3GI/AAAAAAAAAbQ/3ETRu4oQ9x0/s1600/wcf_pv_8.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="192" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/TCITQGEO3GI/AAAAAAAAAbQ/3ETRu4oQ9x0/s400/wcf_pv_8.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We then add another new item to the solution of the type "WCF Data Service":&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITSGrB23I/AAAAAAAAAbY/Rn0m7sjl4Eo/s1600/wcf_pv_9.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="276" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITSGrB23I/AAAAAAAAAbY/Rn0m7sjl4Eo/s400/wcf_pv_9.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We also modify the source code as follows (this is only for demo purposes, in real-life you should be careful with the level of access you provide to your data):&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITT6sxr-I/AAAAAAAAAbg/eUjzaAY0R18/s1600/wcf_pv_10.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="208" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITT6sxr-I/AAAAAAAAAbg/eUjzaAY0R18/s400/wcf_pv_10.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Well, that’s it! We run the solution and this is what we get in Internet Explorer:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITVzgd0qI/AAAAAAAAAbo/-gwCuS3C3AE/s1600/wcf_pv_11.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITVzgd0qI/AAAAAAAAAbo/-gwCuS3C3AE/s400/wcf_pv_11.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The data is exposed as an RSS feed!&lt;br /&gt;The data service is now ready.&lt;br /&gt;&lt;br /&gt;We copy the URL to the clipboard:&lt;br /&gt;&lt;b&gt;http://localhost:1336/dataService.svc/&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now, for consuming the data service we are going to use PowerPivot.&lt;br /&gt;&lt;br /&gt;We launch Excel 2010, and then the PowerPivot dialog. We then click on the “&lt;b&gt;From Data Feeds&lt;/b&gt;” button on the ribbon and we use as the Data Feed URL the URL we earlier copied to the clipboard (that is the URL for the Data Service):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITZhmmsSI/AAAAAAAAAbw/ccZ58fBarBY/s1600/wcf_pv_12.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITZhmmsSI/AAAAAAAAAbw/ccZ58fBarBY/s400/wcf_pv_12.png" width="391" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We test the connection and we see that everything works well; our RSS Feed is up and running:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITbb-qtPI/AAAAAAAAAb4/rmJgWV9ppjQ/s1600/wcf_pv_13.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITbb-qtPI/AAAAAAAAAb4/rmJgWV9ppjQ/s400/wcf_pv_13.png" width="392" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We click on “&lt;b&gt;Next&lt;/b&gt;” and we then select the tables to be imported:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITc5jK60I/AAAAAAAAAcA/zhHU9E5nslk/s1600/wcf_pv_14.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITc5jK60I/AAAAAAAAAcA/zhHU9E5nslk/s400/wcf_pv_14.png" width="391" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We click on “&lt;b&gt;Finish&lt;/b&gt;” and we see that all the records were imported successfully:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITe_GdYmI/AAAAAAAAAcI/zSesXxQqMxM/s1600/wcf_pv_15.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITe_GdYmI/AAAAAAAAAcI/zSesXxQqMxM/s400/wcf_pv_15.png" width="391" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We then click on “&lt;b&gt;PivotTable&lt;/b&gt;” on the ribbon and we select to build a “Chart and a table (vertical)":&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCIXQlUf6gI/AAAAAAAAAdA/EFxXxdYo6D0/s1600/wcf_pv_16_updated.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCIXQlUf6gI/AAAAAAAAAdA/EFxXxdYo6D0/s320/wcf_pv_16_updated.png" width="289" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And this is what we get after visually building a simple query in the Excel Workbook using PowerPivot:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITkqwWIOI/AAAAAAAAAcY/vh2YOVmPsv4/s1600/wcf_pv_17.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITkqwWIOI/AAAAAAAAAcY/vh2YOVmPsv4/s400/wcf_pv_17.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now here comes the fun part. I am going to modify the contents of the “&lt;b&gt;Customers&lt;/b&gt;” table so that most of the customers have as location the value “&lt;b&gt;NIC&lt;/b&gt;” (yes, this stands for Nicosia :).&lt;br /&gt;&lt;br /&gt;So 16 out of the 20 customers will now have “NIC” set as their location and each of the rest of the customers will have a different, unique location. After the data modification this is what we get in SSMS:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITm-6wQoI/AAAAAAAAAcg/C4H6zDY8pss/s1600/wcf_pv_18.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCITm-6wQoI/AAAAAAAAAcg/C4H6zDY8pss/s400/wcf_pv_18.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But how are these data modifications reflected in PowerPivot? It is actually very easy. We just enter into the PowerPivot dialog again and click on the “&lt;b&gt;Refresh&lt;/b&gt;” button:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCIToreN29I/AAAAAAAAAco/RbycNUDRd8o/s1600/wcf_pv_19.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/TCIToreN29I/AAAAAAAAAco/RbycNUDRd8o/s400/wcf_pv_19.png" width="377" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then back in our Excel Workbook, we perform again the aggregation and we see that the chart is also updated:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITrE5NAyI/AAAAAAAAAcw/AJd5iqU0jsE/s1600/wcf_pv_20.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITrE5NAyI/AAAAAAAAAcw/AJd5iqU0jsE/s400/wcf_pv_20.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITse-oBRI/AAAAAAAAAc4/guKYChe44Cc/s1600/wcf_pv_21.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/TCITse-oBRI/AAAAAAAAAc4/guKYChe44Cc/s400/wcf_pv_21.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What exactly happened when we clicked on the “Refresh” button was that PowerPivot communicated with the database in SQL Server via the RSS feed and tracked that the data contained in the “Customers” table was modified. To this end, it re-imported this data into the workbook. This is quite cool, isn’t it :)&lt;br /&gt;&lt;br /&gt;Summing up, in this post we saw how we can build a simple WCF Data Service for exposing data via an RSS Feed, how can this data be imported into PowerPivot, and how can PowerPivot track any data changes thus reflecting them on its charts.&lt;br /&gt;&lt;br /&gt;Until next time!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-2630558799170570044?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/2630558799170570044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=2630558799170570044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2630558799170570044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2630558799170570044'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/06/data-access-and-consumption-with-wcf.html' title='Data Access and Consumption with WCF Data Services and PowerPivot'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_tEowgAvs-mQ/TCITFZBbksI/AAAAAAAAAaY/CntUaPa3pEo/s72-c/wcf_pv_1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-3129234962499503938</id><published>2010-05-07T15:44:00.007+03:00</published><updated>2010-05-07T16:20:44.607+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Product Reviews'/><category scheme='http://www.blogger.com/atom/ns#' term='Red Gate'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Product Review: SQL Search - Searching for SQL Text Within SQL Server DB Objects</title><content type='html'>Some time ago &lt;a href="http://www.red-gate.com/"&gt;Red Gate&lt;/a&gt; released &lt;a href="http://www.red-gate.com/products/SQL_Search/index.htm"&gt;SQL Search&lt;/a&gt;, a SSMS add-in that allows the user to search for fragments of text within database objects in a SQL Server instance! Yes, I know, this is cool! :)&lt;br /&gt;&lt;br /&gt;There are many scenarios where the tool can come in handy. For example, imagine trying to perform a modification in a table and there is a view using the "&lt;b&gt;WITH SCHEMABINDING&lt;/b&gt;" option which binds the view to the schema of the specific table. So, in order to be able to perform the table schema modification you will first need to either modify or delete the view. So what can you do for finding any views, functions or any other objects that reference the table? You can search for such database objects referencing the table name in their definition.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Below I am presenting some screenshots illustrating the usage of the tool.&lt;br /&gt;&lt;br /&gt;After installing SQL Search and starting SQL Server Management Studio, you will notice that there is a new add-in added:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S-QGpBgpPII/AAAAAAAAAZI/2m6y2Wgf8yI/s1600/SQLS_sc1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S-QGpBgpPII/AAAAAAAAAZI/2m6y2Wgf8yI/s400/SQLS_sc1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When clicking on the SQL Search add-in you are presented with the following screen:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S-QGuahwyFI/AAAAAAAAAZQ/BLOnAe9oOfU/s1600/SQLS_sc2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S-QGuahwyFI/AAAAAAAAAZQ/BLOnAe9oOfU/s400/SQLS_sc2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;The following screenshot explains the main controls of the tool:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S-QG1mCELmI/AAAAAAAAAZY/CUCSoWu-7Bs/s1600/SQLS_sc3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S-QG1mCELmI/AAAAAAAAAZY/CUCSoWu-7Bs/s400/SQLS_sc3.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For this example, I typed the text "&lt;b&gt;customer&lt;/b&gt;" and searched for all the database objects, in all the databases within the instance that reference it. To this end I was presented with the following screen:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S-QG6Wlwj9I/AAAAAAAAAZg/U1PnnAj5em8/s1600/SQLS_sc4.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S-QG6Wlwj9I/AAAAAAAAAZg/U1PnnAj5em8/s400/SQLS_sc4.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When clicking on a programmability item, i.e. a stored procedure, you are also presented with a preview of its T-SQL code that among other references the database objects having the provided text fragment:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/S-QHAJR0e-I/AAAAAAAAAZo/xWeLbQKQHjk/s1600/SQLS_sc5.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/S-QHAJR0e-I/AAAAAAAAAZo/xWeLbQKQHjk/s400/SQLS_sc5.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then, by double-clicking on the item, or by clicking on the "&lt;b&gt;Select object in Object Explorer&lt;/b&gt;" hyperlink, you are able to access the object via SSMS Object Explorer:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S-QSpuxzWnI/AAAAAAAAAZ4/UaOp2AzIyYM/s1600/SQLS_sc6.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S-QSpuxzWnI/AAAAAAAAAZ4/UaOp2AzIyYM/s400/SQLS_sc6.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Another important thing is that the tool is &lt;b&gt;free&lt;/b&gt; and you can download it from &lt;a href="http://www.red-gate.com/download/sqlsearchdownload"&gt;here &lt;/a&gt;:)&lt;br /&gt;&lt;br /&gt;I hope you found this product review useful!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-3129234962499503938?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/3129234962499503938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=3129234962499503938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3129234962499503938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3129234962499503938'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/05/product-review-sql-search-searching-for.html' title='Product Review: SQL Search - Searching for SQL Text Within SQL Server DB Objects'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_tEowgAvs-mQ/S-QGpBgpPII/AAAAAAAAAZI/2m6y2Wgf8yI/s72-c/SQLS_sc1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-7293117720569964957</id><published>2010-04-27T15:21:00.004+03:00</published><updated>2010-04-27T15:40:15.812+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Policy-Based Management in SQL Server 2008</title><content type='html'>Some time ago I promissed publishing a post on Policy-Based Management feature in SQL Server 2008. Well, it's time to fulfil my promise! :) This is a rather large post, I hope you find the information it contains useful!&lt;br /&gt;&lt;br /&gt;Policy-Based Management is indeed one of the greatest administration features in SQL Server 2008. With this feature you can easily manage one or more instances of SQL Server!&lt;br /&gt;&lt;br /&gt;The main concept in Policy-Based Management, is that Policy Administrators can set up policies that are evaluated upon certain events within the scope of the monitored SQL Server instance(s). After setting up the policies, based on certain scenarios, the policies are evaluated and specific actions are automatically performed as set up in the active Policies. &lt;br /&gt;&lt;br /&gt;To this end, there are four evaluation modes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;On demand - This mode evaluates the policies when explicitly requested by the user. &lt;/li&gt;&lt;li&gt;On change: prevent - This mode uses DDL triggers in order to prevent Policy violations.&lt;/li&gt;&lt;li&gt;On change: log only - This mode allows Policy violations but it logs each violation using event notification. It logs the violations to the SQL Server logs and Windows Application logs.&lt;/li&gt;&lt;li&gt;On schedule - This mode allows the user to schedule (using a SQL Agent job) when the policies will be evaluated.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Let’s get a first look and feel at the Policy-Based Management set up dialogs in SSMS. In the following screenshot you can see the Policy Management module in the Object Explorer in SSMS:&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/S9bPUHRWodI/AAAAAAAAAZA/PIz8fx-YPW0/s1600/PBM_sc1.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/S9bPUHRWodI/AAAAAAAAAZA/PIz8fx-YPW0/s400/PBM_sc1.png" tt="true" width="252" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;When right-clicking on Policies you can create a new Policy.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;When right-clicking on Conditions you can create a new condition and then assign it to an existing or a new Policy.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The Facets is a collection of SQL Server objects that allow you to set up conditions and policies against their properties. By right-clicking on a Facet you can create a condition or a Policy.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;Note that the Policy Management module falls under Management as its scope is for the entire SQL Server instance. Of course, via the Policies you create, you can evaluate multiple SQL Server instances, certain databases, even certain database objects! &lt;br /&gt;&lt;br /&gt;OK! Now let's proceed with an example, showing how we can set up policies based on the abovementioned evaluation modes. For this post, I will be using the "AdventureWorks2008" sample database.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;On demand&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;We right-click on Policies and we select New Policy. We are presented with the following dialog where we provide a name for the Policy and then we either select the check condition or we create a new one. In this case we will be creating a new condition:&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S9bPS4thpeI/AAAAAAAAAY4/CcK4J5v3dwg/s1600/PBM_sc2.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="341" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S9bPS4thpeI/AAAAAAAAAY4/CcK4J5v3dwg/s400/PBM_sc2.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The next screenshot shows the newly created condition:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S9bPRSYMkvI/AAAAAAAAAYw/irh6hbERl5s/s1600/PBM_sc3.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="288" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S9bPRSYMkvI/AAAAAAAAAYw/irh6hbERl5s/s400/PBM_sc3.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;For creating a new condition, you must provide a name, select the Facet (in this example) the &lt;strong&gt;Stored Procedure&lt;/strong&gt;, and set the expressions for evaluating the properties you like. In this case we want the condition to track all the stored procedures that their names &lt;strong&gt;start&lt;/strong&gt; with &lt;strong&gt;'sp_'&lt;/strong&gt;.&lt;/div&gt;&lt;br /&gt;We click on the &lt;strong&gt;OK&lt;/strong&gt; button and we are returned to the Policy:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S9bPP5Uwc_I/AAAAAAAAAYo/SMLcGHQ8cms/s1600/PBM_sc4.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="342" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S9bPP5Uwc_I/AAAAAAAAAYo/SMLcGHQ8cms/s400/PBM_sc4.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;You can see that the Policy now contains the "&lt;strong&gt;SPNames"&lt;/strong&gt; condition we created in the previous step. Also, I set up the Evaluation Mode to "&lt;strong&gt;On Demand"&lt;/strong&gt;. Though, this type of condition allows you to select any Evaluation Mode. &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The available Evaluation Modes are dependent on the type of the condition. For example there are conditions for which a DDL trigger cannot be executed so the &lt;strong&gt;“On change: prevent”&lt;/strong&gt; mode cannot be selected in such case, etc. &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;Also, in the &lt;strong&gt;“Against targets”&lt;/strong&gt; list you can target specific databases against which the condition will be evaluated. Additionally, in the &lt;strong&gt;“Server restriction”&lt;/strong&gt; you can select against which SQL Server instances the condition will be executed. &lt;strong&gt;Remember&lt;/strong&gt;: Policy-Based Management allows managing multiple instances of SQL Server!&lt;br /&gt;&lt;br /&gt;Now, let’s set the Policy to only evaluate the &lt;strong&gt;“AdventureWorks2008”&lt;/strong&gt; database by clicking on the “In &lt;strong&gt;Every&lt;/strong&gt; - Database” list item. Here’s the new condition for restricting the Policy’s evaluation on the specific database:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/S9bPOpGkAZI/AAAAAAAAAYg/8vDIAt5_aOw/s1600/PBM_sc5.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="288" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/S9bPOpGkAZI/AAAAAAAAAYg/8vDIAt5_aOw/s400/PBM_sc5.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;We click on &lt;strong&gt;OK&lt;/strong&gt; and we are returned back to the Policy properties dialog:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S9bPNHGr_4I/AAAAAAAAAYY/QOOFQC-P7e0/s1600/PBM_sc6.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="342" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S9bPNHGr_4I/AAAAAAAAAYY/QOOFQC-P7e0/s400/PBM_sc6.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I will not add a condition for the &lt;strong&gt;Server restriction&lt;/strong&gt; as I am only using a single SQL Server instance for this post.&lt;/div&gt;&lt;br /&gt;That’s it! We click on &lt;strong&gt;OK&lt;/strong&gt; and the Policy is ready! As this Policy’s Evaluation Mode has been set to “&lt;strong&gt;On demand&lt;/strong&gt;” we cannot enable it. It wouldn’t make any sense after all. We can only use it by right-clicking on it and selecting “&lt;strong&gt;Evaluate&lt;/strong&gt;”. This is the purpose of the &lt;strong&gt;On Demand&lt;/strong&gt; evaluation mode after all! :)&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S9bPLGfwmVI/AAAAAAAAAYQ/GhunYw-Hy2E/s1600/PBM_sc7.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S9bPLGfwmVI/AAAAAAAAAYQ/GhunYw-Hy2E/s320/PBM_sc7.png" tt="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;After running the Policy we get its evaluation results:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S9bPJ_GqS1I/AAAAAAAAAYI/9jkjalVDpIo/s1600/PBM_sc8.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="367" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S9bPJ_GqS1I/AAAAAAAAAYI/9jkjalVDpIo/s400/PBM_sc8.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;From the above screenshot we can conclude that at the time being all stored procedures within the “AdventureWorks2008” database comply with the condition set up in the Policy.&lt;/div&gt;&lt;br /&gt;Now, what about adding a new procedure on the “AdventureWorks2008” database having the name “&lt;strong&gt;sp_SampleSP&lt;/strong&gt;”? Let’s do so, re-run the Policy and check the evaluation results!&lt;br /&gt;&lt;br /&gt;Here are the results:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S9bPHxNtxTI/AAAAAAAAAYA/Tio7SQMZ7U4/s1600/PBM_sc9.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="367" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S9bPHxNtxTI/AAAAAAAAAYA/Tio7SQMZ7U4/s400/PBM_sc9.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Oops, we got an error message by the Policy. Let’s click on &lt;strong&gt;[Details] View…&lt;/strong&gt; to see what’s wrong:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S9bPFJgtQtI/AAAAAAAAAX4/ZkrhfGByGRw/s1600/PBM_sc10.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="242" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S9bPFJgtQtI/AAAAAAAAAX4/ZkrhfGByGRw/s400/PBM_sc10.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;We can see that the Policy reported that the stored procedure “&lt;strong&gt;sp_SampleSP&lt;/strong&gt;” does not comply with its condition of &lt;strong&gt;not&lt;/strong&gt; having stored procedures with names starting with '&lt;strong&gt;sp_&lt;/strong&gt;'.&lt;/div&gt;The above is a very simple example of what a Policy can do. Imagine what else you can do with Policy-Based Management thus making your life easier! :)&lt;br /&gt;&lt;br /&gt;Let’s delete now the sample stored procedure we earlier created. We need to comply after all! :)&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;On change: prevent&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;If we want to change the Evaluation Mode of the above Policy to “&lt;strong&gt;On change: prevent&lt;/strong&gt;”, we can double-click on the Policy, change it and then enable the Policy:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/S9bPDaQpCRI/AAAAAAAAAXw/6ufdMb0PNQ4/s1600/PBM_sc11.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="342" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/S9bPDaQpCRI/AAAAAAAAAXw/6ufdMb0PNQ4/s400/PBM_sc11.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Now let’s try to create again the same stored procedure:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S9bO-Q5P4QI/AAAAAAAAAXo/8rPNt0GNj2k/s1600/PBM_sc12.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="313" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S9bO-Q5P4QI/AAAAAAAAAXo/8rPNt0GNj2k/s400/PBM_sc12.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;As you can see from the above screenshot, the Policy prevented the Database Engine from creating the stored procedure as it does not comply with the naming condition specified by the Policy!&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;u&gt;&lt;strong&gt;On change: log only&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;Similarly, we can change the Evaluation Mode of the Policy to “&lt;strong&gt;On change: log only&lt;/strong&gt;”. This will allow the stored procedure to be created but it will also add a log entry in &lt;strong&gt;SQL Server Logs&lt;/strong&gt; and &lt;strong&gt;Windows Application Log&lt;/strong&gt; reporting the violation of the Policy:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/S9bO70L3crI/AAAAAAAAAXg/IEVTP2HGdzY/s1600/PBM_sc13.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="277" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/S9bO70L3crI/AAAAAAAAAXg/IEVTP2HGdzY/s400/PBM_sc13.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S9bO5a6M_TI/AAAAAAAAAXY/3D19QEpoxq4/s1600/PBM_sc14.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="27" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S9bO5a6M_TI/AAAAAAAAAXY/3D19QEpoxq4/s640/PBM_sc14.png" tt="true" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;strong&gt;&lt;u&gt;On schedule&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;Last but not least, you can set up a schedule for when the Policy should be executed. This will create a SQL Server Agent job that will execute the Policy at the selected time.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S9bO3Tx-78I/AAAAAAAAAXQ/124_IJKumCg/s1600/PBM_sc15.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="342" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S9bO3Tx-78I/AAAAAAAAAXQ/124_IJKumCg/s400/PBM_sc15.png" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;strong&gt;&lt;u&gt;Summary&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;This post was a very basic example on how you can use Policy-Based Management in SQL Server 2008. You can build really advanced Policy scenarios where you can have multiple Policies and conditions, evaluating a large set of actions in more than one SQL Server instances. &lt;br /&gt;&lt;br /&gt;The Policy-Based Management feature in SQL Server 2008 is extremely powerful and allows setting up strict Compliance scenarios ensuring the health and desired structure of the monitored SQL Server instances and the databases that exist within them.&lt;br /&gt;&lt;br /&gt;The best way to learn more about Policy-Based Management in SQL Server is to get experimented with it in order to fully realize its potentials.&lt;br /&gt;&lt;br /&gt;You can also check out &lt;a href="http://technet.microsoft.com/en-us/library/bb510667.aspx"&gt;this&lt;/a&gt; link for more information on Policy-Based Management in SQL Server.&lt;br /&gt;&lt;br /&gt;Until next time!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-7293117720569964957?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/7293117720569964957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=7293117720569964957' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7293117720569964957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7293117720569964957'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/04/policy-based-management-in-sql-server.html' title='Policy-Based Management in SQL Server 2008'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_tEowgAvs-mQ/S9bPUHRWodI/AAAAAAAAAZA/PIz8fx-YPW0/s72-c/PBM_sc1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-7075060017419038722</id><published>2010-04-21T00:46:00.002+03:00</published><updated>2010-07-27T09:24:07.395+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>The Significance of Technical Communities</title><content type='html'>So here I am thinking of the next event. Should it be a topic on a new .NET Technology? A topic on a SQL Server 2008 R2 feature maybe? When should I deliver my next webcast? Which is the next local or regional event am I going to attend?&lt;br /&gt;&lt;br /&gt;As I am thinking the above, I am also feeling the need to say a few words on Technical Communities. I guess that all people sometimes feel the need to philosophize things a bit.&lt;br /&gt;&lt;br /&gt;A few days ago I had the pleasure to attend the Microsoft Regional CEE MVP Summit in Athens, Greece. I had the chance to meet in person with many people whom I only knew through emails and several social media on which we exchanged knowledge, ideas, and generally interacted on technical topics of common interest.&lt;br /&gt;&lt;br /&gt;I must say, attending the Summit in Athens, was one of the best experiences of my life. When attending such events, you fully realize what the Technical Community is all about. You interact with great people sharing the passion for technology. You discuss with people sharing common interests on certain areas of technology. You share knowledge and you are glad that you are able to help a person learning a bit more on a specific topic.&amp;nbsp; You are also glad that this person helps you learning something more on the technology topic of his/her expertise.&lt;br /&gt;&lt;br /&gt;So what a Technical Community really is? Is it a mailing list on which you post questions on various technical issues you might be dealing with and wait for answers? Is it a platform on which you collaborate by answering various technical questions? Is it a forum, a blog maybe?&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Well, a Technical Community is all the above plus much more. First of all, I believe that it is not just the platform that makes a Technical Community. The platforms and related tools make it easier to exchange knowledge and they have a significant role within a Community. Though, what really makes a Technical Community is the &lt;b&gt;people&lt;/b&gt;. It is the people who share a passion for technology and have the willingness to exchange knowledge without requesting anything in return. It is the people who spend hours from their free time for helping others and feels really good for doing so. It is the people who constantly get more educated on their area of expertise and present in events, trying to help other people who are interested on those topics for learning even more, answering their questions and discuss with them.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;A Community is actually an “environment” that helps its members to develop their skills through knowledge exchange via presentations, hands-on labs, online and offline discussions and many other activities. It helps its members to catch up with the latest technologies of common interest easier and more efficiently. It is a “place” where each individual puts effort and time for helping others because he believes in people. A Community is all about people and their need for belonging to a broader group of people within which they can share knowledge, exchange ideas, and share the passion and excitement on technology.&lt;br /&gt;&lt;br /&gt;I feel that this is what a Technical Community is all about.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-7075060017419038722?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/7075060017419038722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=7075060017419038722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7075060017419038722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7075060017419038722'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/04/significance-of-technical-communities.html' title='The Significance of Technical Communities'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-3033010006888717396</id><published>2010-04-08T00:51:00.004+03:00</published><updated>2010-04-08T11:16:11.731+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ADO .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access'/><category scheme='http://www.blogger.com/atom/ns#' term='INETA'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><category scheme='http://www.blogger.com/atom/ns#' term='CDNUG'/><title type='text'>Microsoft DevDays 2010 in Cyprus!</title><content type='html'>A few weeks ago I got asked to present on &lt;a href="http://www.msdevdays.com/Index.aspx"&gt;Microsoft DevDays 2010&lt;/a&gt; in Cyprus. DevDays is the biggest event in Cyprus for Software Architects and Developers.&lt;br /&gt;&lt;br /&gt;This year, the event features many hot topics such as:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Visual Studio 2010&lt;/li&gt;&lt;li&gt;&amp;nbsp;Windows Azure and Windows Identity Framework&lt;/li&gt;&lt;li&gt;&amp;nbsp;Interoperability and how to run PHP Applications on Microsoft Platform&lt;/li&gt;&lt;li&gt;&amp;nbsp;...and much more!&lt;/li&gt;&lt;/ul&gt;I will be presenting the session with topic: "&lt;b&gt;An Introduction to the ADO.NET Entity Framework and Data Services&lt;/b&gt;".&amp;nbsp; This session is all about data! It discusses how data can be easily accessed and manipulated using the &lt;a href="http://blogs.msdn.com/adonet/default.aspx"&gt;ADO .NET Entity Framework&lt;/a&gt; and then how this data can be exposed to the Web using the powerful &lt;a href="http://blogs.msdn.com/astoriateam/"&gt;WCF Data Services&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;So if it happens and you are in Cyprus on &lt;b&gt;April 15&lt;/b&gt;, make sure you register for the event &lt;a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?culture=en-US&amp;amp;EventID=1032448570"&gt;here &lt;/a&gt;and stop by for learning more on state of the art Microsoft technologies! The weather in cyprus is quite good as well! :)&lt;br /&gt;&lt;br /&gt;Of course, if you are in another country in Central or Eastern Europe, a DevDays event might be taking place near you! Check out this &lt;a href="http://www.msdevdays.com/Default.aspx?pid=68"&gt;link &lt;/a&gt;for more information!&lt;br /&gt;&lt;br /&gt;See you at the event! &lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-3033010006888717396?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/3033010006888717396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=3033010006888717396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3033010006888717396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3033010006888717396'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/04/microsoft-devdays-2010-in-cyprus.html' title='Microsoft DevDays 2010 in Cyprus!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-2213547065738079504</id><published>2010-04-01T23:43:00.004+03:00</published><updated>2010-04-01T23:45:55.807+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVP'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Congratulations 2010 Microsoft MVP!‏</title><content type='html'>Today is a very special day! I am proud to announce that I received the &lt;a href="http://mvp.support.microsoft.com/"&gt;MVP&lt;/a&gt; award for the second time in a row!&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/S7T_Z1O5vDI/AAAAAAAAAWo/woFz_XgGfqw/s1600/MVPLogo.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="75" nt="true" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/S7T_Z1O5vDI/AAAAAAAAAWo/woFz_XgGfqw/s400/MVPLogo.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Dear Artemakis Artemiou,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Congratulations! We are pleased to present you with the 2010 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in SQL Server technical communities during the past year.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Once again, I would like to thank all the SQL Server community members for making this community a great place for exchanging knowledge and exploring the real potentials of &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/"&gt;SQL Server&lt;/a&gt;&amp;nbsp;and its related technologies! It is awesome being part of this community!&lt;br /&gt;&lt;br /&gt;Also, many thanks to Microsoft for strongly supporting the technical communities around the globe!&lt;br /&gt;&lt;br /&gt;I would also like to thank the&amp;nbsp;SQL Server Product Group for developing such&amp;nbsp;great technologies&amp;nbsp;and everyone involved in the &lt;a href="https://mvp.support.microsoft.com/gp/aboutmvp"&gt;MVP Award Program&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;On my end, as I did last year, I&amp;nbsp;promise that I will keep on doing my best regarding my involvement in the SQL Server community and keep on sharing knowledge!!!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-2213547065738079504?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/2213547065738079504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=2213547065738079504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2213547065738079504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2213547065738079504'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/04/congratulations-2010-microsoft-mvp.html' title='Congratulations 2010 Microsoft MVP!‏'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_tEowgAvs-mQ/S7T_Z1O5vDI/AAAAAAAAAWo/woFz_XgGfqw/s72-c/MVPLogo.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-5638948977456459131</id><published>2010-03-12T21:45:00.002+02:00</published><updated>2010-03-13T01:55:18.857+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='BI'/><category scheme='http://www.blogger.com/atom/ns#' term='PowerPivot'/><title type='text'>Building Data Relationships in PowerPivot</title><content type='html'>This post is a follow-up to the previous post titled: “&lt;a href="http://aartemiou.blogspot.com/2010/03/using-powerpivots-copy-paste-support.html"&gt;Using PowerPivot’s Copy-Paste Support for Importing Data from Word&lt;/a&gt;”.&lt;br /&gt;&lt;br /&gt;In this post we will see how we can import data from Microsoft Word using PowerPivot’s copy-paste feature, create relationships on the data and perform aggregations that is BI! :)&lt;br /&gt;&lt;br /&gt;For example, consider the two following tables which exist in a sample Word document:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5qWiQ2i8yI/AAAAAAAAAWY/rGdJ4nvnGdA/s1600-h/PP_CP_Table1.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="126" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5qWiQ2i8yI/AAAAAAAAAWY/rGdJ4nvnGdA/s400/PP_CP_Table1.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5qWkjPJw6I/AAAAAAAAAWg/ibdjVWsBcpk/s1600-h/PP_CP_Table2.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="93" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5qWkjPJw6I/AAAAAAAAAWg/ibdjVWsBcpk/s400/PP_CP_Table2.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;em&gt;&lt;br /&gt;The business query is to evaluate the sales activity for all the salesmen and decide possible adjustments to their commissions.&lt;/em&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;To do this in PowerPivot, we are going to use the copy-paste feature, create a relationship for the two tables’ data, and visually build our business query using the user-friendly interface and tools of PowerPivot.&lt;br /&gt;&lt;br /&gt;The first step is to import the data from Word right into Excel using PowerPivot. So first, we have to launch Excel 2010 and then start the PowerPivot environment:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5qVqxPKtBI/AAAAAAAAAWQ/iUfho_-z9zI/s1600-h/PP_CP_01.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="81" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5qVqxPKtBI/AAAAAAAAAWQ/iUfho_-z9zI/s400/PP_CP_01.png" vt="true" width="400" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then, we copy the first table from the Word document into clipboard and we click on the “&lt;strong&gt;To New Table” &lt;/strong&gt;button.&lt;br /&gt;&lt;br /&gt;After previewing the data and clicking on the “&lt;strong&gt;OK&lt;/strong&gt;” button, we see that the first table’s data are imported into PowerPivot:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5qVjVAoOnI/AAAAAAAAAWI/WN9H5YI47_U/s1600-h/PP_CP_02.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="158" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5qVjVAoOnI/AAAAAAAAAWI/WN9H5YI47_U/s400/PP_CP_02.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Similarly, the next step is to import the data of the second table into PowerPivot as well. To this end, we copy the second table into clipboard and in the PowerPivot dialog we click again on the “To New Table” button.&lt;/div&gt;&lt;br /&gt;After the preview, we can see that the second table’s data are imported into PowerPivot:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S5qVfj96l6I/AAAAAAAAAWA/VgaHNprNoC8/s1600-h/PP_CP_03.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="140" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S5qVfj96l6I/AAAAAAAAAWA/VgaHNprNoC8/s400/PP_CP_03.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Now it’s time to create the relationship between the two tables! We click on the “&lt;strong&gt;Table&lt;/strong&gt;” menu, then on the&amp;nbsp;“&lt;strong&gt;Create Relationship&lt;/strong&gt;” button, and we set the following relationship between the two tables:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S5qVadRzLYI/AAAAAAAAAV4/kJOJW-V_i7M/s1600-h/PP_CP_04.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="198" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S5qVadRzLYI/AAAAAAAAAV4/kJOJW-V_i7M/s400/PP_CP_04.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;That’s it! If&amp;nbsp;we now&amp;nbsp;click on the “&lt;strong&gt;Manage Relationships&lt;/strong&gt;” button we can see that the relationship has been created:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5qVT0uaA-I/AAAAAAAAAVo/yY-b3alOoks/s1600-h/PP_CP_05.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="265" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5qVT0uaA-I/AAAAAAAAAVo/yY-b3alOoks/s400/PP_CP_05.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Now, back to the “&lt;strong&gt;Home&lt;/strong&gt;” menu, we click on the “&lt;strong&gt;PivotTable&lt;/strong&gt;” button and we select a PivotTable chart preset, for this&amp;nbsp;example I selected the “&lt;strong&gt;Single PivotChart&lt;/strong&gt;”. We select to import the PivotChart into a new worksheet and we have our data ready for processing:&lt;/div&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/S5qVPbfVH_I/AAAAAAAAAVg/iCVnFX_hNzc/s1600-h/PP_CP_06.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/S5qVPbfVH_I/AAAAAAAAAVg/iCVnFX_hNzc/s400/PP_CP_06.png" vt="true" width="400" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;For answering the business query we can&amp;nbsp;check out&amp;nbsp;the total sales amount per salesman and also see the employment date of each salesman. Then, based on the sales amount of each salesman, we can propose possible adjustments to the commissions. For this purpose, I created the two following charts:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5qVIPNRRTI/AAAAAAAAAVY/1een2npHosA/s1600-h/PP_CP_07.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="230" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5qVIPNRRTI/AAAAAAAAAVY/1een2npHosA/s400/PP_CP_07.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5qVG54Ax4I/AAAAAAAAAVQ/uP-J3lQSJUU/s1600-h/PP_CP_08.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="230" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5qVG54Ax4I/AAAAAAAAAVQ/uP-J3lQSJUU/s400/PP_CP_08.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Based on the sales activity of each salesman and on the results of the aggregations as illustrated in the two above charts, we derive to the conclusion that &lt;strong&gt;Salesman 3&lt;/strong&gt; should get the larger commission rate, then &lt;strong&gt;Salesman 1&lt;/strong&gt; followed by &lt;strong&gt;Salesman 2&lt;/strong&gt; and last &lt;strong&gt;Salesman 4&lt;/strong&gt; who has the less sales activity.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This post provided a simple example on how we can import data right into Excel using PowerPivot’s copy-paste feature, create relationships on the data and perform BI with ease by&amp;nbsp;using the powerful engine of SQL Server PowerPivot. &lt;br /&gt;&lt;br /&gt;I hope you found this post useful! &lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-5638948977456459131?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/5638948977456459131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=5638948977456459131' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5638948977456459131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5638948977456459131'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/03/building-data-relationships-in.html' title='Building Data Relationships in PowerPivot'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_tEowgAvs-mQ/S5qWiQ2i8yI/AAAAAAAAAWY/rGdJ4nvnGdA/s72-c/PP_CP_Table1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-876035241058992936</id><published>2010-03-10T19:38:00.001+02:00</published><updated>2010-03-10T19:39:06.236+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='BI'/><category scheme='http://www.blogger.com/atom/ns#' term='PowerPivot'/><title type='text'>Using PowerPivot’s Copy-Paste Support for Importing Data from Word</title><content type='html'>One of the great features of SQL Server PowerPivot is that it supports importing data directly from the clipboard. This is quite handy in cases you want to import and analyze data fast.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;An example of using the above feature is importing data from Microsoft Word. Let’s say you have a Word document containing the following table:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5fWNB0AaqI/AAAAAAAAAVI/FPILMtlLG8s/s1600-h/PP_CopyPaste0.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="138" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5fWNB0AaqI/AAAAAAAAAVI/FPILMtlLG8s/s400/PP_CopyPaste0.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The scenario here is to import the data from Word and perform a simple analysis.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;The first step is to select the entire table and copy its contents to the clipboard.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then you have to launch Excel 2010 and open the &lt;strong&gt;PowerPivot &lt;/strong&gt;window:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/S5fVL2o6olI/AAAAAAAAAUQ/-ZnS2XCCd4Q/s1600-h/PP_CopyPaste1.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="87" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/S5fVL2o6olI/AAAAAAAAAUQ/-ZnS2XCCd4Q/s400/PP_CopyPaste1.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Click on “&lt;strong&gt;To New Table&lt;/strong&gt;” and you will be presented with a Paste Preview dialog in which you will be able to see the contents of the clipboard and how they are “translated” by the PowerPivot engine: &lt;br /&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5fVPW8P0oI/AAAAAAAAAUY/ccUEKJewsTs/s1600-h/PP_CopyPaste2.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="362" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5fVPW8P0oI/AAAAAAAAAUY/ccUEKJewsTs/s400/PP_CopyPaste2.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;At the bottom of the dialog you can choose to use the first row as column names and that’s what I did in this example.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;You then click on “&lt;strong&gt;OK&lt;/strong&gt;” and you are presented with the data as imported into PowerPivot:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5fVUCjSenI/AAAAAAAAAUg/yi9v3c6eEQ8/s1600-h/PP_CopyPaste3.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="162" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5fVUCjSenI/AAAAAAAAAUg/yi9v3c6eEQ8/s400/PP_CopyPaste3.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Next, by clicking on the “&lt;strong&gt;PivotTable&lt;/strong&gt;” button you are presented with various options regarding what type(s) of pivot tables you can&amp;nbsp;create: &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5fVVklGp3I/AAAAAAAAAUo/Xx5kfDUpbk4/s1600-h/PP_CopyPaste4.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S5fVVklGp3I/AAAAAAAAAUo/Xx5kfDUpbk4/s320/PP_CopyPaste4.png" vt="true" width="245" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;For this example I chose to use a “&lt;strong&gt;Single PivotChart&lt;/strong&gt;”.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Then, the PowerPivot dialog closes and the Excel worksheet is presented containing the pivot table:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5fVaaXp7sI/AAAAAAAAAUw/FBM1GFpPYjE/s1600-h/PP_CopyPaste5.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5fVaaXp7sI/AAAAAAAAAUw/FBM1GFpPYjE/s320/PP_CopyPaste5.png" vt="true" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;You can then easily perform aggregations using the tools provided by PowerPivot:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5fVc5N3gaI/AAAAAAAAAU4/HEPToJvsJfE/s1600-h/PP_CopyPaste6.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="170" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S5fVc5N3gaI/AAAAAAAAAU4/HEPToJvsJfE/s400/PP_CopyPaste6.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S5fVflUNJ5I/AAAAAAAAAVA/0jewUkLNM9Y/s1600-h/PP_CopyPaste7.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="172" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S5fVflUNJ5I/AAAAAAAAAVA/0jewUkLNM9Y/s400/PP_CopyPaste7.png" vt="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;Well, I guess that’s it for today! I hope you found this post useful!&lt;br /&gt;&lt;br /&gt;Another post on copy-paste and PowerPivot is coming where we will see how we can copy-paste two tables from Word and build relationships on the data.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-876035241058992936?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/876035241058992936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=876035241058992936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/876035241058992936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/876035241058992936'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/03/using-powerpivots-copy-paste-support.html' title='Using PowerPivot’s Copy-Paste Support for Importing Data from Word'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_tEowgAvs-mQ/S5fWNB0AaqI/AAAAAAAAAVI/FPILMtlLG8s/s72-c/PP_CopyPaste0.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-8751402573937204821</id><published>2010-02-11T17:07:00.001+02:00</published><updated>2010-02-11T17:13:03.318+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Creating Logins for Orphaned SQL Server Users</title><content type='html'>There are cases where you might need to restore an entire&amp;nbsp;SQL Server database (i.e. in the case of loss of data, etc.). A set of objects that are restored from the backup set and are included in the restored database are the &lt;strong&gt;database users&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;Though, when speaking about SQL Server logins, these users will might be orphaned as the corresponding SQL Server logins might not exist anymore. A similar case is when restoring a database on another SQL Server Instance.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;In this case, you can use the following stored procedure for fixing such issues: &lt;strong&gt;sp_change_users_login&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;&lt;strong&gt;USE AdventureWorks&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;&lt;strong&gt;GO&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;&lt;strong&gt;EXEC sp_change_users_login 'Auto_Fix', 'UserName', NULL, 'Password';&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;&lt;strong&gt;GO&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The above example will create a new SQL Server Login for the given user name and use as a password the given password string.&lt;br /&gt;&lt;br /&gt;You can also assign existing logins to orhaned users.&lt;br /&gt;&lt;br /&gt;For more information you can visit &lt;a href="http://technet.microsoft.com/en-us/library/ms174378.aspx"&gt;SQL Server Books Online&lt;/a&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-8751402573937204821?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/8751402573937204821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=8751402573937204821' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8751402573937204821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8751402573937204821'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/02/creating-logins-for-orphaned-sql-server.html' title='Creating Logins for Orphaned SQL Server Users'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-4745072818789746822</id><published>2010-01-31T20:45:00.000+02:00</published><updated>2010-01-31T20:45:14.297+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Cleaning up Backup and Restore History Logs in MSDB</title><content type='html'>Sometimes, there are cases, where it is reported to me that the &lt;b&gt;MSDB &lt;/b&gt;database is huge and needs to be shrinked again back to "normal" sizes.&lt;br /&gt;&lt;br /&gt;One case which affects the size of MSDB, is the backup history. Every time a database backup/restore operation takes place in SQL Server, the relevant information is kept into certain system tables in the MSDB database.&lt;br /&gt;&lt;br /&gt;SQL Server stores database backup and restoration information into the following tables that exist in the MSDB database:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;backupfile&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;backupfilegroup&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;restorefile&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;restorefilegroup&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;restorehistory&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;backupset&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Let's examine an example for better understanding the process.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;In this example I am using a database in SQL Server 2008 called "&lt;b&gt;DEMODB2008&lt;/b&gt;". To this end, I performed some backup and restore operations for allowing us to check out the data stored in MSDB.&lt;br /&gt;&lt;br /&gt;The following queries retrieve information regarding the backup and restore operations that took place on the specific database:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;-- This query returns information about the backup set&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT * FROM msdb.dbo.backupset&lt;/div&gt;&lt;div style="color: #274e13;"&gt;WHERE [database_name]='DEMODB2008'&lt;/div&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;-- This query returns information about the backup files including&amp;nbsp;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;-- the logical and physical file names, drive, etc.&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT bf.* &lt;/div&gt;&lt;div style="color: #274e13;"&gt;FROM msdb.dbo.backupfile bf&lt;/div&gt;&lt;div style="color: #274e13;"&gt;INNER JOIN msdb.dbo.backupset bs&lt;/div&gt;&lt;div style="color: #274e13;"&gt;ON bf.[backup_set_id]=bs.[backup_set_id]&lt;/div&gt;&lt;div style="color: #274e13;"&gt;AND bs.[database_name]='DEMODB2008'&lt;/div&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;-- This query returns information about the filegroups that were backed up.&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT bg.* &lt;/div&gt;&lt;div style="color: #274e13;"&gt;FROM msdb.dbo.backupfilegroup bg&lt;/div&gt;&lt;div style="color: #274e13;"&gt;INNER JOIN msdb.dbo.backupset bs&lt;/div&gt;&lt;div style="color: #274e13;"&gt;ON bg.[backup_set_id]=bs.[backup_set_id]&lt;/div&gt;&lt;div style="color: #274e13;"&gt;AND bs.[database_name]='DEMODB2008'&lt;/div&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;-- This query returns information about when a database was restored. &lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT * FROM msdb.dbo.restorehistory&lt;/div&gt;&lt;div style="color: #274e13;"&gt;WHERE [destination_database_name]='DEMODB2008'&lt;/div&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;-- This query returns information about the physical files involved in the restoration process.&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT rf.* &lt;/div&gt;&lt;div style="color: #274e13;"&gt;FROM msdb.dbo.restorefile rf&lt;/div&gt;&lt;div style="color: #274e13;"&gt;INNER JOIN msdb.dbo.restorehistory rh&lt;/div&gt;&lt;div style="color: #274e13;"&gt;ON rf.[restore_history_id]=rh.[restore_history_id]&lt;/div&gt;&lt;div style="color: #274e13;"&gt;AND rh.[destination_database_name]='DEMODB2008'&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;&lt;/div&gt;&lt;div style="color: #274e13;"&gt;-- This query returns information about the restored filegroups.&lt;/div&gt;&lt;div style="color: #274e13;"&gt;SELECT rg.* FROM msdb.dbo.restorefilegroup rg&lt;/div&gt;&lt;div style="color: #274e13;"&gt;INNER JOIN msdb.dbo.restorehistory rh&lt;/div&gt;&lt;div style="color: #274e13;"&gt;ON rg.[restore_history_id]=rh.[restore_history_id]&lt;/div&gt;&lt;div style="color: #274e13;"&gt;AND rh.[destination_database_name]='DEMODB2008'&lt;/div&gt;&lt;br /&gt;In the case where the MSDB database is huge you can try removing any unnecessary backup and restore history logs.&lt;br /&gt;&lt;br /&gt;Instead of manually deleting these logs from the above tables, you can use a SQL Server system stored procedure instead.&lt;br /&gt;&lt;br /&gt;This stored procedure is called "&lt;b&gt;sp_delete_backuphistory&lt;/b&gt;" and exists in the MSDB system database.&lt;br /&gt;&lt;br /&gt;The usage for the above stored procedure is:&lt;br /&gt;&lt;br /&gt;sp_delete_backuphistory [ @oldest_date = ] 'oldest_date' &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;exec msdb.dbo.sp_delete_backuphistory '2009-01-01'&lt;/div&gt;&lt;br /&gt;The above command will clean up the backup and restore history logs up to 01/01/2009.&lt;br /&gt;&lt;br /&gt;For more information you can visit &lt;a href="http://msdn.microsoft.com/en-us/library/ms188328.aspx"&gt;SQL Server Books Online&lt;/a&gt;. &lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-4745072818789746822?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/4745072818789746822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=4745072818789746822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4745072818789746822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4745072818789746822'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/01/cleaning-up-backup-and-restore-history.html' title='Cleaning up Backup and Restore History Logs in MSDB'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-8663531649905030057</id><published>2010-01-05T17:52:00.013+02:00</published><updated>2010-01-05T18:26:10.561+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='BI'/><category scheme='http://www.blogger.com/atom/ns#' term='PowerPivot'/><title type='text'>The PowerPivot Experiment</title><content type='html'>&lt;div style="color: red;"&gt;&lt;i&gt;&lt;b&gt;Hello and Happy New Year 2010!&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;Wishing you all the best, a new year full of health, happiness, success and even more SQL Server knowledge!!! :)&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;As this is my first blog post in 2010, I thought that it should focus on a really hot topic! I hope you will enjoy it!&lt;br /&gt;&lt;br /&gt;I called this post “&lt;b&gt;The PowerPivot Experiment&lt;/b&gt;”. Here’s a little background information on how I decided writing this article. &lt;br /&gt;&lt;br /&gt;When &lt;a href="http://www.powerpivot.com/"&gt;PowerPivot &lt;/a&gt;(formerly known as "Gemini") was released, I really wanted to test its real capabilities by trying to import a really large amount of information right into excel and perform aggregations. To this end, I designed a simple relational database with five tables, populated it with data and performed my experiment using PowerPivot. For the record, the total amount of data was more than &lt;b&gt;100 Million Rows&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;In this post I will explain step-by-step the experiment, starting from the database design, then explaining the import process and finally, provide some examples on how I processed this huge amount of data.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Before describing the steps, I would like to list the several software technologies used, as well as the hardware and O/S configuration of my infrastructure. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Hardware –O/S Configuration:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;OS Name: Microsoft Windows Server 2008 R2 Enterprise&amp;nbsp;&lt;/li&gt;&lt;li&gt;OS Version: 6.1.7600 Build 7600&amp;nbsp;&lt;/li&gt;&lt;li&gt;System Type: x64-based PC&amp;nbsp;&lt;/li&gt;&lt;li&gt;Processor: Intel(R) Core(TM)2 Duo CPU     T7250  @ 2.00GHz, 2001 Mhz, 2 Core(s), 2 Logical Processor(s)&amp;nbsp;&lt;/li&gt;&lt;li&gt;Installed Physical Memory (RAM): 4.00 GB&amp;nbsp;&lt;/li&gt;&lt;li&gt;Total Physical Memory: 4.00 GB&amp;nbsp;&lt;/li&gt;&lt;li&gt;Available Physical Memory: 2.47 GB&amp;nbsp;&lt;/li&gt;&lt;li&gt;Total Virtual Memory: 8.00 GB&amp;nbsp;&lt;/li&gt;&lt;li&gt;Available Virtual Memory: 6.10 GB&amp;nbsp;&lt;/li&gt;&lt;li&gt;Page File Space: 4.00 GB&amp;nbsp;&lt;/li&gt;&amp;nbsp;&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;&lt;b&gt;Software tools/technologies used:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/r2.aspx"&gt;MS SQL Server 2008 R2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.powerpivot.com/"&gt;MS SQL Server PowerPivot&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/office/2010/en/default.aspx"&gt;MS Excel 2010&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Red Gate’s &lt;a href="http://www.red-gate.com/products/sql_data_generator/index.htm"&gt;SQL Data Generator&lt;/a&gt; (for populating my database with sample data) &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Database Design&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;The following database diagram displays the tables participating in the DB Schema used in my experiment along with the table sizes in terms of total number of records:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S0NWQr3AIHI/AAAAAAAAAUI/g5_YZ2vPdnI/s1600-h/DB_Diagram.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S0NWQr3AIHI/AAAAAAAAAUI/g5_YZ2vPdnI/s400/DB_Diagram.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Database size and other statistics:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S0NUc38M7NI/AAAAAAAAAUA/FgrIC18SBzQ/s1600-h/SC11_PowerPivot_SQLServer_DB_Statistics.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S0NUc38M7NI/AAAAAAAAAUA/FgrIC18SBzQ/s400/SC11_PowerPivot_SQLServer_DB_Statistics.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Importing the Data Using PowerPivot&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Step 1: Starting up Excel 2010 and launching PowerPivot Window&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S0NTmaEdKDI/AAAAAAAAASo/A17ihj0Mb5k/s1600-h/SC1_PowerPivot.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S0NTmaEdKDI/AAAAAAAAASo/A17ihj0Mb5k/s400/SC1_PowerPivot.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 2: Establishing a connection to a SQL Server Instance&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S0NTqgtlBJI/AAAAAAAAASw/UGup8GIRV9M/s1600-h/SC2_PowerPivot_SQL_Server.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S0NTqgtlBJI/AAAAAAAAASw/UGup8GIRV9M/s400/SC2_PowerPivot_SQL_Server.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 3: Selecting SQL Server Database Tables for importing it into Excel 2010&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S0NTtcWeq_I/AAAAAAAAAS4/H-fZ1ayaDrc/s1600-h/SC3_PowerPivot_SQL_Server_SelectTables.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S0NTtcWeq_I/AAAAAAAAAS4/H-fZ1ayaDrc/s400/SC3_PowerPivot_SQL_Server_SelectTables.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 4: Start Importing Data (&lt;b&gt;Time: 15:46&lt;/b&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/S0NTwEyZjQI/AAAAAAAAATA/mgHo49sQRs4/s1600-h/SC4_PowerPivot_SQL_Server_ImportStarted.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/S0NTwEyZjQI/AAAAAAAAATA/mgHo49sQRs4/s400/SC4_PowerPivot_SQL_Server_ImportStarted.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Let’s take a look on the status of the import process as it is occurring:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S0NTzAgyaSI/AAAAAAAAATI/HPqOm3RodzQ/s1600-h/SC5_PowerPivot_SQL_Server_ImportStarted_What+is+the+status.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S0NTzAgyaSI/AAAAAAAAATI/HPqOm3RodzQ/s320/SC5_PowerPivot_SQL_Server_ImportStarted_What+is+the+status.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 5: Import completed! Total Time: &lt;b&gt;15:54&lt;/b&gt; – &lt;b&gt;15:46&lt;/b&gt; = &lt;b style="color: red;"&gt;8 minutes!!!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S0NT3M6QkzI/AAAAAAAAATQ/u2ih6nRrIhA/s1600-h/SC6_PowerPivot_SQL_Server_ImportCompleted%21.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S0NT3M6QkzI/AAAAAAAAATQ/u2ih6nRrIhA/s400/SC6_PowerPivot_SQL_Server_ImportCompleted%21.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It only took &lt;b&gt;8 minutes&lt;/b&gt; for the entire import process to complete! I personally believe that this is awesome! :)&lt;br /&gt;Total number of records imported: 40,000 + 60,000 + 500,000 + 100,000,000 + 5,000 = &lt;b&gt;100,605,000&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Working with the pivot tables&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;Right after importing the data, I proceeded with creating two pivot tables (by clicking on the “&lt;b&gt;PivotTable&lt;/b&gt;” button in the PowerPivot window) for being able to easily perform aggregations:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/S0NT-zhtSVI/AAAAAAAAATY/IaTyA-VpSu8/s1600-h/SC7_PowerPivot_PivotTable1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/S0NT-zhtSVI/AAAAAAAAATY/IaTyA-VpSu8/s400/SC7_PowerPivot_PivotTable1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S0NUBa0e2jI/AAAAAAAAATg/64WHgvx5oTc/s1600-h/SC8_PowerPivot_PivotTable1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S0NUBa0e2jI/AAAAAAAAATg/64WHgvx5oTc/s400/SC8_PowerPivot_PivotTable1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The following two screenshots are examples of some basic processing I did against the data I imported into Excel using PowerPivot. Using the PivotChart tools, I visually built OLAP queries answering business questions like: (i) What is the total sales amount by product, and (ii) What is the total sales amount by customer:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/S0NULDOLttI/AAAAAAAAATo/-fZIHiGR0iw/s1600-h/SC9_PowerPivot_Results_Charts1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/S0NULDOLttI/AAAAAAAAATo/-fZIHiGR0iw/s400/SC9_PowerPivot_Results_Charts1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note that you can also modify the charts as you could also do in earlier versions of Excel. For example, in the below screenshot you can see that the chart “&lt;b&gt;Total Sales by Customer ID&lt;/b&gt;” was modified in order to illustrate the data using a pie chart:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/S0NUVi0Yv6I/AAAAAAAAATw/WZ6Ixys1Gwo/s1600-h/SC9_PowerPivot_Results_Charts2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/S0NUVi0Yv6I/AAAAAAAAATw/WZ6Ixys1Gwo/s320/SC9_PowerPivot_Results_Charts2.png" width="320" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;u&gt;&lt;b&gt; &lt;br /&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Saving the workbook&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;After I finished with aggregating the data using the PivotChart tools, I saved the workbook. Note that by saving the workbook, the data that were imported earlier into the workbook using PowerPivot, are stored &lt;b&gt;IN&lt;/b&gt; the workbook and you can access it anywhere as they are contained in the workbook file as a binary object.&lt;br /&gt;&lt;br /&gt;In my example, the database size was around &lt;b&gt;2300 MB&lt;/b&gt;. If you take a look at the following screenshot which presents the properties of the saved workbook, you can see that the file size is &lt;b&gt;732 MB&lt;/b&gt;:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/S0NUZKuRNSI/AAAAAAAAAT4/bg8jsOkAWIQ/s1600-h/SC10_PowerPivot_WorkBook_Properties.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/S0NUZKuRNSI/AAAAAAAAAT4/bg8jsOkAWIQ/s320/SC10_PowerPivot_WorkBook_Properties.png" width="233" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Remarks&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;After performing the above practice, I was able to see in action and test some of the powerful capabilities of PowerPivot.&lt;br /&gt;&lt;br /&gt;The data compression, the speed of the import process, the ease of creating rich Pivot Tables and OLAP queries are some of the great features of PowerPivot that take Business Intelligence a step further!&lt;br /&gt;&lt;br /&gt;Well, that was a description of my “PowerPivot Experiment” :)&lt;br /&gt;&lt;br /&gt;I hope you found this post useful!&lt;br /&gt;&lt;br /&gt;There is more to come on PowerPivot so make sure you check back my blog soon!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-8663531649905030057?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/8663531649905030057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=8663531649905030057' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8663531649905030057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8663531649905030057'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2010/01/powerpivot-experiment.html' title='The PowerPivot Experiment'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_tEowgAvs-mQ/S0NWQr3AIHI/AAAAAAAAAUI/g5_YZ2vPdnI/s72-c/DB_Diagram.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-7657804362970609596</id><published>2009-12-24T00:30:00.007+02:00</published><updated>2009-12-24T00:52:58.264+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Selected Tweets of Year 2009!</title><content type='html'>This is a rather different post than the usual. As the end of year 2009 approaches, I decided to publish a selected number of tweets I did, grouped into different categories.&lt;br /&gt;&lt;br /&gt;It was a great experience to communicate with the Community, among other, by using &lt;a href="http://twitter.com/"&gt;Twitter&lt;/a&gt;. Throughout tweeting it was possible to easily and directly publish short but useful SQL Server tips, links to articles, links to reviews of SQL Server tools and much more!&lt;br /&gt;&lt;br /&gt;I hope you find my tweets useful! :)&lt;br /&gt;&lt;br /&gt;Further below you can find my tweets grouped into the following categories:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;T-SQLTips&lt;/li&gt;&lt;li&gt;SQL Server Performance Tips&lt;/li&gt;&lt;li&gt;Events-Related – Screencasts – Webcasts&lt;/li&gt;&lt;li&gt;Blog Announcements&lt;/li&gt;&lt;li&gt;Other SQL Server-Related&amp;nbsp; Tips, Articles and Tools&lt;/li&gt;&lt;li&gt;Miscellaneous &lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;b&gt;[T-SQLTips]&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;[T-SQL Tip] You can find information on foreign key constraints in &lt;b&gt;sys.foreign_keys&lt;/b&gt; and &lt;b&gt;sys.foreign_key_columns&lt;/b&gt; catalog views&lt;/li&gt;&lt;li&gt;[T-SQL Tip] You can find information on primary keys and unique constraints in &lt;b&gt;sys.key_constraints&lt;/b&gt; and &lt;b&gt;sys.indexes&lt;/b&gt; catalog views&lt;/li&gt;&lt;li&gt;[T-SQL Tip] The last digit in a DATETIME instance can only be 0, 4 or 7. You can use DATETIME2 for more precision.&lt;/li&gt;&lt;li&gt;[T-SQL Tip] A Best Practice for avoiding deadlocks, is to keep transactions in a single batch&lt;/li&gt;&lt;li&gt;[T-SQL Tip] When you rollback a transaction, some functionalities are not reset (i.e. seed values for identity columns)&lt;/li&gt;&lt;li&gt;[T-SQL Tip] An option for Data Archiving in SQL Server is using the OUTPUT clause - &lt;a href="http://bit.ly/QpNIf"&gt;http://bit.ly/QpNIf&lt;/a&gt;&lt;/li&gt;&lt;li&gt;[T-SQL Tip] SELECT GROUPING(ColumnName): Value '1' indicates an aggregate/summary row, Value '0' indicates a detail row&lt;/li&gt;&lt;li&gt;[T-SQL Tip] If you want all values to be included in an aggregation, make sure you replace NULL values with 0's using ISNULL(ColumnName,0)&amp;nbsp;&lt;/li&gt;&lt;li&gt;[T-SQL Tip] When using 'COUNT(ColumnName)' it returns the number of rows containing data in that column. NULL values are ignored&lt;/li&gt;&lt;li&gt;[T-SQL Tip] Order of operations in a WHERE clause: NOT, AND, OR - When not sure, use parentheses&lt;/li&gt;&lt;li&gt;[T-SQL Tip] To use in the WHERE clause of a query 'value&amp;lt;&amp;gt;NULL' you first need to 'SET ANSI_NULLS OFF' - By default is set to ON&amp;nbsp;&lt;/li&gt;&lt;li&gt;[T-SQL Tip] SET XACT_ABORT OFF: Only the T-SQL stmt (in some cases) that raised the error is rolled back and the txn continues processing.&amp;nbsp;&lt;/li&gt;&lt;li&gt;[T-SQL Tip] SET XACT_ABORT ON: If a T-SQL statement raises a run-time error, the entire transaction is terminated and rolled back.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;b&gt;[SQL Server Performance Tips]&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;[MSSQL Perf. Tip] When perf. counters indicate a large number of page splits, consider rebuilding the index and decreasing the fill factor&amp;nbsp;&lt;/li&gt;&lt;li&gt;[MSSQL Perf. Tip] For optimal performance, avoid using functions in the WHERE clause&lt;/li&gt;&lt;li&gt;[MSSQL Perf. Tip] The Query Optimizer cannot use indexes when leading wildcard characters are used in the LIKE clause of a WHERE clause&lt;/li&gt;&lt;li&gt;[MSSQL Perf. Tip] The Query Optimizer cannot use indexes when a NOT operator is used in the WHERE clause of a query&lt;/li&gt;&lt;li&gt;[MSSQL Perf. Tip] Regarding joins - Minimize the number of join clauses. Outer joins are more expensive than inner joins.&amp;nbsp;&lt;/li&gt;&lt;li&gt;[MSSQL Perf. Tip] How to optimize queries: re-write query, add/remove indexes, de-normalize/normalize referenced tables&lt;/li&gt;&lt;li&gt;[MSSQL Perf. Tip] With using "SET STATISTICS TIME ON" you are able to get the execution time in ms for each query execution&lt;/li&gt;&lt;li&gt;A great SQL Server DMV for identifying various bottlenecks and other performance issues - &lt;b&gt;sys.dm_os_wait_stats&lt;/b&gt; - &lt;a href="http://bit.ly/158Iot"&gt;http://bit.ly/158Iot&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;[MSSQL Perf. Tip] Want a fast way to check your query's performance (page reads, etc)? Check out "SET STATISTICS IO" - &lt;a href="http://bit.ly/4BNUDG"&gt;http://bit.ly/4BNUDG&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;With "SET STATISTICS IO" you can also easily check the performance of table scans when experimenting with indexes.&amp;nbsp; &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Covered Index: An index that contains all the columns referenced in the query (in any clause)&amp;nbsp;&lt;/li&gt;&lt;li&gt;Nonclustered Index: Its bottom level (B-tree leaf nodes) contains only columns included in its key and pointers to the actual data rows&amp;nbsp;&lt;/li&gt;&lt;li&gt;Clustered Index: Its bottom level (B-tree leaf nodes) contains all the table rows (with all the columns)&amp;nbsp;&lt;/li&gt;&lt;li&gt;[SQL Server Performance Tip] Always use a covered index in the cases you have READ operations that return a large number of rows.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Using a covered index will improve performance a lot for queries that return a large number of rows.&amp;nbsp;&lt;/li&gt;&lt;li&gt;When changing the collation of a col. in a WHERE clause, the col. index won't be used as the data is sorted based on another collation &lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;b&gt;[Events-Related – Screencasts – Webcasts]&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;I have just updated CDNUG's website with a review and photos of our recent event on VS2010 and Windows Azure! - &lt;a href="http://bit.ly/2SBLWA"&gt;http://bit.ly/2SBLWA&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;New Screencast Available! - "Object Dependencies in SQL Server 2008" - &lt;a href="http://tinyurl.com/m7pduc"&gt;http://tinyurl.com/m7pduc&lt;/a&gt;&lt;/li&gt;&lt;li&gt;My Webcast on SQL Server 2008 T-SQL Enhancements Now Publicly Available! - &lt;a href="http://tinyurl.com/n5ztph"&gt;http://tinyurl.com/n5ztph&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Summary of the CDNUG special event which took place on June 18th, 2009: &lt;a href="http://tinyurl.com/nmtfdx"&gt;http://tinyurl.com/nmtfdx&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;New screencast - Using Inheritance in the ADO .NET Entity Framework: &lt;a href="http://tinyurl.com/ofxnb3"&gt;http://tinyurl.com/ofxnb3&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;My first screencast on SQL Server 2008! &lt;a href="http://tinyurl.com/oz7ph9"&gt;http://tinyurl.com/oz7ph9&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Just finished updating CDNUG's website with last Tuesday's event. Entity Framework and LINQ to Entities! &lt;a href="http://tinyurl.com/d9ynh2"&gt;http://tinyurl.com/d9ynh2&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Reviews for my two latest Live Webcasts on 24 Hours of PASS and MY-TG SQL Server Community Series: &lt;a href="http://bit.ly/O8LIE"&gt;http://bit.ly/O8LIE&lt;/a&gt;, &lt;a href="http://bit.ly/MqRDD"&gt;http://bit.ly/MqRDD&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;[Blog] Introduction to #SQLServer #PowerPivot - MS Momentum 2009 Session Review: &lt;a href="http://bit.ly/8wjE7t"&gt;http://bit.ly/8wjE7t&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;[Blog] CDNUG Event Review - October 27, 2009 - Visual Studio 2010 Beta / Windows Azure Platform - &lt;a href="http://bit.ly/1zIEaN"&gt;http://bit.ly/1zIEaN&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;The review of my session (Sync Framework) on MY-TG SQL Server Community Series now available on my blog - &lt;a href="http://bit.ly/MqRDD"&gt;http://bit.ly/MqRDD&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Finally! The review of my session (18) on 24 Hours of PASS is now available on my blog - &lt;a href="http://bit.ly/O8LIE"&gt;http://bit.ly/O8LIE&lt;/a&gt; - Enjoy!&amp;nbsp;&lt;/li&gt;&lt;li&gt;Published a review on my blog for my session (&lt;a href="http://bit.ly/RhVer"&gt;http://bit.ly/RhVer&lt;/a&gt;) of 24 Hours of PASS. &lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;b&gt;[Blog Announcements]&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;[Blog] Using the OUTPUT Clause: A simple data archiving example - &lt;a href="http://bit.ly/8HSfd8"&gt;http://bit.ly/8HSfd8&lt;/a&gt; #in #SQLServer&amp;nbsp;&lt;/li&gt;&lt;li&gt;[Blog] #Microsoft Momentum 2009 - &lt;a href="http://bit.ly/48laSb"&gt;http://bit.ly/48laSb&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Blog article on Windows Internal Database - &lt;a href="http://bit.ly/4dYhyz"&gt;http://bit.ly/4dYhyz&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Posts on my blog about SQL Azure - &lt;a href="http://bit.ly/274OC6"&gt;http://bit.ly/274OC6&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Blog post on a way of rebuilding all the indexes of a database in SQL Server - &lt;a href="http://bit.ly/tIiho"&gt;http://bit.ly/tIiho&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Blog post on index fragmentation in SQL Server (Tips for all the different versions of SQL Server) - &lt;a href="http://bit.ly/2wOTT2"&gt;http://bit.ly/2wOTT2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Blog post on getting basic table index information in SQL Server - &lt;a href="http://bit.ly/ntLO3"&gt;http://bit.ly/ntLO3&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Blog post about Sync Framework - &lt;a href="http://bit.ly/MqRDD"&gt;http://bit.ly/MqRDD&lt;/a&gt; | Blog post about ADO .NET Data Services - &lt;a href="http://bit.ly/O8LIE"&gt;http://bit.ly/O8LIE&lt;/a&gt; &lt;/li&gt;&lt;li&gt;[New blog post]: Using Computed Columns in SQL Server - &lt;a href="http://bit.ly/PGyxi"&gt;http://bit.ly/PGyxi&lt;/a&gt; &lt;/li&gt;&lt;li&gt;[New Blog Post]: Mysore PASS Chapter SQL Server Webcasts Series - &lt;a href="http://bit.ly/c85gB"&gt;http://bit.ly/c85gB&lt;/a&gt; &lt;/li&gt;&lt;li&gt;[New blog post]: Accessing SQL Azure Using ADO.NET - &lt;a href="http://bit.ly/bBGHf"&gt;http://bit.ly/bBGHf&lt;/a&gt; &lt;/li&gt;&lt;li&gt;New Blog Post: Using the "GO" Command in SQL Server - &lt;a href="http://tinyurl.com/ovvs92"&gt;http://tinyurl.com/ovvs92&lt;/a&gt;&lt;/li&gt;&lt;li&gt;New blog post: New Date-Related Functions in SQL Server 2008 - &lt;a href="http://tinyurl.com/mmacns"&gt;http://tinyurl.com/mmacns&lt;/a&gt;&lt;/li&gt;&lt;li&gt;New blog post - SQL Server 2008 Collation Alignment with Windows Server 2008: &lt;a href="http://tinyurl.com/nphd38"&gt;http://tinyurl.com/nphd38&lt;/a&gt; &lt;/li&gt;&lt;li&gt;New blog post - Error converting data type varchar to float: &lt;a href="http://tinyurl.com/lgj8zv"&gt;http://tinyurl.com/lgj8zv&lt;/a&gt; &lt;/li&gt;&lt;li&gt;New blog post - Windows Internal Database (SSEE): &lt;a href="http://tinyurl.com/mjq7eu"&gt;http://tinyurl.com/mjq7eu&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;New blog post - How to rebuild all the indexes of a database in SQL Server: &lt;a href="http://tinyurl.com/lr87bo"&gt;http://tinyurl.com/lr87bo&lt;/a&gt; &lt;/li&gt;&lt;li&gt;New Blog post - Renaming Windows Logins in SQL Server: &lt;a href="http://tinyurl.com/l5jysa"&gt;http://tinyurl.com/l5jysa&lt;/a&gt; &lt;/li&gt;&lt;li&gt;New blog post: Installing 32-bit SQL Server 2005 Reporting Services on a 64-bit machine/Windows OS - &lt;a href="http://tinyurl.com/o88nbq"&gt;http://tinyurl.com/o88nbq&lt;/a&gt; &lt;/li&gt;&lt;li&gt;New blog post - "The Entity Framework - Part 2 - Inheritance": &lt;a href="http://tinyurl.com/qs7grx"&gt;http://tinyurl.com/qs7grx&lt;/a&gt; &lt;/li&gt;&lt;li&gt;"The Entity Framework - Part 1 - Introduction" is ready! &lt;a href="http://tinyurl.com/coz3uq"&gt;http://tinyurl.com/coz3uq&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Have you ever wondered where are temporary tables stored in SQL Server? - &lt;a href="http://bit.ly/34GaBx"&gt;http://bit.ly/34GaBx&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Comparing DATETIME with DATETIME2 - &lt;a href="http://bit.ly/4ySjVq"&gt;http://bit.ly/4ySjVq&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Oh well, here it is! &lt;a href="http://bit.ly/4ys37Y"&gt;http://bit.ly/4ys37Y&lt;/a&gt; - A little tip related to Maintenance Plans in SQL Server 2005! &lt;/li&gt;&lt;li&gt;Date Functions in #SQLServer 2008 - &lt;a href="http://bit.ly/itRCx"&gt;http://bit.ly/itRCx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;New blog post - SQL Azure: A First Contact - &lt;a href="http://bit.ly/19U98Q"&gt;http://bit.ly/19U98Q&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Discussion: A DBA or a Database Developer? - Your comments are welcome! - &lt;a href="http://bit.ly/16G3CI"&gt;http://bit.ly/16G3CI&lt;/a&gt;&amp;nbsp; &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;b&gt;[Other SQL Server-Related&amp;nbsp; Tips, Articles and Tools]&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Business intelligence made easy: #PowerPivot - &lt;a href="http://bit.ly/XJYEh"&gt;http://bit.ly/XJYEh&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Great article on how to create a #SQLServer Management Studio Add-in - &lt;a href="http://bit.ly/1FmpUM"&gt;http://bit.ly/1FmpUM&lt;/a&gt; &lt;/li&gt;&lt;li&gt;When you use MS Sync Framework, you do not have to worry about data conflicts; it is efficiently handled! And yes, it's parameterizable! &lt;/li&gt;&lt;li&gt;A "Local Database Cache" in Visual Studio 2008 SP1, is actually a SQL Server Compact 3.5 database. &lt;/li&gt;&lt;li&gt;The easiest way to build an occasionally connected application in Visual Studio 2008 SP1, is to add a new item called "Local Database Cache"&amp;nbsp;&lt;/li&gt;&lt;li&gt;Microsoft Sync Framework 2.0 CTP2: &lt;a href="http://bit.ly/EDkJ2"&gt;http://bit.ly/EDkJ2&lt;/a&gt; - Yummy! :) &lt;/li&gt;&lt;li&gt;A handy ADO .NET Data Services (v1) cheat sheet: &lt;a href="http://bit.ly/2VTUJj"&gt;http://bit.ly/2VTUJj&lt;/a&gt; &lt;/li&gt;&lt;li&gt;An interesting tool (on CodePlex)! - SQL Azure Explorer - &lt;a href="http://bit.ly/1OmhR8"&gt;http://bit.ly/1OmhR8&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Snippet Editor on CodePlex: A great tool! - &lt;a href="http://bit.ly/wV12A"&gt;http://bit.ly/wV12A&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Good morning! Very interesting project on codeplex - SQL Azure Migration Wizard - &lt;a href="http://bit.ly/17k4s0"&gt;http://bit.ly/17k4s0&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;extremely useful when migrating SQL Server instances: &lt;a href="http://tinyurl.com/648c6c"&gt;http://tinyurl.com/648c6c&lt;/a&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;It's time to generate a huge amount of sample data for use with my #PowerPivot demos. I will use @RedGate's SQL Data Generator for this&lt;/li&gt;&lt;li&gt;[Blog Post] Product Review: @redgate's SQL Object Level Recovery Native - &lt;a href="http://bit.ly/45dqL5"&gt;http://bit.ly/45dqL5&lt;/a&gt; &lt;/li&gt;&lt;li&gt;During today's session I also used Red Gate's (@redgate) tool "SQL Prompt 4" (&lt;a href="http://bit.ly/8kAlW"&gt;http://bit.ly/8kAlW&lt;/a&gt;); a great tool!&amp;nbsp;&lt;/li&gt;&lt;li&gt;Using Computed Columns in #SQLServer - &lt;a href="http://bit.ly/PGyxi"&gt;http://bit.ly/PGyxi&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Change Data Capture (CDC): Determines and tracks the data that has changed- How it is implemented in #SQLServer 2008: &lt;a href="http://bit.ly/5s17UI"&gt;http://bit.ly/5s17UI&lt;/a&gt;&lt;/li&gt;&lt;li&gt;GROUPING SETS can be also combined with ROLLUP and CUBE operations. Isn't this cool? :) &lt;/li&gt;&lt;li&gt;GROUPING SETS in #SQLServer 2008 - &lt;a href="http://bit.ly/7gm0DK"&gt;http://bit.ly/7gm0DK&lt;/a&gt; - In many cases they can even be equivalent to ROLLUP or CUBE operations&lt;/li&gt;&lt;li&gt;[MSSQL DBA Tip] How to shrink the tempdb database in SQL Server - &lt;a href="http://bit.ly/81bd3s"&gt;http://bit.ly/81bd3s&lt;/a&gt;&lt;/li&gt;&lt;li&gt;MSDN BOL on Master Data Services in SQL Server 2008 R2 Nov. CTP - &lt;a href="http://bit.ly/2qbScq"&gt;http://bit.ly/2qbScq&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Always keep in mind the following upgrade scenarios supported in #SQLServer 2008 - &lt;a href="http://bit.ly/UWd3O"&gt;http://bit.ly/UWd3O&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;#SQLServer 2008 R2 November CTP available to the general public on November 11th - &lt;a href="http://bit.ly/QMrA8"&gt;http://bit.ly/QMrA8&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Taking #SQLServer DBs offline: ALTER DATABASE [DB_NAME] SET OFFLINE WITH ROLLBACK [IMMEDIATE | x seconds] &lt;/li&gt;&lt;li&gt;need to copy the DB files from an instance to another but I can't stop the source MSSQL instance. Oh well, I'll just take the DBs offline! &lt;/li&gt;&lt;li&gt;Useful: Deprecated Database Engine Features in SQL Server 2008 - &lt;a href="http://bit.ly/47jrPz"&gt;http://bit.ly/47jrPz&lt;/a&gt; &lt;/li&gt;&lt;li&gt;So it is preferable to use &lt;b&gt;sp_send_dbmail&lt;/b&gt; when needed to send mail from MSSQL Database Engine. For more information: &lt;a href="http://bit.ly/2g6KtR"&gt;http://bit.ly/2g6KtR&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Comparing &lt;b&gt;xp_sendmail&lt;/b&gt; to &lt;b&gt;sp_send_dbmail&lt;/b&gt;: They both send mail from SQL Server but the former will be removed in a future version of MSSQL. &lt;/li&gt;&lt;li&gt;[MSSQL Error Handling Tip] ERROR_PROCEDURE - &lt;a href="http://bit.ly/2Pl9JQ"&gt;http://bit.ly/2Pl9JQ&lt;/a&gt; &lt;/li&gt;&lt;li&gt;By the way, it always useful to understand the SQL Server Error Message Severity Levels - It helps for debugging! - &lt;a href="http://bit.ly/32CORI"&gt;http://bit.ly/32CORI&lt;/a&gt; &lt;/li&gt;&lt;li&gt;By the way, to get a list of all the schemas in a database you can try this: USE [DatabaseName]; SELECT * FROM sys.schemas; &lt;/li&gt;&lt;li&gt;More on Capitalization Styles - &lt;a href="http://bit.ly/27lJNt"&gt;http://bit.ly/27lJNt&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Naming guidelines for when creating DB tables/columns: use Pascal Casing, avoid abbreviations, use self-explanatory names.&amp;nbsp;&lt;/li&gt;&lt;li&gt;REVOKE just "cancels" any previously given permissions (including DENY). &lt;/li&gt;&lt;li&gt;Do not get confused with DENY and REVOKE. DENY is a permission which just denies access to a securable (i.e. a database table).&amp;nbsp;&lt;/li&gt;&lt;li&gt;When you are using the REVOKE statement in SQL Server, you can either use the clause TO or FROM for specifying the grantee principal &lt;/li&gt;&lt;li&gt;How to transfer logins and passwords between instances of SQL Server: &lt;a href="http://bit.ly/2KguZr"&gt;http://bit.ly/2KguZr&lt;/a&gt; - Actually I am just doing this!&amp;nbsp;&lt;/li&gt;&lt;li&gt;Just got the error message: Unable to load DLL 'sqlceme35.dll' - To fix it just (re)install SQL Server CE 3.5 SP1! - &lt;a href="http://bit.ly/5lhDc"&gt;http://bit.ly/5lhDc&lt;/a&gt; &lt;/li&gt;&lt;li&gt;How to identify your SQL Server version and edition: &lt;a href="http://bit.ly/5lYtO"&gt;http://bit.ly/5lYtO&lt;/a&gt; &lt;/li&gt;&lt;li&gt;SQL Server 2008 R2 – Application and Multi-Server Management - &lt;a href="http://tinyurl.com/qd8n7m"&gt;http://tinyurl.com/qd8n7m&lt;/a&gt; &lt;/li&gt;&lt;li&gt;What's New in SQL Server 2008 R2 November CTP - &lt;a href="http://bit.ly/1dy0S2"&gt;http://bit.ly/1dy0S2&lt;/a&gt; &lt;/li&gt;&lt;li&gt;A great article on @mssqltips website; Scheduling a SQL Server Profiler Trace - &lt;a href="http://bit.ly/VW3Ke"&gt;http://bit.ly/VW3Ke&lt;/a&gt; &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&amp;nbsp;&lt;b&gt;[Miscellaneous]&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Want to convert Live Meeting wmv successfully? Use Windows Media Encoder! It's great! - &lt;a href="http://tinyurl.com/g37zo"&gt;http://tinyurl.com/g37zo&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Differences between Windows XP Mode and MED-V: &lt;a href="http://tinyurl.com/dhovnf"&gt;http://tinyurl.com/dhovnf&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Windows 7 Learning Portal: &lt;a href="http://tinyurl.com/dftebp"&gt;http://tinyurl.com/dftebp&lt;/a&gt; &lt;/li&gt;&lt;/ol&gt;&lt;b style="color: #cc0000;"&gt;More tweets about SQL Server to come in 2010!&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-7657804362970609596?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/7657804362970609596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=7657804362970609596' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7657804362970609596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7657804362970609596'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/12/selected-tweets-of-year-2009.html' title='Selected Tweets of Year 2009!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-1122141539537007913</id><published>2009-12-15T00:29:00.017+02:00</published><updated>2009-12-15T00:48:46.707+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Programmability'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Using the OUTPUT Clause: A simple data archiving example</title><content type='html'>The &lt;b&gt;OUTPUT &lt;/b&gt;Clause in T-SQL as described in &lt;a href="http://msdn.microsoft.com/en-us/library/ms177564.aspx"&gt;MSDN SQL Server BOL&lt;/a&gt;, "&lt;i&gt;returns information from, or expressions based on, each row affected by an INSERT, UPDATE, DELETE, or MERGE statement.&lt;/i&gt;"&lt;br /&gt;&lt;br /&gt;The functionality provided by the OUTPUT clause is very powerful and can be used in many scenarios. One such a scenario is &lt;b&gt;Data Archiving&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;Consider the following example based on which there is a "&lt;b&gt;CustomerData&lt;/b&gt;" table containing customer IDs and status codes indidicating whether a customer is Active or Inactive.&lt;br /&gt;&lt;br /&gt;A data archiving scenario would be to archive all the customers having the status "INACTIVE".&lt;br /&gt;&lt;br /&gt;For this example I am going to use two tables called "&lt;b&gt;CustomerData&lt;/b&gt;" and "&lt;b&gt;CustomerArchive&lt;/b&gt;".&lt;br /&gt;&lt;br /&gt;OK, let's see some code!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;div style="color: #274e13;"&gt;--Creates the schema&lt;br /&gt;CREATE SCHEMA Test&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--Creates the data table for customers&lt;br /&gt;CREATE TABLE Test.CustomerData&lt;br /&gt;(&lt;br /&gt;ID int IDENTITY(1,1) NOT NULL,&lt;br /&gt;StatusCode VARCHAR(10) NOT NULL&lt;br /&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--Creates the data table for customers archive&lt;br /&gt;CREATE TABLE Test.CustomerArchive&lt;br /&gt;(&lt;br /&gt;ID int NOT NULL,&lt;br /&gt;StatusCode VARCHAR(10) NOT NULL&lt;br /&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--Populates data table with some sample data (Using Row Constructors)&lt;br /&gt;INSERT INTO Test.CustomerData (StatusCode)&lt;br /&gt;VALUES&amp;nbsp;&amp;nbsp;&amp;nbsp; ('ACTIVE'),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ('ACTIVE'),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ('INACTIVE'),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ('ACTIVE'),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ('ACTIVE'),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ('INACTIVE'),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ('ACTIVE'),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ('INACTIVE'),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ('ACTIVE'),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ('ACTIVE')&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #38761d;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;Now, let's check out the contents of the two tables:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;b&gt;CustomerData&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/Sya4gGGxAmI/AAAAAAAAASE/VJXLruElFvU/s1600-h/OUTPUT_sc1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/Sya4gGGxAmI/AAAAAAAAASE/VJXLruElFvU/s400/OUTPUT_sc1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CustomerArchive&lt;/b&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/Sya4hTGXhwI/AAAAAAAAASM/WBTYPMe0lho/s1600-h/OUTPUT_sc2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/Sya4hTGXhwI/AAAAAAAAASM/WBTYPMe0lho/s400/OUTPUT_sc2.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, let's archive the CustomersData table using the OUTPUT clause in the below query:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;--Archive inactive customers and store the records in the "CustomerArchive" table&lt;/span&gt; &lt;br /&gt;&lt;span style="color: #274e13;"&gt;DELETE FROM Test.CustomerData&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;OUTPUT DELETED.* INTO Test.CustomerArchive&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #274e13;"&gt;WHERE StatusCode='INACTIVE'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CustomerData&lt;/b&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/Sya5sJuLBHI/AAAAAAAAASU/2ELc3UCmKWA/s1600-h/OUTPUT_sc3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/Sya5sJuLBHI/AAAAAAAAASU/2ELc3UCmKWA/s400/OUTPUT_sc3.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CustomerArchive&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/Sya5tWLvxvI/AAAAAAAAASc/Z_PxMhvaVJI/s1600-h/OUTPUT_sc4.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/Sya5tWLvxvI/AAAAAAAAASc/Z_PxMhvaVJI/s400/OUTPUT_sc4.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As you can see from the above results, with just a single T-SQL statement, we managed to delete the desired data from the &lt;b&gt;CustomerData&lt;/b&gt; table and also archive it into the &lt;b&gt;CustomerArchive &lt;/b&gt;table. &lt;br /&gt;&lt;br /&gt;The above scenario was just a simple example on how data archiving can be performed using the OUTPUT clause in SQL Server. You can build more complex data archiving logic using the OUTPUT clause as you can also use the INSERTED keyword and perform multiple joins in the query which uses the OUTPUT clause.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #990000;"&gt;Note: Always be careful when deleting data! Always keep a backup of your data.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-1122141539537007913?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/1122141539537007913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=1122141539537007913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1122141539537007913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/1122141539537007913'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/12/using-output-clause-simple-data.html' title='Using the OUTPUT Clause: A simple data archiving example'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_tEowgAvs-mQ/Sya4gGGxAmI/AAAAAAAAASE/VJXLruElFvU/s72-c/OUTPUT_sc1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-3961162045589755282</id><published>2009-12-11T21:38:00.000+02:00</published><updated>2009-12-11T21:38:52.443+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Certification'/><title type='text'>MCTS: SQL Server 2008, Database Development</title><content type='html'>Today I managed to pass the Microsoft Exam &lt;a href="http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-433&amp;amp;locale=en-us"&gt;&lt;b&gt;70-433&lt;/b&gt;&lt;/a&gt; - &lt;b&gt;TS: Microsoft SQL Server 2008, Database Development&lt;/b&gt; and thus I got my third MCTS certification on SQL Server :)&lt;br /&gt;&lt;br /&gt;This exam was all about database development using SQL Server 2008. While studying for the exam, I had the chance to try and learn more on the various programmability features of SQL Server 2008 which I did not have the chance to heavily use it yet.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;What I think, is that while it is very important studying for certification, the entire process also provides you with the opportunity of learning things which you can use when working with SQL Server and get things work with intelligent techniques.&lt;br /&gt;&lt;br /&gt;It was a great experience, especially when I saw the "Congratulations" message on the screen of the PC at the Exam Center where I took the exam! :)&lt;br /&gt;&lt;br /&gt;For more information on Microsoft SQL Server certifications, check out &lt;a href="http://www.microsoft.com/learning/en/us/certification/cert-sql-server.aspx"&gt;this &lt;/a&gt;link!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-3961162045589755282?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/3961162045589755282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=3961162045589755282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3961162045589755282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3961162045589755282'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/12/mcts-sql-server-2008-database.html' title='MCTS: SQL Server 2008, Database Development'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-5165083720984970599</id><published>2009-12-02T23:55:00.008+02:00</published><updated>2009-12-03T00:25:03.393+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='Event Reviews'/><category scheme='http://www.blogger.com/atom/ns#' term='PowerPivot'/><category scheme='http://www.blogger.com/atom/ns#' term='CDNUG'/><title type='text'>Introduction to SQL Server PowerPivot - MS Momentum 2009 Session Review</title><content type='html'>On November 26th 2009,&amp;nbsp;Microsoft-Cyprus launched &lt;strong&gt;Momentum 2009&lt;/strong&gt;; a New Efficiency Community Launch event. &lt;br /&gt;&lt;br /&gt;The event took place in Nicosia, Cyprus, Europe, and had at around 400 attendees. Two tracks were featured: one for Developers, and another one for IT-Pros.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/SxbePGXBXKI/AAAAAAAAARU/BvOIJI1Zmz4/s1600-h/momentum2009_pic1.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" er="true" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/SxbePGXBXKI/AAAAAAAAARU/BvOIJI1Zmz4/s400/momentum2009_pic1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I had the pleasure to participate as one of the Cyprus .NET User Group (&lt;a href="http://www.cdnug.net/"&gt;CDNUG&lt;/a&gt;) speakers. &lt;br /&gt;&lt;br /&gt;The topic of my session was “&lt;strong&gt;Self-Service Business Intelligence with SQL Server 2008 R2&lt;/strong&gt;”. Actually, I talked about &lt;a href="http://powerpivot.com/"&gt;PowerPivot&lt;/a&gt; :)&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Though before the deep dive into PowerPivot and the demonstration of the unlimited power it offers, I provided a short introduction to the great SQL Server 2008 R2 features along with a first demo showcasing these features. &lt;br /&gt;&lt;br /&gt;Some of the exciting new features in &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/r2.aspx"&gt;SQL Server 2008 R2&lt;/a&gt; (November 2009 CTP) are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Connectivity to SQL Azure&lt;/li&gt;&lt;li&gt;Data-tier Application Upgrade&lt;/li&gt;&lt;li&gt;SQL Server Utility&lt;/li&gt;&lt;li&gt;Master Data Services&lt;/li&gt;&lt;li&gt;StreamInsight&lt;/li&gt;&lt;li&gt;A large number of enhancements on Reporting Services&lt;/li&gt;&lt;/ul&gt;You can find more information on the new features of SQL Server 2008 R2 Nov. CTP on this &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=89550298-d564-40c5-b586-30dc3f909f6f"&gt;link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;After the above introduction to SQL Server 2008 R2, my session got focused on the Analysis Services set of features in SQL Server 2008 R2 and more specifically on &lt;strong&gt;SQL Server PowerPivot for Excel 2010&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;So what exactly PowerPivot is?&lt;/strong&gt; &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;PowerPivot (formerly known as “Gemini”) is an add-on for Excel 2010 / SharePoint 2010 which brings the full power of SQL Server Analysis Services right into Excel. &lt;br /&gt;&lt;br /&gt;Its engine called “&lt;strong&gt;Vertipaq&lt;/strong&gt;” uses in-memory column based compression allowing millions of rows of data to be stored, sorted and aggregated. &lt;br /&gt;&lt;br /&gt;PowerPivot supports a wide variety of sources and provides the Business User with a rich set of mathematical functionally featuring the existing functions already in Excel and the powerful Data Analysis eXpressions (&lt;strong&gt;DAX&lt;/strong&gt;). &lt;br /&gt;&lt;br /&gt;You can access PowerPivot by clicking on the “&lt;strong&gt;PowerPivot&lt;/strong&gt;” button on the Ribbon in Excel 2010:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/SxbbjOUX9eI/AAAAAAAAAQ0/3yxUH3W8ZTk/s1600-h/PowerPivot_Ribbon.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" er="true" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/SxbbjOUX9eI/AAAAAAAAAQ0/3yxUH3W8ZTk/s400/PowerPivot_Ribbon.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;Then, you are presented with the PowerPivot dialog:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/Sxbbnd2rLpI/AAAAAAAAAQ8/nyMesaWVdnA/s1600-h/PowerPivot_Dialog-Home.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" er="true" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/Sxbbnd2rLpI/AAAAAAAAAQ8/nyMesaWVdnA/s400/PowerPivot_Dialog-Home.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Within the PowerPivot dialog, under the “&lt;strong&gt;Home&lt;/strong&gt;” menu, you can select from a huge variety of data sources such as: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;Several providers to DBMSs&lt;/li&gt;&lt;li&gt;Text files&lt;/li&gt;&lt;li&gt;Excel workbooks&lt;/li&gt;&lt;li&gt;Reporting services&lt;/li&gt;&lt;li&gt;RSS feeds&lt;/li&gt;&lt;/ul&gt;After you select the data source(s), you can import data which is imported in tabular format.&lt;br /&gt;You can even import data from the clipboard with copy-paste!&lt;br /&gt;&lt;br /&gt;Under the “&lt;strong&gt;Table&lt;/strong&gt;” menu, you are able to manage tables’ properties along with managing the various relationships between the tables. You can also create new relationships:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/Sxbbs66YTCI/AAAAAAAAARM/WPJfiWE7TwE/s1600-h/PowerPivot_Dialog-Table.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" er="true" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/Sxbbs66YTCI/AAAAAAAAARM/WPJfiWE7TwE/s400/PowerPivot_Dialog-Table.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Under the “&lt;strong&gt;Column&lt;/strong&gt;” menu, you are able to manage the columns’ properties such as data types and format. Also, you can add new columns:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_tEowgAvs-mQ/Sxbbpv0QTpI/AAAAAAAAARE/bGe2Gm_OO2U/s1600-h/PowerPivot_Dialog-Column.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" er="true" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/Sxbbpv0QTpI/AAAAAAAAARE/bGe2Gm_OO2U/s400/PowerPivot_Dialog-Column.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After importing the data, by returning under the “&lt;strong&gt;Home&lt;/strong&gt;” menu and by clicking on the “&lt;strong&gt;PivotTable&lt;/strong&gt;” button, you are able to create Pivot Tables based on several presets. Then PowerPivot automatically switches back to the workbook (it lets you either create new sheets or use the existing ones) where you are able to easily perform aggregations and many other mathematical calculations on the data you have previously imported. &lt;br /&gt;&lt;br /&gt;This is a very basic introduction to&amp;nbsp;PowerPivot as it is within the context of the review regarding my session on Microsoft Momentum 2009. In subsequent posts, I will thoroughly explain and demonstrate all the exciting features of PowerPivot!&lt;br /&gt;&lt;br /&gt;Throughout my session many demos were performed including the following scenarios:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Import data from the clipboard with copy-paste&lt;/li&gt;&lt;li&gt;Import data from Excel workbooks&lt;/li&gt;&lt;li&gt;Import data from a SQL Server database containing &lt;strong&gt;5+ million &lt;/strong&gt;rows&lt;/li&gt;&lt;li&gt;Perform a mashing-up of data using various data sources (clipboard, excel workbooks, SQL Server database)&lt;/li&gt;&lt;/ul&gt;After importing data based on the different scenarios, aggregations were performed against the data for answering business queries. &lt;br /&gt;&lt;br /&gt;Here are some pictures taken during my session:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/Sxbeh5Lm6nI/AAAAAAAAARc/ogVXLD-Wxds/s1600-h/momentum2009_pic2.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" er="true" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/Sxbeh5Lm6nI/AAAAAAAAARc/ogVXLD-Wxds/s400/momentum2009_pic2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tEowgAvs-mQ/SxbexTU4_dI/AAAAAAAAARk/9m0fOazWHZE/s1600-h/momentum2009_pic3.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" er="true" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/SxbexTU4_dI/AAAAAAAAARk/9m0fOazWHZE/s400/momentum2009_pic3.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tEowgAvs-mQ/SxbfD1tMVlI/AAAAAAAAARs/0vT34imLB64/s1600-h/momentum2009_pic4.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" er="true" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/SxbfD1tMVlI/AAAAAAAAARs/0vT34imLB64/s400/momentum2009_pic4.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/SxbfXHxg86I/AAAAAAAAAR0/OSDOCUG5ffY/s1600-h/momentum2009_pic5.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" er="true" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/SxbfXHxg86I/AAAAAAAAAR0/OSDOCUG5ffY/s400/momentum2009_pic5.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tEowgAvs-mQ/Sxbfm_BV5EI/AAAAAAAAAR8/YLVkSA3WPfI/s1600-h/momentum2009_pic6.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" er="true" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/Sxbfm_BV5EI/AAAAAAAAAR8/YLVkSA3WPfI/s400/momentum2009_pic6.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;PowerPoint Presentation&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Please find below the PowerPoint presentation of my session at Momentum 2009:&lt;br /&gt;&lt;div id="__ss_2635652" style="text-align: left; width: 425px;"&gt;&lt;a href="http://www.slideshare.net/artemakis/selfservice-business-intelligence-with-sql-server-2008-r2" style="display: block; font: 14px Helvetica, Arial, Sans-serif; margin: 12px 0px 3px; text-decoration: underline;" title="Self-Service Business Intelligence With SQL Server 2008 R2"&gt;Self-Service Business Intelligence With SQL Server 2008 R2&lt;/a&gt;&lt;object height="355" style="margin: 0px;" width="425"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=self-servicebiwithsqlserver2008r2-artemakisartemiou-091202153633-phpapp01&amp;stripped_title=selfservice-business-intelligence-with-sql-server-2008-r2" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=self-servicebiwithsqlserver2008r2-artemakisartemiou-091202153633-phpapp01&amp;stripped_title=selfservice-business-intelligence-with-sql-server-2008-r2" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;div style="font-family: tahoma, arial; font-size: 11px; height: 26px; padding-top: 2px;"&gt;View more &lt;a href="http://www.slideshare.net/" style="text-decoration: underline;"&gt;documents&lt;/a&gt; from &lt;a href="http://www.slideshare.net/artemakis" style="text-decoration: underline;"&gt;artemakis&lt;/a&gt;.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;CDNUG Presence&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;CDNUG presence on the event was strong! We had a special “CDNUG Area” where developers could sign-up with the User Group. Many people expressed interest on the activities of our User Group. The feeling was great! :)&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;Remarks&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;The event was definitely a huge success thanks to the great organization of Microsoft and the rich and high-quality content delivered by all the speakers. CDNUG participated by delivering three sessions on the Developers track. You can find&amp;nbsp;the full review of our User Group’s participation on the &lt;a href="http://www.cdnug.net/Events/Past/MicrosoftMomentum2009.aspx"&gt;CDNUG&lt;/a&gt; website along with a description of the entire Developers track.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;The “PowerPivot Experiment”&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;I have to admit that I was really looking forward to test the capabilities of SQL Server PowerPivot. Thus being a SQL Server fan, in one of my tweets, I mentioned that &lt;em&gt;I would not rest until I tried the real capabilities of PowerPivot&lt;/em&gt; :)&lt;br /&gt;&lt;br /&gt;To this end, after the event, I tried importing &lt;strong&gt;&lt;span style="color: #cc0000;"&gt;100+ Million&lt;/span&gt;&lt;/strong&gt; rows from a SQL Server Database into Excel 2010 using PowerPivot. Guess what? I did it! :)&lt;br /&gt;&lt;br /&gt;After designing a database and populating it with a total of 100+ Million rows, I imported the data from its five tables into excel. It only took &lt;strong&gt;7 minutes&lt;/strong&gt; to import the data! Also, performing aggregations on the data was very fast!&lt;br /&gt;&lt;br /&gt;On one of my subsequent posts on PowerPivot, I will provide the schema of my database and a full description of entire process! &lt;br /&gt;&lt;br /&gt;Make sure you check back my blog soon for newer posts on this topic!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-5165083720984970599?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/5165083720984970599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=5165083720984970599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5165083720984970599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5165083720984970599'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/12/introduction-to-sql-server-powerpivot.html' title='Introduction to SQL Server PowerPivot - MS Momentum 2009 Session Review'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_tEowgAvs-mQ/SxbePGXBXKI/AAAAAAAAARU/BvOIJI1Zmz4/s72-c/momentum2009_pic1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-223167398824131964</id><published>2009-11-17T22:50:00.002+02:00</published><updated>2009-11-17T22:51:34.419+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='CDNUG'/><title type='text'>Microsoft Momentum 2009</title><content type='html'>In November 26th, Microsoft Cyprus will be hosting "&lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?culture=en-US&amp;amp;EventID=1032433698"&gt;Momentum 2009&lt;/a&gt;", this year's&amp;nbsp;biggest event in Cyprus.&lt;br /&gt;The event features two tracks; (i) A track for IT Professionals, and (ii) A track for Developers.&lt;br /&gt;&lt;br /&gt;On the IT Professionals track, attendees can learn on how to increase productivity using innovations in Windows 7, Windows Server 2008 R2 and Microsoft Exchange Server 2010.&lt;br /&gt;&lt;br /&gt;On the Developers track, attendees can learn about Windows 7 application development, IE 8 tips and tricks for developers, Self-service BI with SQL Server 2008 R2, SharePoint 2010 Developer Platform and the Microsoft Azure Cloud application platform. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;span class="fullpost"&gt;Cyprus .NET User Group (&lt;a href="http://www.cdnug.net/"&gt;CDNUG&lt;/a&gt;) is actively participating to this event with &lt;strong&gt;three&lt;/strong&gt; of its members presenting sessions on the Developers track! &lt;br /&gt;&amp;nbsp; &lt;br /&gt;To this end, I am happy to be participating by presenting the session with topic "&lt;strong&gt;Self-Service Business Intelligence with SQL Server 2008 R2&lt;/strong&gt;". &lt;br /&gt;&lt;br /&gt;In&amp;nbsp;my session I will talk about &lt;a href="http://www.powerpivot.com/"&gt;SQL Server PowerPivot&lt;/a&gt; for Excel 2010 (formerly codenamed “Gemini”) and show how business users can take advantage of&amp;nbsp;this great feature&amp;nbsp;and fulfill their analytical requirements efficiently and iteratively, without the need to be based on a predefined model. During the session, many live demonstrations will take place in order to see PowerPivot in action!&lt;br /&gt;&lt;br /&gt;Looking forward to seeing you all at the event!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-223167398824131964?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/223167398824131964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=223167398824131964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/223167398824131964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/223167398824131964'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/11/microsoft-momentum-2009.html' title='Microsoft Momentum 2009'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-4039319761443493802</id><published>2009-11-06T12:54:00.009+02:00</published><updated>2009-11-06T13:28:36.506+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Product Reviews'/><category scheme='http://www.blogger.com/atom/ns#' term='Red Gate'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Product Review: SQL Object Level Recovery Native</title><content type='html'>One of the many privileges of being a &lt;a href="http://www.red-gate.com/About/community_relations/friends_of_RG.htm"&gt;Friend of Red Gate, &lt;/a&gt;is that you have the chance to evaluate the company's products and provide feedback and suggestions. In this post, I provide my review for one of Red Gate's latest tools; &lt;span style="font-weight: bold;"&gt;SQL Object Level Recovery Native&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;SQL Object Level Recovery Native enables you to recover individual database objects from a native SQL Server backup file. Yes, that’s right! You do not have to restore the entire database, but you can just restore individual objects you select when “browsing” the backup files using the tool.&lt;br /&gt;&lt;br /&gt;I am sharing the experience I had with using the tool through several screenshots along with explanation of the steps involved in my test case scenario. OK, let's start!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;On the first screen by clicking on the “&lt;span style="font-weight: bold;"&gt;Select backup source&lt;/span&gt;” hyperlink, you are presented with a screen where you can select one or more SQL Server native backup files to be included in the backup sources:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_tEowgAvs-mQ/SvQBGp3w1OI/AAAAAAAAAPs/FhC2x2mUEM8/s1600-h/olrn_review_sc1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 189px;" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/SvQBGp3w1OI/AAAAAAAAAPs/FhC2x2mUEM8/s320/olrn_review_sc1.png" alt="" id="BLOGGER_PHOTO_ID_5400943066954650850" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;On this screen by clicking on the “&lt;span style="font-weight: bold;"&gt;Add Files&lt;/span&gt;” button you can select the SQL Server native backup files for choosing objects to restore from:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_tEowgAvs-mQ/SvQBG5AaDXI/AAAAAAAAAP0/myKsizWFqHc/s1600-h/olrn_review_sc2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 260px;" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/SvQBG5AaDXI/AAAAAAAAAP0/myKsizWFqHc/s320/olrn_review_sc2.png" alt="" id="BLOGGER_PHOTO_ID_5400943071017438578" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In my test case scenario I used the “&lt;span style="font-weight: bold;"&gt;master&lt;/span&gt;” and “&lt;span style="font-weight: bold;"&gt;bikes&lt;/span&gt;” database backup files, as you can see on the next screen. After adding the backup files you want, in the “&lt;span style="font-weight: bold;"&gt;Available Backups&lt;/span&gt;” table you are presented with the backups you can use and which exist within the selected native SQL Server backup files (more than one backup may exist in the backup file as you might have appended more than one within the same backup file).&lt;br /&gt;&lt;br /&gt;At this point you have to note that you can only select a single backup at-a-time for restoring objects from. In my example, I chose the bikes backup taken on October 1, 2009:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_tEowgAvs-mQ/SvQBHBm9MLI/AAAAAAAAAP8/d8AYjLz9stM/s1600-h/olrn_review_sc3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 260px;" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/SvQBHBm9MLI/AAAAAAAAAP8/d8AYjLz9stM/s320/olrn_review_sc3.png" alt="" id="BLOGGER_PHOTO_ID_5400943073326608562" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Then, it is the most important screen of all; &lt;span style="color: rgb(0, 102, 0);"&gt;selecting the objects for recovery!&lt;/span&gt; In this example I selected the “&lt;span style="font-weight: bold;"&gt;Category&lt;/span&gt;” table. On the right of the screen, you are presented with schema and data (where available) previews for each object you focus on. This helps you easily understand what object you are looking for (if you do not know already! :)&lt;br /&gt;&lt;br /&gt;So as said, I chose the “Category” table. This screen shows the schema preview for this table:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tEowgAvs-mQ/SvQBHZHrirI/AAAAAAAAAQE/EHuRz_H0dZo/s1600-h/olrn_review_sc4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 189px;" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/SvQBHZHrirI/AAAAAAAAAQE/EHuRz_H0dZo/s320/olrn_review_sc4.png" alt="" id="BLOGGER_PHOTO_ID_5400943079637879474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;And this screen shows the data preview for the same table:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_tEowgAvs-mQ/SvQBHo2RqWI/AAAAAAAAAQM/XdFaETIJ1PE/s1600-h/olrn_review_sc5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 189px;" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/SvQBHo2RqWI/AAAAAAAAAQM/XdFaETIJ1PE/s320/olrn_review_sc5.png" alt="" id="BLOGGER_PHOTO_ID_5400943083859847522" border="0" /&gt;&lt;/a&gt;At the bottom of the above screen there are two buttons. If you click on the “&lt;span style="font-weight: bold;"&gt;View Recovery Script&lt;/span&gt;” button you will be provided with a generated script which creates a DDL script for the object(s) you selected for recovery and also a DML script for recovering the data contained within the object (in the case the selected object is a table).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_tEowgAvs-mQ/SvQBkZMxnrI/AAAAAAAAAQs/0wzZ0dyJgvg/s1600-h/olrn_review_sc6.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 289px; height: 320px;" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/SvQBkZMxnrI/AAAAAAAAAQs/0wzZ0dyJgvg/s320/olrn_review_sc6.png" alt="" id="BLOGGER_PHOTO_ID_5400943577875455666" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;If you click on the “&lt;span style="font-weight: bold;"&gt;Recover Objects&lt;/span&gt;” button, you are presented with the following screen. The screen contains the object(s) to be recovered (you can select more than one object), and the necessary fields for specifying the destination database. To this end, you have to complete the &lt;span style="color: rgb(0, 0, 153);"&gt;SQL Server/Instance name&lt;/span&gt;, the &lt;span style="color: rgb(0, 0, 153);"&gt;authentication method/credentials&lt;/span&gt;, and the &lt;span style="color: rgb(0, 0, 153);"&gt;destination database&lt;/span&gt;. In this example I am using an instance of SQL Server 2008 on my localhost named “&lt;span style="color: rgb(0, 153, 0);"&gt;SQL2008&lt;/span&gt;”, &lt;span style="color: rgb(0, 153, 0);"&gt;windows authentication&lt;/span&gt; and I chose to restore the “&lt;span style="color: rgb(0, 153, 0);"&gt;Category&lt;/span&gt;” table into the “&lt;span style="color: rgb(0, 153, 0);"&gt;SampleDB&lt;/span&gt;” database.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tEowgAvs-mQ/SvQBkVeTGSI/AAAAAAAAAQk/xUViRIt0aDg/s1600-h/olrn_review_sc7.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 315px; height: 320px;" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/SvQBkVeTGSI/AAAAAAAAAQk/xUViRIt0aDg/s320/olrn_review_sc7.png" alt="" id="BLOGGER_PHOTO_ID_5400943576875211042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;When clicking on the “&lt;span style="font-weight: bold;"&gt;Recover&lt;/span&gt;” button, the object recovery process takes place and after it finishes, you are presented with a summary of the process outcome (note: if the specific object already exists on the destination you will get a relevant error message).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tEowgAvs-mQ/SvQBkPfgFsI/AAAAAAAAAQc/UQ-gRyeYr_Y/s1600-h/olrn_review_sc8.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 318px;" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/SvQBkPfgFsI/AAAAAAAAAQc/UQ-gRyeYr_Y/s320/olrn_review_sc8.png" alt="" id="BLOGGER_PHOTO_ID_5400943575269643970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;OK, it is time to check within SQL Server Management Studio to see if the object exists on the database and it is operational. As you can see on the following screenshot, of course it is! :)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tEowgAvs-mQ/SvQBj2pxBgI/AAAAAAAAAQU/8pECTgR8sWM/s1600-h/olrn_review_sc9.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 189px;" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/SvQBj2pxBgI/AAAAAAAAAQU/8pECTgR8sWM/s320/olrn_review_sc9.png" alt="" id="BLOGGER_PHOTO_ID_5400943568601810434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline; font-weight: bold;"&gt;Remarks&lt;/span&gt;&lt;br /&gt;I am quite sure that many times in the life of a DBA or Database Developer, specific objects were needed to be restored from a backup file. SQL Object Level Recovery Native allows recovering individual database objects without needing to restore the entire database backup.&lt;br /&gt;&lt;br /&gt;I find this useful and cool!&lt;br /&gt;&lt;br /&gt;The SQL Server native backup files supported by the tool are these of SQL Server 2000, 2005 and 2008.&lt;br /&gt;&lt;br /&gt;For more information on  SQL Object Level Recovery Native please visit &lt;a href="http://www.red-gate.com/Products/SQL_OLR_Native/index.htm"&gt;this&lt;/a&gt; link.&lt;br /&gt;&lt;br /&gt;I hope you find this review useful!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-4039319761443493802?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/4039319761443493802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=4039319761443493802' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4039319761443493802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4039319761443493802'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/11/product-review-sql-object-level.html' title='Product Review: SQL Object Level Recovery Native'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_tEowgAvs-mQ/SvQBGp3w1OI/AAAAAAAAAPs/FhC2x2mUEM8/s72-c/olrn_review_sc1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-7685992221490429226</id><published>2009-11-01T21:14:00.002+02:00</published><updated>2009-11-01T21:27:14.346+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Event Reviews'/><category scheme='http://www.blogger.com/atom/ns#' term='INETA'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Azure'/><category scheme='http://www.blogger.com/atom/ns#' term='CDNUG'/><title type='text'>CDNUG Event Review - October 27, 2009 - Visual Studio 2010 Beta / Windows Azure Platform</title><content type='html'>Another great CDNUG event took place last Tuesday, October 27, 2009 at Microsoft-Cyprus.&lt;br /&gt;This event was "celebratory" as it was the first offline event after summer holidays.&lt;br /&gt;&lt;br /&gt;Of course summer was not an idle time. It was rather a great period of online events, and more specifically Live Webcasts!&lt;br /&gt;&lt;br /&gt;Among other, in July 29, I delivered a talk on the new Programmability features in SQL Server 2008 and more specifically about the T-SQL Enhancements (&lt;a href="http://aartemiou.blogspot.com/2009/08/webcast-on-sql-server-2008-t-sql.html"&gt;Review&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Additionally I had the pleasure to participate to the &lt;a href="http://24hours.sqlpass.org"&gt;24 Hours of PASS&lt;/a&gt;, and &lt;a href="http://www.rnathan.com/index5.htm"&gt;MY-TG SQL Server Community Series&lt;/a&gt; as a speaker, delivering Live Webcasts on ADO .NET Data Services (&lt;a href="http://aartemiou.blogspot.com/2009/10/24-hours-of-pass-session-review-18-ado.html"&gt;Review&lt;/a&gt;) and Sync Framework respectively (&lt;a href="http://aartemiou.blogspot.com/2009/10/my-tg-sql-server-community-series.html"&gt;Review&lt;/a&gt;) and thus representing Cyprus .NET User Group (CDNUG)!&lt;br /&gt;&lt;br /&gt;Due to the nature of this event, we had two great sessions delivered by two great speakers! In the first session, Karl Davies-Barrett, Developer Platform Evangelist at Microsoft Malta &amp;amp; Cyprus and great friend of CDNUG, talked about Microsoft Visual Studio 2010 Beta 2 and demonstrated many of its great new features. In the second session, Luka Debeljak, CEE DPE Regional Technical Lead at Microsoft Corporation, introduced to us the Microsoft Windows Azure Platform from a developer’s perspective.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Microsoft Visual Studio 2010 provides the .NET developer with a huge variety of new enhancements in areas such as: Application Lifecycle Management, Developer Experience, Cloud Development, Web Development and last but not least, Parallel Programming.&lt;br /&gt;&lt;br /&gt;In his session, Karl talked about all these features and with the use of some really interesting demos, showed us how the developer can take advantage of these features and thus, have a fantastic development experience!&lt;br /&gt;&lt;br /&gt;Right after Karl's session, we moved on with the introduction to the Windows Azure Platform by Luka!&lt;br /&gt;&lt;br /&gt;Windows Azure is a new, cloud services Microsoft Operating System that serves as the development, service hosting and service management environment for the Windows Azure platform. The Windows Azure platform offers an intuitive, reliable and powerful platform for the creation of web applications and services. The Windows Azure platform is comprised of Windows Azure: an operating system as a service; SQL Azure: a fully relational database in the cloud; and .NET Services: consumable web-based services that provide both secure connectivity and federated access control for applications.&lt;br /&gt;&lt;br /&gt;Luka talked about the Microsoft Windows Azure Platform and also provided information regarding all the services currently offered for hosting/management on the platform. To this end, we were presented many live demos of SQL Azure and .NET Services. Luka also demonstrated how we can develop .NET applications for hosting on the Windows Azure Platform using the Windows Azure tools for Visual Studio. The development environment for the demos was Microsoft Visual 2010 something which proved that it was a really great idea hosting these two sessions within a single event!&lt;br /&gt;&lt;br /&gt;A BIG thank you to Karl Davies-Barrett and Luka Debeljak for delivering these two really interesting sessions to our User Group. Thanks for supporting CDNUG!&lt;br /&gt;&lt;br /&gt;For event pics and other information please visit &lt;a href="http://www.cdnug.net/Events/Past/EventOctober2009.aspx"&gt;CDNUG&lt;/a&gt; website!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-7685992221490429226?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/7685992221490429226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=7685992221490429226' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7685992221490429226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7685992221490429226'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/11/cdnug-event-review-october-27-2009.html' title='CDNUG Event Review - October 27, 2009 - Visual Studio 2010 Beta / Windows Azure Platform'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-7614217964498836662</id><published>2009-10-19T00:14:00.008+03:00</published><updated>2009-10-19T01:00:22.923+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='INETA'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Azure'/><category scheme='http://www.blogger.com/atom/ns#' term='CDNUG'/><title type='text'>Upcoming CDNUG Event, October 27, 2009 - Visual Studio 2010 Beta / Windows Azure Platform</title><content type='html'>Time for another Cyprus .NET User Group (&lt;a href="http://www.cdnug.net/"&gt;CDNUG&lt;/a&gt;) offline event!&lt;br /&gt;&lt;br /&gt;This is the first offline event right after the summer holidays and we decided to make it special; it features two great speakers and two great topics! To this end we have the pleasure to host two hourly sessions on two very interesting technologies.&lt;br /&gt;&lt;br /&gt;In the first session, Karl Davies-Barrett, Developer Platform Evangelist at Microsoft Malta &amp;amp; Cyprus and great friend of CDNUG, will talk about &lt;a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx"&gt;Microsoft Visual Studio 2010 Beta&lt;/a&gt; and will demonstrate all of its great new features.&lt;br /&gt;&lt;br /&gt;In the second session, Luka Debeljak, CEE DPE Regional Technical Lead at Microsoft Corporation, will introduce to us the &lt;a href="http://www.microsoft.com/windowsazure/developers/"&gt;Microsoft Windows Azure Platform&lt;/a&gt; from a developer’s perspective.&lt;br /&gt;&lt;br /&gt;See below for event-specific details:&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Topic 1: Introducing Visual Studio 2010 Beta&lt;/span&gt;&lt;br /&gt;Speaker: Karl Davies-Barrett (Developer Platform Evangelist, Microsoft Malta &amp;amp; Cyprus)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Topic 2: An introduction to the Windows Azure Platform&lt;/span&gt;&lt;br /&gt;Speaker: Luka Debeljak (CEE DPE Regional Technical Lead, Microsoft Corporation)&lt;br /&gt;&lt;br /&gt;When: &lt;span style="font-weight: bold;"&gt;Tuesday, October 27, 2009.&lt;/span&gt;&lt;br /&gt;Time: 19:00 (GMT + 2) - Cyprus Local Time&lt;br /&gt;Duration: 120 minutes&lt;br /&gt;Where: Microsoft Office (11 Limassol Avenue, Nicosia)&lt;br /&gt;&lt;br /&gt;Registration: Click on &lt;a href="http://tech.groups.yahoo.com/group/CDNUG/surveys?id=2239219"&gt;this&lt;/a&gt; link.&lt;br /&gt;For more details check our website at &lt;a href="http://www.cdnug.net/"&gt;http://www.cdnug.net&lt;/a&gt;&lt;br /&gt;------------------------------------------------------&lt;br /&gt;&lt;br /&gt;If it happens and you are in Cyprus, you are more than welcome to attend this special event!!!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-7614217964498836662?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/7614217964498836662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=7614217964498836662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7614217964498836662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7614217964498836662'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/10/upcoming-cdnug-event-october-27-2009.html' title='Upcoming CDNUG Event, October 27, 2009 - Visual Studio 2010 Beta / Windows Azure Platform'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-2006227767086891525</id><published>2009-10-11T23:44:00.008+03:00</published><updated>2009-10-12T00:08:28.521+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Service Pack'/><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>Saving maintenance plan failed</title><content type='html'>If you encounter the above error message when trying to save a maintenance plan you created using the the wizard in SQL Server 2005 Management Studio (SSMS), the first (obvious) thing you should try, is to check if the latest service pack is installed and if it is not then install it!&lt;br /&gt;&lt;br /&gt;You can check out &lt;a href="http://aartemiou.blogspot.com/2009/01/sql-server-2005-service-packs.html"&gt;one of my past posts&lt;/a&gt; on how to find out which service pack is currently installed on your SQL Server 2005 instance and on how to get the latest service pack.&lt;br /&gt;&lt;br /&gt;However, if you are still experiencing the same problem, even in the case you have installed the latest service pack, then you can try running the sql script called "&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;sysdbupg.sql&lt;/span&gt;" which can be found in the SQL Server installation directory under the subfolder "&lt;span style="font-weight: bold;"&gt;install&lt;/span&gt;".&lt;sql&gt;&lt;instance&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;This script upgrades the system database stored procedures from the RTM level. Databases which may be upgraded are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;master&lt;/li&gt;&lt;li&gt;model&lt;/li&gt;&lt;li&gt;msdb&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Make sure before trying to execute the above script, to backup the aforementioned system databases!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A big thanks to my good friend Ioannis for bringing this hint to my attention!&lt;/span&gt;&lt;/instance&gt;&lt;/sql&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-2006227767086891525?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/2006227767086891525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=2006227767086891525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2006227767086891525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2006227767086891525'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/10/saving-maintenance-plan-failed.html' title='Saving maintenance plan failed'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-2101244869458187525</id><published>2009-10-01T22:01:00.016+03:00</published><updated>2009-11-01T21:29:36.443+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='ADO .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Event Reviews'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Compact 3.5'/><title type='text'>MY-TG SQL Server Community Series‏ - Session Review (Sync Framework)</title><content type='html'>On September 19, 2009, I delivered a session with topic the Microsoft Sync Framework, during the &lt;a href="http://positivekingdom.info/"&gt;Mysore SQL Server Community Series&lt;/a&gt;. The exact topic was: “&lt;span style="font-weight: bold; font-style: italic;"&gt;Flexible data synchronization with Microsoft Sync Framework&lt;/span&gt;”.&lt;br /&gt;&lt;br /&gt;Further below I provide a short review for my session and I also provide the PowerPoint presentation along with the source code (C#) of my demos.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;The problem domain&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;In the modern age of Information Technology many businesses have operations demanding a large number of their employees to work outside the office in remote locations but still being able to access corporate data. To this end, the ability to support mobile and remote workers is becoming more and more important for organizations every day.&lt;br /&gt;&lt;br /&gt;It is very critical that organizations ensure users have access to the same information they have when they are in the office. Usually these workers have laptops, smartphones or PDAs. From these devices, users need to have access to their organization’s data which is usually stored in a central Database Server.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The old approach&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;The traditional way based on which mobile and remote workers access information is usually by using a VPN connection or a similar technique. Of course, in the case the connection is broken or it is not available, then there is also a disruption to the operation the worker performs. Someone may argue with that and say that there is always a way of establishing a network connection to the company. That would be great but common practice proves the opposite. It is not rare at all for communications to face problems thus leaving remote workers without access to their organization’s data. Even a short disruption to an established connection between a remote/mobile worker and the organization’s central Database can cause data integrity problems.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Introducing Microsoft Sync Framework&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/sync/default.aspx"&gt;Microsoft Sync Framework&lt;/a&gt; offers a solution to the problem of supporting mobile and remote workers to continue to access their data, even in the absence of a direct connection to the corporate database. To this end, Occasionally Connected Applications (OCAs) are introduced. An OCA stores the data is on the user’s device. Data is usually stored in a SQL Server Compact Edition database. This technology, allows remote workers to continue accessing their data regardless the case where a network connection is present or not.&lt;br /&gt;&lt;br /&gt;In order to populate the user’s local database, an OCA will need to include some Data Synchronization capabilities. Data Synchronization consists of the ability to periodically take information that is stored in the client database (such as SQL Server Compact) and synchronize changes with a server database (such as SQL Server).&lt;br /&gt;&lt;br /&gt;The main advantage of a synchronization-based solution is that users are not longer required to have a constant network connection to corporate Database. In addition to this, the speed on which users can access the data is not any more relied on the network speed but only on the local device’s processing speed which of course, is much higher than any network speed.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why use the Microsoft Sync Framework?&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Someone might ask; “&lt;span style="font-style: italic;"&gt;Why use a framework for this purpose?&lt;/span&gt;”&lt;br /&gt;&lt;br /&gt;The answer to this question is relatively easy. First of all, synchronization is a difficult task. It introduces the not so trivial tasks of data conflicts detection and resolution when data is communicated from the corporate Database to the local data store on the user’s device and vice versa.  Also when data synchronization is used, interruptions and restarts have to be handled in an efficient way. Furthermore, deleted items and synchronization loops are need to be managed as well.&lt;br /&gt;&lt;br /&gt;Microsoft Sync Framework takes care of all the data synchronization issues and among many other enhancements, it allows the developer to easily parameterize an OCA implementation in order to control how data conflicts are detected and resolved.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sync Framework Runtime and Main Components&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Sync Framework introduces two basic components:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Synchronization providers (source &amp;amp; destination)&lt;/li&gt;&lt;li&gt;Synchronization session&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The source and destination synchronization providers determine the source replica and the destination replica.&lt;br /&gt;&lt;br /&gt;The synchronization session is the component which actually controls and coordinates the entire data synchronization process between the two providers.&lt;br /&gt;&lt;br /&gt;It is important to note that Sync Framework not only allows performing data synchronization between databases, but also allows synchronizing files/folders as well as RSS and ATOM feeds.&lt;br /&gt;&lt;br /&gt;The supplied synchronization providers are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Sync Services for ADO.NET&lt;/li&gt;&lt;li&gt;Sync Services for File Systems&lt;/li&gt;&lt;li&gt;Sync Services for FeedSync (RSS &amp;amp; ATOM feeds)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;You can also author your own provider, but it is recommended to use the supplied providers whenever possible thus reusing tested code and easier implementing your data synchronization solution.&lt;br /&gt;&lt;br /&gt;The following figure illustrates the Runtime of Sync Framework:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tEowgAvs-mQ/SsT-O9qJL6I/AAAAAAAAAPk/sFq2A5Gx_iw/s1600-h/Sync+Framework+Runtime.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 133px;" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/SsT-O9qJL6I/AAAAAAAAAPk/sFq2A5Gx_iw/s320/Sync+Framework+Runtime.png" alt="" id="BLOGGER_PHOTO_ID_5387710587264905122" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Explanation of the Runtime components:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Data Source&lt;/span&gt;: The location that stores all the information that needs to be synchronized. It can be a relational database, a file system, a Web Service, or even a custom data source.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Metadata&lt;/span&gt;: Information about the data store and the objects within that data store with respect to state and change information. It can be stored anywhere. For making it easy for the developer, Microsoft Sync Framework offers a complete implementation of a metadata store.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Sync Service Provider&lt;/span&gt;:  A synchronization provider for ADO.NET, File Systems, FeedSync (RSS &amp;amp; ATOM feeds) or even a custom provider.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Sync Session&lt;/span&gt;: Creates a link from the source to the provider and controls the entire synchronization flow.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Synchronization Flow&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;The synchronization flow is the following:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Sync Session Initiated with Destination&lt;/li&gt;&lt;li&gt;Destination Prepares and Sends Knowledge&lt;/li&gt;&lt;li&gt;Destination Knowledge used to Determine Changes to be sent&lt;/li&gt;&lt;li&gt;Change Versions and Source Knowledge sent to Destination&lt;/li&gt;&lt;li&gt;Local Version Retrieved for Change Items and Compared against Source Version and Knowledge&lt;/li&gt;&lt;li&gt;Conflicts are Detected and Resolved or Deferred&lt;/li&gt;&lt;li&gt;Destination Requests Item Data from Source&lt;/li&gt;&lt;li&gt;Source Prepares and Sends Item Data&lt;/li&gt;&lt;li&gt;Items are applied at Destination&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;For more information regarding the Sync Framework Runtime please visit the following MSDN &lt;a href="http://msdn.microsoft.com/en-us/sync/bb821992.aspx"&gt;Link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Synchronization Scenarios&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;There are many synchronization scenarios which can be easily implemented using the MS Sync Framework. To this end you can do the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Synchronize Databases&lt;/li&gt;&lt;li&gt;Synchronize two file system locations (i.e. Multi-master file sync between multiple PCs, Synchronization between PCs using a USB Drive, Taking a network share offline, Maintaining a backup copy of files)&lt;/li&gt;&lt;li&gt;Synchronize Web Feeds (RSS and ATOM)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;You can also implement many other scenarios as the Sync Framework is very extensible and allows you to develop and use your own components such as: Synchronization Providers, metadata stores, custom data stores, etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PowerPoint Presentation&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Please find below my PowerPoint presentation for this session.&lt;br /&gt;&lt;br /&gt;&lt;div style="width: 425px; text-align: left;" id="__ss_2105874"&gt;&lt;a style="margin: 12px 0pt 3px; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; display: block; text-decoration: underline;" href="http://www.slideshare.net/artemakis/flexible-data-synchronization-with-microsoft-sync-framework" title="Flexible Data Synchronization with Microsoft Sync Framework"&gt;Flexible Data Synchronization with Microsoft Sync Framework&lt;/a&gt;&lt;object style="margin: 0px;" height="355" width="425"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=syncframeworkartemakisartemioumvp-091001135749-phpapp02&amp;amp;stripped_title=flexible-data-synchronization-with-microsoft-sync-framework"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=syncframeworkartemakisartemioumvp-091001135749-phpapp02&amp;amp;stripped_title=flexible-data-synchronization-with-microsoft-sync-framework" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="355" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;"&gt;View more &lt;a style="text-decoration: underline;" href="http://www.slideshare.net/"&gt;documents&lt;/a&gt; from &lt;a style="text-decoration: underline;" href="http://www.slideshare.net/artemakis"&gt;artemakis&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Source Code for Demos&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Please find below the source code for my demos.&lt;br /&gt;&lt;br /&gt;Development Environment/Prerequisites:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=83C3A1EC-ED72-4A79-8961-25635DB0192B&amp;amp;displaylang=en"&gt;Visual Studio 2008 SP1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&amp;amp;displaylang=en"&gt;.NET Framework 3.5 SP1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/try-it.aspx"&gt;SQL Server 2008 SP1&lt;/a&gt; (used for hosting the Central Database)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/Downloads/details.aspx?FamilyID=dc614aee-7e1c-4881-9c32-3a6ce53384d9&amp;amp;displaylang=en"&gt;SQL Server Compact 3.5 SP1&lt;/a&gt; (used for hosting the client’s local data store)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=89adbb1e-53ff-41b5-ba17-8e43a2e66254&amp;amp;displaylang=en"&gt;Sync Framework 2.0 CTP2&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Demo 1: Creating a Sync Ecosystem from Scratch (Databases)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Summary&lt;/span&gt;: In this demo, my source replica is a SQL Server 2008 database called “&lt;span style="font-weight: bold;"&gt;SyncServerDB&lt;/span&gt;” which represents the Central Database. The destination replica is a Windows Forms Application (role: client) developed in Visual Studio 2008 SP1 which used SQL Server 3.5 Compact Edition SP1 for hosting the local data store. The Windows Forms Application allows the user to synchronize the client with the central database via a GUI form.&lt;br /&gt;&lt;br /&gt;Download link for &lt;a href="http://ds32fw.blu.livefilestore.com/y1p-fvLO2Gad7x3AsMHCCulG6kZxycqTGZ5JPQedD9ggQPuvWpxPhDsjScoJEJL1fIuzNC3Vhqq6OJ2ECAWJxB3xVdNMEDZIWTB/Sync%20Framework%20-%20MY-TG%20Session%20-%20Create%20Database.sql?download"&gt;source database&lt;/a&gt;.&lt;br /&gt;Download link for &lt;a href="http://ds32fw.blu.livefilestore.com/y1pj-Lre1UPwM5tPPjMJ9p-Ekc8PFFGRNLknO6QznsygFYl5TYMbkDI30-QtXYEfFTKo9q9GLn5RlFab7DBC4zrKzmOuMeQ40Qm/demo1_live.zip?download"&gt;demo 1 source code&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Before&lt;/span&gt; using the code, you have to reinitialize it. You can follow the instructions in &lt;a href="http://ds32fw.blu.livefilestore.com/y1pzLiPd963lvWHSMQILwqGbGQNcBVfMTv8-LsNdtfOgziuNqgmg4-3twDzrTouZJzgjYIm6jConeiD6z-sDYQ53jbu2mnptt-i/Instructions%20for%20resetting%20the%20sample%20source%20code%20for%20demo%201.pdf?download"&gt;this document&lt;/a&gt; for doing this.&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Demo 2: Synchronizing Files&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Summary&lt;/span&gt;: In this demo I used the Sync Framework for synchronizing the contents of two folders on my local hard drive in a bidirectional manner.&lt;br /&gt;&lt;br /&gt;Details regarding the folders: Make sure you create two folders called “source” and “dest” in the “Debug” folder for this Visual Studio project. Also before running the executable project, make sure you place a sample file in one of the folders in order to see after the program’s execution that the two folders were successfully synchronized.&lt;br /&gt;&lt;br /&gt;Download link for &lt;a href="http://ds32fw.blu.livefilestore.com/y1pSbFCLR4-IueKsprFs8Rbs-ihoYAM4EnSWZpWdCkmymNQkC_ubtw4rNU9OB8VUli4SQJ4mR5SBq-F9My3Ohh2bhhTA5y4hywd/demo2_live.zip?download"&gt;demo 2 source code&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;* Disclaimer: The source code for the demos is intended to be used only for demo purposes. Do not use it for Production systems as it is simplified for demo purposes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Summary&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;This session gave me the chance to use again the Microsoft Sync Framework. All I can say is that it was a great experience. I am actually thinking of implementing some tools using the Framework and place it to &lt;a href="http://www.codeplex.com/"&gt;CodePlex&lt;/a&gt;. I will be posting updates to my blog regarding this as well.&lt;br /&gt;&lt;br /&gt;Summing up this review, I would like to say that by using the MS Sync Framework it is very easy to implement Data Synchronization for a large variety of scenarios. With all the built-in functionality you are enabled to do more with less! Additionally, you can create your own custom components and cover even more synchronization scenarios.&lt;br /&gt;&lt;br /&gt;Sync Framework enables the developer to easily built Occasionally Connected Systems and Sync Ecosystems by providing among other efficient conflict handling and a flexible Synchronization Algorithm. Furthermore, Sync Framework Supplied Providers can be widely used for different scenarios.&lt;br /&gt;&lt;br /&gt;I see the future regarding Sync Framework as just great! In plain words: Sync Services on the Cloud!  The project codename "&lt;a href="http://www.microsoft.com/azure/huron.mspx"&gt;Huron&lt;/a&gt;" enables a Sync Enabled Cloud Data Hub! Find out more on the following &lt;a href="http://www.microsoft.com/azure/huron.mspx"&gt;link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I would like to thank the Mysore SQL Server PASS Chapter committee for inviting me to present to this great SQL Server community series! It was a pleasure to present and discuss about SQL Server and its related .NET technologies.&lt;br /&gt;&lt;br /&gt;Drop me a line if you have any comments!&lt;br /&gt;&lt;br /&gt;See you at another event soon!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-2101244869458187525?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/2101244869458187525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=2101244869458187525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2101244869458187525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2101244869458187525'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/10/my-tg-sql-server-community-series.html' title='MY-TG SQL Server Community Series‏ - Session Review (Sync Framework)'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_tEowgAvs-mQ/SsT-O9qJL6I/AAAAAAAAAPk/sFq2A5Gx_iw/s72-c/Sync+Framework+Runtime.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-267489391890647852</id><published>2009-10-01T18:11:00.017+03:00</published><updated>2009-11-01T21:28:44.758+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='ADO .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Event Reviews'/><category scheme='http://www.blogger.com/atom/ns#' term='PASS'/><title type='text'>24 Hours of PASS – Session Review (18 - ADO .NET Data Services)</title><content type='html'>On September 2, 2009, I had the pleasure to deliver a session on ADO .NET Data Services, during that great SQL Server Marathon; &lt;a href="http://24hours.sqlpass.org/"&gt;24 Hours of PASS&lt;/a&gt;! This great event was a series of 24 non-stop live, free webcasts dedicated to pure SQL Server knowledge. The exact topic of my session was: “&lt;span style="font-style: italic; font-weight: bold;"&gt;Building Flexible Data Services for the Web Using the ADO .NET Data Services Framework&lt;/span&gt;”. Yes, it is true; it was the longest titled session of the event :)&lt;br /&gt;&lt;br /&gt;Further below I provide a short review for my session and I also provide the PowerPoint presentation along with the DB scripts and source code (C#) of my demos.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;The problem domain&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Many applications, and especially web applications, face a set of problems in today’s environments. For example, it is difficult to identify the different types of clients and users accessing these web applications. Each different client has its own particularities which make it difficult, if not impossible, for web applications to perfectly work with all these types of clients. This requires different web methods for each client, different paging and filtering techniques and so on.&lt;br /&gt;&lt;br /&gt;Furthermore, during the last few years, the wide usage of the Internet enabled the massive spreading of Web Applications. To this end, a new form of web applications has emerged; the well known “Connected” applications. This new type of web applications includes Rich AJAX web applications, Flash &amp;amp; Silverlight applications, Mashups, etc. These applications need continuous feeding of data in dedicated data channels in order to be fast and efficient. They somehow require a separation of the data and presentation layers.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The old approach&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;The traditional way for enabling web applications to efficiently work with the different types of clients was to include additional logic in their code in order to cover most of the different scenarios. Though, this is not anymore an efficient way for handling the uniformity of clients which access these applications as the different types of clients are highly increased.&lt;br /&gt;&lt;br /&gt;How about using a framework that helps you develop and access data services in a uniform way?&lt;br /&gt;Such case could be really interesting…&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Introducing the Microsoft ADO .NET Data Services Framework&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;The &lt;a href="http://astoria.mslivelabs.com/"&gt;ADO.NET Data Services framework&lt;/a&gt; consists of a combination of patterns and libraries which enable the creation and consumption of data services for the web. Using the framework, it is easy to create flexible data services that are naturally integrated with the web and maintain the &lt;a href="http://www.ics.uci.edu/%7Efielding/pubs/dissertation/rest_arch_style.htm"&gt;REST&lt;/a&gt; style. To this end, URIs are used to point to pieces of data and well-known formats such as JSON and XML are used for representing that data.&lt;br /&gt;&lt;br /&gt;Interacting with your data is now uniform and easy as by using the HTTP verbs GET, PUT, POST and DELETE, you can perform any operation you like on your data.&lt;br /&gt;&lt;br /&gt;The mappings between the above HTTP verbs and the SQL language are:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tEowgAvs-mQ/SsTIVrqyfRI/AAAAAAAAAOE/BeiBHM3WoAY/s1600-h/HTTP_SQL_Commands_Mapping.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 125px;" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/SsTIVrqyfRI/AAAAAAAAAOE/BeiBHM3WoAY/s320/HTTP_SQL_Commands_Mapping.png" alt="" id="BLOGGER_PHOTO_ID_5387651329066958098" border="0" /&gt;&lt;/a&gt;If you use the web, and specifically HTTP to provide and consume your data, you will find ADO.NET Data Services very interesting as by utilizing the enormous amounts of infrastructure that already exists to support HTTP due to the wide spreading of the Internet, you are able to easily build flexible and powerful data services fully supporting “Connected” applications which is nowadays the trend in web applications design.&lt;br /&gt;&lt;br /&gt;The following figure illustrates the different types of clients that access data through HTTP:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_tEowgAvs-mQ/SsTIVQGJqKI/AAAAAAAAAN8/aTZQHdNEN74/s1600-h/HTTP_clients.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 161px;" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/SsTIVQGJqKI/AAAAAAAAAN8/aTZQHdNEN74/s320/HTTP_clients.png" alt="" id="BLOGGER_PHOTO_ID_5387651321665530018" border="0" /&gt;&lt;/a&gt;You can see that there is a plethora of different clients accessing the same data through HTTP.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why Use the ADO .NET Data Services Framework?&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;The answer to this question is quite simple; as “Connected” applications (Rich AJAX web applications, Flash &amp;amp; Silverlight applications, Mashups, etc.) are the trending type of web applications, they need the corresponding data services in order to feed them with data, without affecting their presentation layer. ADO .NET Data Services allows these applications to have a dedicated data channel which allows it to be fed with data by an ADO .NET Data Service. Usually the only line of sight from these applications, is HTTP, so using the framework makes things really simple.&lt;br /&gt;&lt;br /&gt;With this technology, the data is moved out-of-band with the presentation and behavior information thus allowing the web application on the one hand not have any delays on the presentation layer, and on the other hand to have continuous access to its data source.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The architecture of an ADO .NET Data Service&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;The following figure illustrates the architecture of a data service:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_tEowgAvs-mQ/SsTIWFBNXDI/AAAAAAAAAOM/icCvUSkVi1k/s1600-h/ADO_DNDD_Architecture.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 162px;" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/SsTIWFBNXDI/AAAAAAAAAOM/icCvUSkVi1k/s320/ADO_DNDD_Architecture.png" alt="" id="BLOGGER_PHOTO_ID_5387651335871880242" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;At the very bottom of this architecture there are the relational and non-relational sources.&lt;br /&gt;Next there is the &lt;a href="http://msdn.microsoft.com/en-us/library/bb399572.aspx"&gt;ADO .NET Entity Framework&lt;/a&gt; which is used for handling the relational sources and a custom LINQ provider for handling the non-relational sources. The Data Services Runtime exists as a DLL. Next, there is the Hosting/HTTP Listener for which the out of the box implantation is WCF hosted within an ASP .NET web page (though, you can author your own listener if you like). On the very top of this architecture, there is the HTTP stack, against which you can issue HTTP commands (using the abovementioned HTTP verbs) in order to access and process your data.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Consuming a Data Service&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;The following figure illustrates the various ways available for consuming a data service implemented within the ADO .NET Data Services framework:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_tEowgAvs-mQ/SsTIWd253pI/AAAAAAAAAOU/F3e457TJX7I/s1600-h/Consuming_a_data_Service.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 158px;" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/SsTIWd253pI/AAAAAAAAAOU/F3e457TJX7I/s320/Consuming_a_data_Service.png" alt="" id="BLOGGER_PHOTO_ID_5387651342539546258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;As you can see, actually an HTTP stack is enough! Of course, if you like to access your data service using higher levels of abstractions you can use JSON &amp;amp; AtomPub clients and even easier; Windows Data Services Clients such as .NET Framework, Silverlight 2 or 3, AJAX, and so on.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Securing a Data Service&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;There are several ways available for securing a Data Service within the ADO .NET Data Services Framework.&lt;br /&gt;&lt;br /&gt;With respect to &lt;span style="font-weight: bold;"&gt;Visibility&lt;/span&gt;, you can use:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    Per-container visibility control&lt;/li&gt;&lt;li&gt;Read, Query and Write options&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;With respect to &lt;span style="font-weight: bold;"&gt;Authentication &lt;/span&gt;you can use:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Integration with hosting environment&lt;/li&gt;&lt;li&gt;ASP.NET, WCF or custom authentication schemes&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;With respect to &lt;span style="font-weight: bold;"&gt;Interceptors &lt;/span&gt;you can use:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Execution before HTTP GET/PUT/POST/DELETE&lt;/li&gt;&lt;li&gt;Enabling of validation and custom row-level security policies in order to maintain the REST style&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;With respect to &lt;span style="font-weight: bold;"&gt;Service Operators&lt;/span&gt; you can use:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Custom entry points, e.g. /MyTags?startDate='2009-09-02'&lt;/li&gt;&lt;li&gt;Composable, follow URI scheme&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PowerPoint Presentation&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Please find below my PowerPoint presentation for this session.&lt;br /&gt;&lt;br /&gt;&lt;div style="width: 425px; text-align: left;" id="__ss_2104683"&gt;&lt;a style="margin: 12px 0pt 3px; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; display: block; text-decoration: underline;" href="http://www.slideshare.net/artemakis/building-flexible-data-services-for-the-web-using-the-ado-net-data-services-framework-2104683" title="Building Flexible Data Services for the Web Using the ADO .NET Data Services Framework"&gt;Building Flexible Data Services for the Web Using the ADO .NET Data Services Framework&lt;/a&gt;&lt;object style="margin: 0px;" height="355" width="425"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=24hourspasssession18artemakisartemioumvp-091001105416-phpapp01&amp;amp;stripped_title=building-flexible-data-services-for-the-web-using-the-ado-net-data-services-framework-2104683"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=24hourspasssession18artemakisartemioumvp-091001105416-phpapp01&amp;amp;stripped_title=building-flexible-data-services-for-the-web-using-the-ado-net-data-services-framework-2104683" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="355" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;"&gt;View more &lt;a style="text-decoration: underline;" href="http://www.slideshare.net/"&gt;documents&lt;/a&gt; from &lt;a style="text-decoration: underline;" href="http://www.slideshare.net/artemakis"&gt;artemakis&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Source Code for Demos&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Please find below the source code for my demos.&lt;br /&gt;&lt;br /&gt;Development Environment/Prerequisites:&lt;br /&gt;•    &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=83C3A1EC-ED72-4A79-8961-25635DB0192B&amp;amp;displaylang=en"&gt;Visual Studio 2008 SP1&lt;/a&gt;&lt;br /&gt;•    &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&amp;amp;displaylang=en"&gt;.NET Framework 3.5 SP1&lt;/a&gt;&lt;br /&gt;•    &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/try-it.aspx"&gt;SQL Server 2008 SP1&lt;/a&gt; (used as the relational data source)&lt;br /&gt;•    &lt;a href="http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=3e3d4eaf-227b-4ad3-ad0d-3613db8aa9df&amp;amp;displaylang=en"&gt;ADO.NET Data Services v1.5 CTP1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;* For all the demos, you will have to modify the connection string in the &lt;span style="font-weight: bold;"&gt;Web.config&lt;/span&gt; file, &lt;span style="font-weight: bold;"&gt;connection string&lt;/span&gt; entry in order to point to your SQL Server 2008 instance. To this end, please replace "&lt;span style="font-weight: bold;"&gt;.\sql2008&lt;/span&gt;" with your SQL Server 2008 instance name. Also I used Windows Authentication (trusted connection) for connecting to the SQL Server Instance.&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;Download link for source &lt;a href="http://ds32fw.blu.livefilestore.com/y1pzl5YeqFVA1xuaK1PcPTNlvWQu9oxX4PORoWn7s_-FmN-H30Ek5Hwn1hSUxPTlbEf8SxKuPoLuMO_30h74_ojl-49I9OafZwz/Bikes.bak?download"&gt;database&lt;/a&gt;.&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Demo 1: Examining an ADO .NET Data Service&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Summary: In this demo, we examine a pre-built data service and see how we can interact with it using a Web Browser and an HTTP debugging tool.&lt;br /&gt;&lt;br /&gt;Download link for demo 1 (and 2) &lt;a href="http://ds32fw.blu.livefilestore.com/y1pEZjIdjIwEfH1HYLmv6vlYhhUpS615Z1sGgXccrTuIOktZrSbm8zlvjeGSZmiPXCxCkuqRa8OMD0HTUu-63QQteRnQCSlQLiI/Demo1.zip?download"&gt;source code&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Demo 2: Building a Data Service from Scratch&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Summary: In this demo I build a data service from scratch using Visual Studio 2008 SP1.&lt;br /&gt;Procedure: There is not sample code for this demo, as by completing the demo, you end up to a source code identical to the source code of demo 1.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Demo 3: Consuming a Data Service&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Summary: In this demo, in addition to the data service which was build during demo 2, I also create a .NET client (Windows Console Application in C#) within the same project for consuming the service using LINQ to Data Services (this is actually LINQ to Entities).&lt;br /&gt;&lt;br /&gt;Download link for demo 3 &lt;a href="http://ds32fw.blu.livefilestore.com/y1pEZjIdjIwEfGezo4ZO_RR3fdLOBHDu_ZmCbH7R6mbtCjIdaeExFpOiqjWHwHYCf_QcU4f9zTGhChpJFIxXUocV6E90ju7deGc/Demo3.zip?download"&gt;source code&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;* Disclaimer: The source code for the demos is intended to be used only for demo purposes. Do not use it for  Production systems as it is simplified for demo purposes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Summary&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Summing up this review, I would like to say that using ADO.NET Data Services makes it really easy to expose your data over HTTP and thus build powerful and flexible data services.&lt;br /&gt;&lt;br /&gt;Using URIs (entities and associations --&gt; resources and links), HTTP Verbs for data manipulation, and the well-known and simple formats JSON and AtomPub for data representation makes it easy to build RESTful data services with all the benefits derived by using the REST style.&lt;br /&gt;&lt;br /&gt;ADO .NET Data Services are very useful for developing AJAX &amp;amp; Silverlight Applications, Online Data Services, Mashups and much more.&lt;br /&gt;&lt;br /&gt;Of course, I could not end this review without mentioning the Cloud. Many of the Microsoft cloud services expose data using the same REST conventions as used by ADO .NET Data Services. This enables using the ADO .NET Data Services Framework not only for on premises services, but also with services hosted on the cloud!&lt;br /&gt;&lt;br /&gt;This session’s topic falls under one of my favorite Microsoft Technologies; ADO .NET - Data Access! I plan to deliver even more webcasts in the future, again dedicated to ADO .NET.&lt;br /&gt;&lt;br /&gt;I would like to thank  &lt;a href="http://www.sqlpass.org/"&gt;PASS&lt;/a&gt; for inviting me to actively participate to this great SQL Server event and congratulate all the people who made this event a smashing success!&lt;br /&gt;&lt;br /&gt;Drop me a line if you have any comments!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-267489391890647852?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/267489391890647852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=267489391890647852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/267489391890647852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/267489391890647852'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/10/24-hours-of-pass-session-review-18-ado.html' title='24 Hours of PASS – Session Review (18 - ADO .NET Data Services)'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_tEowgAvs-mQ/SsTIVrqyfRI/AAAAAAAAAOE/BeiBHM3WoAY/s72-c/HTTP_SQL_Commands_Mapping.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-8569433159788030908</id><published>2009-09-20T14:33:00.011+03:00</published><updated>2009-09-21T23:38:55.579+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Using Computed Columns in SQL Server</title><content type='html'>When it comes to database design in SQL Server, it is always recommended to create the database as flexible as possible. SQL Server provides several features for developers in order to be able to do so.&lt;br /&gt;&lt;br /&gt;An example of such a feature are the "&lt;span style="font-weight: bold;"&gt;computed&lt;/span&gt;" and "&lt;span style="font-weight: bold;"&gt;persisted&lt;/span&gt;" columns.&lt;br /&gt;As explained on &lt;a href="http://msdn.microsoft.com/en-us/library/ms191250.aspx"&gt;MSDN BOL&lt;/a&gt;,&lt;span style="font-style: italic;"&gt; &lt;/span&gt;computed columns' values are computed by expressions that can use other columns in the same table.&lt;br /&gt;&lt;br /&gt;Also, when using the PERSISTED keyword with a COMPUTED column, the data of the computed column is physically stored in the table.&lt;br /&gt;&lt;br /&gt;Let's see some code and try out this great feature!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;First let's create two tables representing product information:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;--Note the column with name "totalPrice": It is a computed column which computes&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;--the total &lt;/span&gt;price (price + VAT)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;CREATE TABLE Product1&lt;br /&gt;(&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;id int,&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;code varchar(50),&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;price float,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;vatPerc float,&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;&lt;br /&gt;totalPrice as (price+(price*(vatPerc/100)))&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;--Note again the column with name "totalPrice": It is the same computed column as in table&lt;br /&gt;--Product 1 with the difference that it uses the PERSISTED keyword.&lt;/span&gt;&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;CREATE TABLE Product2&lt;br /&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;id int,&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;code varchar(50),&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;price float,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;vatPerc float,&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;&lt;br /&gt;totalPrice as (price+(price*(vatPerc/100))) PERSISTED&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;)&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;------------ Testing Table Product1 --------------&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;INSERT INTO Product1 (id,code,price,vatPerc)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SELECT 1, 'PRODUCT01',100,15&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;UNION ALL&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;SELECT 2, 'PRODUCT02',200,15&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* I know, I could use a &lt;a href="http://msdn.microsoft.com/en-us/library/dd776382.aspx"&gt;Table Value Constructor&lt;/a&gt; (Row Constructors) but I would prefer that my  examples to be compatible with all versions of SQL Server as Table Value Constructors is one of the new programmability features in &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/programmability.aspx"&gt;SQL Server 2008&lt;/a&gt;  :)&lt;br /&gt;&lt;br /&gt;Note that in the above INSERT statement I am not inserting any values for the "totalPrice" column. Though, when taking a look at the generated results, the totalPrice values are calculated on the fly!&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SELECT *&lt;br /&gt;FROM Product1&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Results&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-------&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_tEowgAvs-mQ/SrfcDxj9ofI/AAAAAAAAANs/DP8e40SOZgE/s1600-h/sc_product1_results.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 287px; height: 83px;" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/SrfcDxj9ofI/AAAAAAAAANs/DP8e40SOZgE/s320/sc_product1_results.png" alt="" id="BLOGGER_PHOTO_ID_5384013836946612722" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Similarly, testing table Product2 will work the same way with the only difference that this time,&lt;br /&gt;the calculated values for the "totalPrice" column will be physically stored in the table:&lt;br /&gt;&lt;br /&gt;------------ Testing Table Product2 --------------&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;INSERT INTO Product2 (id,code,price,vatPerc)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SELECT 1, 'PRODUCT03',300,15&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;UNION ALL&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;SELECT 2, 'PRODUCT04',400,15&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM Product2&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Results&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-------&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_tEowgAvs-mQ/SrfcEPew8YI/AAAAAAAAAN0/DtU1cScVyrI/s1600-h/sc_product2_results.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 292px; height: 88px;" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/SrfcEPew8YI/AAAAAAAAAN0/DtU1cScVyrI/s320/sc_product2_results.png" alt="" id="BLOGGER_PHOTO_ID_5384013844977873282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;* Note: By the time you are using a Computed column you cannot explicitly insert data into it. The data is computed based on the computed column's definition (expression).&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-8569433159788030908?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/8569433159788030908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=8569433159788030908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8569433159788030908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8569433159788030908'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/09/using-computed-columns-in-sql-server.html' title='Using Computed Columns in SQL Server'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_tEowgAvs-mQ/SrfcDxj9ofI/AAAAAAAAANs/DP8e40SOZgE/s72-c/sc_product1_results.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-4196831071891180909</id><published>2009-09-19T23:26:00.006+03:00</published><updated>2009-09-27T17:35:05.043+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Red Gate'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET Tools'/><title type='text'>Friends of Red Gate</title><content type='html'>&lt;a href="http://www.red-gate.com/"&gt;Red Gate&lt;/a&gt; is a software company based in the university town of Cambridge, UK, specializing in MS SQL Server, .NET and email archiving tools.&lt;br /&gt;&lt;br /&gt;Red Gate is one of the strong supporters of the SQL Server, .NET and Exchange communities. A great example of this, are Red Gate's well-known community web sites &lt;a href="http://www.simple-talk.com/"&gt;www.simple-talk.com&lt;/a&gt; and &lt;a href="http://www.sqlservercentral.com/"&gt;www.sqlservercentral.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Red Gate, takes their relationship with the SQL Server, .NET and Exchange communities very seriously. A solid example of this, is the "&lt;a href="http://www.red-gate.com/About/community_relations/friends_of_RG.htm"&gt;Friends of Red Gate&lt;/a&gt;"  program. The program is aimed at active and influential community members who are experts and gurus in their relevant fields.&lt;br /&gt;&lt;br /&gt;Through the program, the members have the chance to use and review Red Gate's tools thus being able helping others who are having problems which could be solved using these tools.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;As a new member of the program, I am very excited to participate as I am given the chance to use these great tools, review them and provide my feedback! I am already using &lt;a href="http://www.red-gate.com/products/SQL_Prompt/index.htm"&gt;SQL Prompt 4&lt;/a&gt; and &lt;a href="http://www.red-gate.com/products/SQL_Refactor/index.htm"&gt;SQLRefactor &lt;/a&gt;and loving it!&lt;br /&gt;&lt;br /&gt;Subsequent posts will follow, reviewing and discussing Red Gate's tools mainly having to do with SQL Server and .NET Development.&lt;br /&gt;&lt;br /&gt;A big thanks to Red Gate for being a true supporter of the technical community!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-4196831071891180909?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/4196831071891180909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=4196831071891180909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4196831071891180909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4196831071891180909'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/09/friends-of-red-gate.html' title='Friends of Red Gate'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-4598663366378921998</id><published>2009-09-13T18:46:00.006+03:00</published><updated>2009-09-13T19:20:44.688+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='ADO .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access'/><category scheme='http://www.blogger.com/atom/ns#' term='PASS'/><title type='text'>Mysore PASS Chapter SQL Server Webcasts Series</title><content type='html'>&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;Newsflash:&lt;/span&gt; More free &lt;span style="font-weight: bold;"&gt;SQL Server&lt;/span&gt; training is on the way!&lt;br /&gt;&lt;br /&gt;The Mysore/Mandya Technology Group (MY-TG) organizes a series of SQL Server Webcasts which started on Saturday, September 12th, 2009 and will be taking place every Saturday for the next few weeks. To this end, every Saturday, two sessions are presented.&lt;br /&gt;&lt;br /&gt;Topics include SQL Server 2008 Administration, Development and Data Access. This is another great opportunity to learn more about trending SQL Server topics.&lt;br /&gt;&lt;br /&gt;I have the pleasure to participate as a speaker to this event on Saturday, September 19th, 2009, 12:30 - 13:30 (UTC) where I will be presenting the session with topic: "&lt;span style="font-weight: bold;"&gt;Flexible data synchronization with Microsoft Sync Framework&lt;/span&gt;".&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;In this session, among other, we will talk about the fundamentals of Data Synchronization and how we can easily build from scratch a flexible Sync Ecosystem using &lt;a href="http://bit.ly/EDkJ2"&gt;Microsoft Sync Framework 2.0 CTP2&lt;/a&gt;, thus allowing the smooth operation of an Occasionally Connected System.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://mysoresqlwebcasts.eventbrite.com/"&gt;Click here to register for this event&lt;/a&gt; and for more details please visit &lt;a href="http://positivekingdom.info/"&gt;http://positivekingdom.info&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;See you online!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-4598663366378921998?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/4598663366378921998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=4598663366378921998' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4598663366378921998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4598663366378921998'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/09/mysore-pass-chapter-sql-server-webcasts.html' title='Mysore PASS Chapter SQL Server Webcasts Series'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-8082449452539045814</id><published>2009-09-08T23:51:00.010+03:00</published><updated>2009-11-15T12:30:15.840+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ADO .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Azure'/><category scheme='http://www.blogger.com/atom/ns#' term='Cloud Computing'/><title type='text'>Accessing SQL Azure Using ADO.NET</title><content type='html'>In my first post on SQL Azure (&lt;a href="http://aartemiou.blogspot.com/2009/09/sql-azure-first-contact.html"&gt;SQL Azure: A First Contact&lt;/a&gt;) I talked about how you can access SQL Azure using SQL Server 2008 Management Studio (SSMS).&lt;br /&gt;&lt;br /&gt;In this post, the journey continues with “walking” on the cloud using &lt;span style="font-weight: bold;"&gt;ADO .NET&lt;/span&gt; :)&lt;br /&gt;&lt;br /&gt;Here’s the recipe!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;span style="font-weight: bold;"&gt;Ingredients&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A valid SQL Azure CTP account&lt;/li&gt;&lt;li&gt;Visual Studio 2008 SP1&lt;/li&gt;&lt;li&gt;.NET Framework 3.5 SP1&lt;/li&gt;&lt;li&gt;C# (or respective VB.NET) namespace: &lt;span style="font-weight: bold;"&gt;System.Data.SqlClient&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Objects used from System.Data.SqlClient namespace:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SqlConnection&lt;/li&gt;&lt;li&gt;SqlCommand&lt;/li&gt;&lt;li&gt;SqlDataReader&lt;/li&gt;&lt;li&gt;SqlDataAdapter&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Process&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Step 1: Add namespace for using SqlClient&lt;/li&gt;&lt;li&gt;Step 2: Set up connection to database&lt;/li&gt;&lt;li&gt;Step 3: Open database connection&lt;/li&gt;&lt;li&gt;Step 4: Set the T-SQL command(s) - Use the "SqlCommand" object&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Step 5: Open the SqlDataReader - Execute the T-SQL command(s)&lt;/li&gt;&lt;li&gt;Step 6: Display the results (if any)&lt;/li&gt;&lt;li&gt;Step 7: Close the SqlDataReader &lt;/li&gt;&lt;li&gt;Step 8: Close the database connection&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Source Code (for obvious reasons I removed the connection string from the source code file)&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You can find the sample source code for this post &lt;a href="http://cid-f7a5cb9a0405dcb5.skydrive.live.com/self.aspx/.Public/Source%20Code%20Samples/ADO%20.NET%20-%20SQL%20Azure/Program.cs"&gt;here&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;*Note: &lt;/span&gt;This sample code is for demo purposes and does not represent production code.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Considerations&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;My example is based on the example in my &lt;a href="http://aartemiou.blogspot.com/2009/09/sql-azure-first-contact.html"&gt;previous post&lt;/a&gt; on SQL Azure (Database Name: &lt;span style="font-weight: bold;"&gt;sqlazure&lt;/span&gt;, table name: &lt;span style="font-weight: bold;"&gt;CLOUD_MSGS&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;For this post I used a new Visual C# “Console Application” project named &lt;span style="font-weight: bold;"&gt;ADO .NET – SQL Azure&lt;/span&gt; like in the following screenshot:&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tEowgAvs-mQ/SqbEaCDqX2I/AAAAAAAAANM/Tgt6WdPkGA0/s1600-h/sc1_new_project.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 228px;" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/SqbEaCDqX2I/AAAAAAAAANM/Tgt6WdPkGA0/s320/sc1_new_project.png" alt="" id="BLOGGER_PHOTO_ID_5379202756448509794" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Screenshot of the output&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tEowgAvs-mQ/SqbOVl_kKuI/AAAAAAAAANU/nODDb5buqkE/s1600-h/sc2_output.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 162px;" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/SqbOVl_kKuI/AAAAAAAAANU/nODDb5buqkE/s320/sc2_output.png" alt="" id="BLOGGER_PHOTO_ID_5379213675311934178" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Have fun!&lt;br /&gt;&lt;br /&gt;Drop me a comment if you need any help implementing the ADO.NET connection to SQL Azure!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-8082449452539045814?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/8082449452539045814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=8082449452539045814' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8082449452539045814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/8082449452539045814'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/09/accessing-sql-azure-using-adonet.html' title='Accessing SQL Azure Using ADO.NET'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_tEowgAvs-mQ/SqbEaCDqX2I/AAAAAAAAANM/Tgt6WdPkGA0/s72-c/sc1_new_project.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-6002284537894513032</id><published>2009-09-04T10:43:00.017+03:00</published><updated>2009-09-04T11:37:48.783+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Azure'/><category scheme='http://www.blogger.com/atom/ns#' term='Cloud Computing'/><title type='text'>SQL Azure: A First Contact</title><content type='html'>SQL Azure… Yep, that is SQL Server on the Cloud!&lt;br /&gt;&lt;br /&gt;A few days ago I received my SQL Azure (CTP) invitation code. The first thing I naturally did right after this was to create and access a database on the Cloud! I was very curious to see how I could interact with a database hosted on the cloud.&lt;br /&gt;&lt;br /&gt;After getting access to the SQL Azure Service (you can register for the CTP &lt;a href="http://go.microsoft.com/fwlink/?LinkID=149681&amp;amp;clcid=0x09"&gt;here&lt;/a&gt;), you can easily create a database by clicking on the “&lt;span style="font-weight: bold;"&gt;Create Database&lt;/span&gt;” button.&lt;br /&gt;&lt;br /&gt;The default database is the well-known “&lt;span style="font-weight: bold;"&gt;master&lt;/span&gt;” database.&lt;br /&gt;I called the database I created “&lt;span style="font-weight: bold;"&gt;sqlazure&lt;/span&gt;”.&lt;br /&gt;&lt;br /&gt;So, an empty database is created, what next? One of the options is to connect to the database using SQL Server 2008 Management Studio (SSMS)!&lt;br /&gt;&lt;br /&gt;I will provide the procedure I followed (with screenshots) in steps:&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Step 1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Select the database hosted on the cloud in SQL Azure and click on the “&lt;span style="font-weight: bold;"&gt;Connection String&lt;/span&gt;s” button:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_tEowgAvs-mQ/SqDFYi1gLbI/AAAAAAAAAMk/72bnOmgnnu0/s1600-h/screen1_SQL_Azure.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 232px;" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/SqDFYi1gLbI/AAAAAAAAAMk/72bnOmgnnu0/s320/screen1_SQL_Azure.png" alt="" id="BLOGGER_PHOTO_ID_5377514980539116978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;When clicking on that button you will get three connection strings for the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;ADO .NET&lt;/li&gt;&lt;li&gt;ODBC&lt;/li&gt;&lt;li&gt;OLE DB&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;In all the connection strings, you can find the same server value in the form of Server=&lt;span style="font-weight: bold;"&gt;tcp:[&lt;full&gt;&lt;/full&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;full_server_name]&lt;/span&gt;. Note down the full server name or just copy it to your Windows clipboard.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Step 2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Start SQL Server 2008 Management Studio (SSMS).&lt;br /&gt;On the connection dialog that appears when starting SSMS, click on the “&lt;span style="font-weight: bold;"&gt;Cancel&lt;/span&gt;” button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tEowgAvs-mQ/SqDFZAL4LSI/AAAAAAAAAMs/Msg0K1Mcowo/s1600-h/screen2_SSMS.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 174px;" src="http://3.bp.blogspot.com/_tEowgAvs-mQ/SqDFZAL4LSI/AAAAAAAAAMs/Msg0K1Mcowo/s320/screen2_SSMS.png" alt="" id="BLOGGER_PHOTO_ID_5377514988417592610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Step 3&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;In SSMS click on “&lt;span style="font-weight: bold;"&gt;New Query&lt;/span&gt;”. The connection dialog appears again.&lt;br /&gt;&lt;br /&gt;On the connection dialog enter the following information:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Server Name: The full server name as provided by the SQL Azure connection string.&lt;/li&gt;&lt;li&gt;Authentication: SQL Server Authentication.&lt;/li&gt;&lt;li&gt;Login: The SQL Azure server admin username.&lt;/li&gt;&lt;li&gt;Password: The SQL Azure server admin password.&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;span class="fullpost"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_tEowgAvs-mQ/SqDFZTvoGHI/AAAAAAAAAM0/nbJGDELQMVQ/s1600-h/screen3_SSMS.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 189px;" src="http://4.bp.blogspot.com/_tEowgAvs-mQ/SqDFZTvoGHI/AAAAAAAAAM0/nbJGDELQMVQ/s320/screen3_SSMS.png" alt="" id="BLOGGER_PHOTO_ID_5377514993667807346" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Also, before clicking the “&lt;span style="font-weight: bold;"&gt;Connect&lt;/span&gt;” button, click on “&lt;span style="font-weight: bold;"&gt;Options&lt;/span&gt;” and under the “&lt;span style="font-weight: bold;"&gt;Connection Properties&lt;/span&gt;” tab, in the “&lt;span style="font-weight: bold;"&gt;Connect to database&lt;/span&gt;” field, enter the database name which is hosted on the cloud and you want to access&lt;span style="font-weight: bold;"&gt;*&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;*&lt;/span&gt; In this case you have to note that if you do not specify the database in the connection properties, you will be automatically connected to the “&lt;span style="font-weight: bold;"&gt;master&lt;/span&gt;” database. Though, once connected to a database on SQL Azure, it is not yet possible to use the “&lt;span style="font-weight: bold;"&gt;USE&lt;/span&gt;” command for switching to another database. The only way for switching to another database, is to establish a new connection on that database.&lt;br /&gt;&lt;br /&gt;OK, after selecting the database on which you want to connect (in this example &lt;span style="font-weight: bold;"&gt;sqlazure&lt;/span&gt;) click on the “Connect” button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_tEowgAvs-mQ/SqDFZwC8jVI/AAAAAAAAAM8/vsH_51uFRg0/s1600-h/screen4_SSMS.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 273px; height: 320px;" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/SqDFZwC8jVI/AAAAAAAAAM8/vsH_51uFRg0/s320/screen4_SSMS.png" alt="" id="BLOGGER_PHOTO_ID_5377515001265032530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;By the way, you will get an error message about &lt;span style="font-weight: bold;"&gt;ANSI_NULLS&lt;/span&gt; but you can ignore this and continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_tEowgAvs-mQ/SqDFaRQZx0I/AAAAAAAAANE/hYYU5vpNn1Q/s1600-h/screen5_error.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 70px;" src="http://1.bp.blogspot.com/_tEowgAvs-mQ/SqDFaRQZx0I/AAAAAAAAANE/hYYU5vpNn1Q/s320/screen5_error.png" alt="" id="BLOGGER_PHOTO_ID_5377515010179843906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;That’s it! You are now connected to your database hosted on the cloud and you can issue queries using SSMS query window!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Step 4&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Finally, let’s run some queries against our database:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;-- Create a table&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;CREATE TABLE CLOUD_MSGS(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;msgID int,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;msgDescr varchar(100)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;-- Create unique clustered index&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;CREATE UNIQUE CLUSTERED INDEX msgID_ind&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;ON CLOUD_MSGS (msgID)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;-- Populate table with data ... using Row Constructors! :)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;INSERT INTO CLOUD_MSGS(msgID,msgDescr)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;VALUES (1,'Welcome to SQL Azure'), (2,'Hello World!'), (3,'SQL is on the Cloud!')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;-- Display the contents of the "CLOUD_MSGS" table&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SELECT *&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;FROM CLOUD_MSGS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Resources&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Below you can find some useful resources regarding SQL Azure. Note that this is pre-release documentation and is subject to change in future releases:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/sqlserver/dataservices/default.aspx"&gt;SQL Azure MSDN DevCenter&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee336279.aspx"&gt;SQL Azure Help Documentation on MSDN DevCenter&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-6002284537894513032?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/6002284537894513032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=6002284537894513032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/6002284537894513032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/6002284537894513032'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/09/sql-azure-first-contact.html' title='SQL Azure: A First Contact'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_tEowgAvs-mQ/SqDFYi1gLbI/AAAAAAAAAMk/72bnOmgnnu0/s72-c/screen1_SQL_Azure.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-5788233308452658140</id><published>2009-08-25T22:16:00.011+03:00</published><updated>2009-08-26T00:36:59.479+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Discussion'/><title type='text'>A DBA or a Database Developer?</title><content type='html'>I often think if the above two roles can be completely separated. From my point of view I would say that this is not 100% possible.&lt;br /&gt;&lt;br /&gt;Of course, DBAs are not developers and developers are not DBAs.&lt;br /&gt;&lt;br /&gt;The DBA is responsible for the environmental aspects of a DBMS like the databases integrity, backup, security, installation of new DBMS software, etc.&lt;br /&gt;&lt;br /&gt;The developer is the person who designs databases and other related database objects. Is the person who writes application code against DBMSs using T-SQL and other data access technologies.&lt;br /&gt;&lt;br /&gt;There are many cases where the developer cannot perform the tasks the DBA can. Examples of such tasks are: Implementing High Availability solutions, DBMS security and so on.&lt;br /&gt;&lt;br /&gt;Also, there are cases where the DBA cannot perform tasks that the developer can. Such tasks can be: Implementing T-SQL queries and other database objects (i.e. stored procedures and functions) that access and modify data.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Though, as the below figure graphically illustrates, there is an area of responsibility which is common for all the DBMS-related professionals in terms of common tasks or tasks which require the interaction of both DBMS professionals:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_tEowgAvs-mQ/SpRUDK1zMXI/AAAAAAAAAMc/64zmO6YNZeY/s1600-h/DBA_Developer.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 171px;" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/SpRUDK1zMXI/AAAAAAAAAMc/64zmO6YNZeY/s320/DBA_Developer.png" alt="" id="BLOGGER_PHOTO_ID_5374012668786192754" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;As an example, consider the task of Performance Tuning. In this case the DBA will monitor the DBMS instance for identifying bottlenecks on the memory, disk, CPU and network subsystems which are might caused by the operation of the databases under that DBMS instance. If the DBA discover a bottleneck on the pre-mentioned subsystems then is able to proceed with optimizing the DBMS by upgrading the subsystems causing bottlenecks (i.e. add more RAM) or addressing the issue relatively independently.&lt;br /&gt;&lt;br /&gt;Though, doing only this is not really enough for performing an efficient and comprehensive performance tuning. Imagine the case where the DBAs runs a trace and finds that a specific database query which exists in a stored procedure and manipulates data has slow performance and needs to be rewritten. In this case the DBA will discuss this with the designer (developer) of the stored procedure in order for the latter to perform the required analysis and then redesign/optimize the stored procedure accordingly.&lt;br /&gt;&lt;br /&gt;The above example indicates that performance tuning is one of the DBMS tasks which require the cooperation of the DBA and the Database Developer in some of its aspects.&lt;br /&gt;&lt;br /&gt;Another example within the above context is writing T-SQL queries. Sure, the DBA writes T-SQL queries for administrating the DBMS instance whereas the developer writes T-SQL queries for manipulating data but still, in many cases they both write similar code. So under this context, the DBA should be capable of writing T-SQL queries with ease, not for manipulating data within the databases (this is the developer’s job) but for performing automated, administrative tasks. An example for performing automated tasks in a DBMS is to design and implement a stored procedure which can be executed on a  scheduled-time basis.&lt;br /&gt;&lt;br /&gt;Lately, Business Intelligence (BI) became very popular. To this end, now there is another DBMS role; the BI Developer.&lt;br /&gt;&lt;br /&gt;The BI developer is the person who works with business intelligence technologies, in the case of SQL Server, like Reporting Services, Analysis Services, and Integration Services. Is the person who analyzes data in large Data Warehouses and transforms row data into knowledge.&lt;br /&gt;&lt;br /&gt;Yet again, as the below figure graphically illustrates, there are still common tasks among the DBA, Database and BI Developer roles which require the interaction of all roles:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_tEowgAvs-mQ/SpRUC4kYu9I/AAAAAAAAAMU/ei4XUc2rEhA/s1600-h/DBA_Developer_BI_Developer.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 230px;" src="http://2.bp.blogspot.com/_tEowgAvs-mQ/SpRUC4kYu9I/AAAAAAAAAMU/ei4XUc2rEhA/s320/DBA_Developer_BI_Developer.png" alt="" id="BLOGGER_PHOTO_ID_5374012663881317330" border="0" /&gt;&lt;/a&gt;Like in the first example, a comprehensive performance tuning would require all three DBMS professionals working together in some of its aspects. Also, all three professionals must be capable of “reading” and writing T-SQL queries. Additionally, all three roles should work together in the case of data archiving and so on.&lt;br /&gt;&lt;br /&gt;My conclusion is that even though each DBMS role has its own, genuine areas of responsibility where only professionals under that specific role can perform the related tasks, there will always be some tasks which will need the cooperation of all three (or even more) DBMS roles.&lt;br /&gt;&lt;br /&gt;Of course, if a person has expertise on all the aspects of a DBMS operation (Administration, Development, Business Intelligence, etc.), this would be the best case scenario! :)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-5788233308452658140?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/5788233308452658140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=5788233308452658140' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5788233308452658140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5788233308452658140'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/08/dba-or-database-developer.html' title='A DBA or a Database Developer?'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_tEowgAvs-mQ/SpRUDK1zMXI/AAAAAAAAAMc/64zmO6YNZeY/s72-c/DBA_Developer.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-5140587888926244922</id><published>2009-08-11T23:56:00.005+03:00</published><updated>2009-08-12T00:19:55.838+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programmability'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Using the "GO" Command in SQL Server</title><content type='html'>This post discusses the "GO" command in SQL Server.&lt;br /&gt;Before proceeding with explaining GO, it is first necessary to understand what a "Batch" is.&lt;br /&gt;&lt;br /&gt;As described in &lt;a href="http://msdn.microsoft.com/en-us/library/ms175502.aspx"&gt;MSDN BOL&lt;/a&gt;, a Batch is a group of one or more Transact-SQL statements sent at the same time from an application to SQL Server for execution. SQL Server compiles the statements of a batch into an execution plan.&lt;br /&gt;&lt;br /&gt;GO is a command used for signaling the end of a batch. Note that it is not a T-SQL statement.&lt;br /&gt;This command is recognized by the following SQL Server utilities:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;sqlcmd &lt;/li&gt;&lt;li&gt;osql &lt;/li&gt;&lt;li&gt;SQL Server Management Studio Code editor&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Using GO, you can specify multiple batches within your T-SQL code.&lt;br /&gt;So, for an example, instead of having different files containing T-SQL code and separately executing each of it, you can just use a single file/code and separate the batches using GO. This is useful in many cases.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;An example of some T-SQL code (in SQL Server Management Studio Code Editor) featuring batches is the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;------------ Example 1------------ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;--BATCH 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;USE [AdventureWorks]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;--BATCH 2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;DECLARE @STRING1 AS VARCHAR(50)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SET @STRING1='BATCH 2'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SELECT @STRING1 AS RESULT&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;--BATCH 3&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;DECLARE @STRING2 AS VARCHAR(50)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SET @STRING2='BATCH 3'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SELECT @STRING2 AS RESULT&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;---------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The above T-SQL code features three batches.&lt;br /&gt;The first batch instructs SQL Server Database Engine to use the "AdventureWorks" database.&lt;br /&gt;The second batch declares a varchar variable, sets a value for it, and prints its value, and the third one does exactly the same with another variable.&lt;br /&gt;&lt;br /&gt;So, in this example, the SQL Server Management Studio Code Editor will separately send the three bathes to SQL Server Database Engine for processing.&lt;br /&gt;&lt;br /&gt;Note that by the time there are no dependencies between the batches, the above code is executed without any problems.&lt;br /&gt;&lt;br /&gt;Now, consider the following code:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;------------ Example 2------------ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;--BATCH 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;USE [AdventureWorks]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;--BATCH 2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;DECLARE @STRING1 AS VARCHAR(50)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;DECLARE @STRING2 AS VARCHAR(50)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SET @STRING1='BATCH 2'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SET @STRING2='BATCH 3'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SELECT @STRING1 AS RESULT&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;--BATCH 3&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SELECT @STRING2 AS RESULT&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;---------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Again, the above code features three batches. Though you can see that the variable &lt;span style="font-weight: bold;"&gt;@STRING2 &lt;/span&gt;is declared in Batch 2 but the SELECT statement from within Batch 3 also tries to access it for printing its value. Though, by the time @STRING2 is defined in Batch 2, consequently it will be only available for T-SQL Statements belonging to the scope of Batch 2.&lt;br /&gt;&lt;br /&gt;Any other T-SQL statement trying to access it will result to a runtime error because @STRING2 is only visible within Batch 2.&lt;br /&gt;&lt;br /&gt;Based on the above example, if you try to execute the entire T-SQL code you will get the following error message:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Msg 137, Level 15, State 2, Line 3&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Must declare the scalar variable "@STRING2".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;GO is very useful in SQL Server. Though, you need to use it only when is really needed.&lt;br /&gt;So, you need to keep in mind that along with defining a batch using the GO command, you define the scope of that specific piece of T-SQL code.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-5140587888926244922?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/5140587888926244922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=5140587888926244922' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5140587888926244922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5140587888926244922'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/08/using-go-command-in-sql-server.html' title='Using the &quot;GO&quot; Command in SQL Server'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-2933015134853253100</id><published>2009-08-03T23:06:00.003+03:00</published><updated>2009-08-03T23:27:57.799+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='ADO .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access'/><category scheme='http://www.blogger.com/atom/ns#' term='PASS'/><title type='text'>24 Hours of PASS!</title><content type='html'>I got asked to present a one-hour SQL Server development session during the "&lt;a href="http://24hours.sqlpass.org/"&gt;24 Hours of PASS&lt;/a&gt;" event which starts on September 2, 2009, 00:00 GMT.&lt;br /&gt;&lt;br /&gt;The "&lt;span style="font-weight: bold;"&gt;24 Hours of PASS&lt;/span&gt;" is a series of live one-hour webcasts broadcast over a 24 hour period that focus on various SQL Server topics.&lt;br /&gt;&lt;br /&gt;The event is free and it is an excellent opportunity for learning about  Data Warehousing, SQLCLR, SQL Server security, Performance Tuning, SQL Server Development and much more!&lt;br /&gt;&lt;br /&gt;You can check out all all the great sessions at the following &lt;a href="http://24hours.sqlpass.org/Sessions.aspx"&gt;link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I will be presenting Session 18, with topic: "&lt;span style="font-weight: bold;"&gt;Building Flexible Data Services for the Web Using the ADO .NET Data Services Framework&lt;/span&gt;". For more info click on &lt;a href="http://24hours.sqlpass.org/Sessions/24HoursofPASSSessionDetailsSession18.aspx"&gt;this&lt;/a&gt; link.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;During my session, you can learn how to easily build flexible and scalable data services that are naturally integrated with the Web, by using the ADO .NET Data Services Framework. Also, you can see how to easily build a data service from scratch, map it to a SQL Server database, and expose database data to the Web. Learn how to use URIs and HTTP verbs such as &lt;span style="font-weight: bold;"&gt;GET&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;POST&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;PUT&lt;/span&gt;, and &lt;span style="font-weight: bold;"&gt;DELETE&lt;/span&gt; for accessing and manipulating specific pieces of the data. Also, see how Data Services fully support the REST protocol by using well-known formats for representing data, such as JSON and plain XML.&lt;br /&gt;&lt;br /&gt;See you all online!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-2933015134853253100?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/2933015134853253100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=2933015134853253100' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2933015134853253100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/2933015134853253100'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/08/24-hours-of-pass.html' title='24 Hours of PASS!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-894576751311337354</id><published>2009-08-03T01:03:00.002+03:00</published><updated>2009-08-03T01:18:38.005+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Screencasts'/><category scheme='http://www.blogger.com/atom/ns#' term='Programmability'/><title type='text'>Screencast: Object Dependencies in SQL Server 2008</title><content type='html'>SQL Server 2008 introduces among other new features and enhancements for accurately tracking &lt;span style="font-weight: bold;"&gt;Object Dependencies&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;This is very useful especially in cases where the user wishes to programmatically modify database objects having dependencies and therefore, he/she needs to resolve these dependencies before being able to proceed with the database object modification.&lt;br /&gt;&lt;br /&gt;For efficiently tracking dependencies in SQL Server 2008, a new System View (&lt;span style="font-weight: bold;"&gt;sys.sql_expression_dependencies&lt;/span&gt;) and two Dynamic Management Functions (DMFs - &lt;span style="font-weight: bold;"&gt;sys.dm_sql_referenced_entities&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;sys.dm_sql_referencing_entities&lt;/span&gt;) are introduced.&lt;br /&gt;&lt;br /&gt;For more information you can watch the Screencast below!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;object height="498" width="640"&gt; &lt;param name="movie" value="http://content.screencast.com/users/Artemios/folders/SQL_Server_Screencasts/media/b8476a1a-aa78-4e64-8fa5-6e925dce2101/flvplayer.swf"&gt; &lt;param name="quality" value="high"&gt; &lt;param name="bgcolor" value="#FFFFFF"&gt; &lt;param name="flashVars" value="thumb=http://content.screencast.com/users/Artemios/folders/SQL_Server_Screencasts/media/b8476a1a-aa78-4e64-8fa5-6e925dce2101/FirstFrame.jpg&amp;amp;containerwidth=640&amp;amp;containerheight=498&amp;amp;content=http://content.screencast.com/users/Artemios/folders/SQL_Server_Screencasts/media/b8476a1a-aa78-4e64-8fa5-6e925dce2101/Screencast_Object_Dependencies.mp4"&gt; &lt;param name="allowFullScreen" value="true"&gt; &lt;param name="scale" value="showall"&gt; &lt;param name="allowScriptAccess" value="always"&gt; &lt;param name="base" value="http://content.screencast.com/users/Artemios/folders/SQL_Server_Screencasts/media/b8476a1a-aa78-4e64-8fa5-6e925dce2101/"&gt;  &lt;embed src="http://content.screencast.com/users/Artemios/folders/SQL_Server_Screencasts/media/b8476a1a-aa78-4e64-8fa5-6e925dce2101/flvplayer.swf" quality="high" bgcolor="#FFFFFF" type="application/x-shockwave-flash" allowscriptaccess="always" flashvars="thumb=http://content.screencast.com/users/Artemios/folders/SQL_Server_Screencasts/media/b8476a1a-aa78-4e64-8fa5-6e925dce2101/FirstFrame.jpg&amp;amp;containerwidth=640&amp;amp;containerheight=498&amp;amp;content=http://content.screencast.com/users/Artemios/folders/SQL_Server_Screencasts/media/b8476a1a-aa78-4e64-8fa5-6e925dce2101/Screencast_Object_Dependencies.mp4" allowfullscreen="true" base="http://content.screencast.com/users/Artemios/folders/SQL_Server_Screencasts/media/b8476a1a-aa78-4e64-8fa5-6e925dce2101/" scale="showall" height="498" width="640"&gt;&lt;/embed&gt; &lt;/object&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-894576751311337354?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/894576751311337354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=894576751311337354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/894576751311337354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/894576751311337354'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/08/screencast-object-dependencies-in-sql.html' title='Screencast: Object Dependencies in SQL Server 2008'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-7250123356583675684</id><published>2009-08-01T14:13:00.010+03:00</published><updated>2009-11-01T21:30:00.919+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Programmability'/><category scheme='http://www.blogger.com/atom/ns#' term='Event Reviews'/><category scheme='http://www.blogger.com/atom/ns#' term='Webcasts'/><title type='text'>Webcast on SQL Server 2008 T-SQL Enhancements Now Publicly Available!</title><content type='html'>A few days ago I delivered a Live Webcast on Microsoft SQL Server 2008 Programmability and more specifically on T-SQL Enhancements.&lt;br /&gt;&lt;br /&gt;During the Webcast I talked about the following SQL Server 2008 Programmability features:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Variables Declaration and Initialization&lt;/li&gt;&lt;li&gt;Compound Assignment Operators&lt;/li&gt;&lt;li&gt;Large UDTs&lt;/li&gt;&lt;li&gt;DATE, TIME, DATETIME2&lt;/li&gt;&lt;li&gt;New &amp;amp; Enhanced Functions supporting DATETIME2 Precision&lt;/li&gt;&lt;li&gt;Table Value Constructors (Row Constructors)&lt;/li&gt;&lt;li&gt;Table Types and Table-Valued Parameters (TVPs)&lt;/li&gt;&lt;li&gt;The MERGE Statement&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Grouping Sets&lt;/li&gt;&lt;li&gt;Object Dependencies&lt;br /&gt;&lt;/li&gt;&lt;li&gt;HIERARCHYID Data Type&lt;br /&gt;&lt;/li&gt;&lt;li&gt;DDL Trigger Enhancements&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Collation Alignment with Windows&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;You are now able to watch this Webcast here!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;object height="498" width="640"&gt; &lt;param name="movie" value="http://content.screencast.com/users/Artemios/folders/Webcasts/media/58024474-fcab-45a5-9dcb-5c2e8032dc62/flvplayer.swf"&gt; &lt;param name="quality" value="high"&gt; &lt;param name="bgcolor" value="#FFFFFF"&gt; &lt;param name="flashVars" value="thumb=http://content.screencast.com/users/Artemios/folders/Webcasts/media/58024474-fcab-45a5-9dcb-5c2e8032dc62/FirstFrame.jpg&amp;amp;containerwidth=640&amp;amp;containerheight=498&amp;amp;content=http://content.screencast.com/users/Artemios/folders/Webcasts/media/58024474-fcab-45a5-9dcb-5c2e8032dc62/Webcast_SQL_Server_2008_TSQL_Enhancements.mp4"&gt; &lt;param name="allowFullScreen" value="true"&gt; &lt;param name="scale" value="showall"&gt; &lt;param name="allowScriptAccess" value="always"&gt; &lt;param name="base" value="http://content.screencast.com/users/Artemios/folders/Webcasts/media/58024474-fcab-45a5-9dcb-5c2e8032dc62/"&gt;  &lt;embed src="http://content.screencast.com/users/Artemios/folders/Webcasts/media/58024474-fcab-45a5-9dcb-5c2e8032dc62/flvplayer.swf" quality="high" bgcolor="#FFFFFF" type="application/x-shockwave-flash" allowscriptaccess="always" flashvars="thumb=http://content.screencast.com/users/Artemios/folders/Webcasts/media/58024474-fcab-45a5-9dcb-5c2e8032dc62/FirstFrame.jpg&amp;amp;containerwidth=640&amp;amp;containerheight=498&amp;amp;content=http://content.screencast.com/users/Artemios/folders/Webcasts/media/58024474-fcab-45a5-9dcb-5c2e8032dc62/Webcast_SQL_Server_2008_TSQL_Enhancements.mp4" allowfullscreen="true" base="http://content.screencast.com/users/Artemios/folders/Webcasts/media/58024474-fcab-45a5-9dcb-5c2e8032dc62/" scale="showall" height="498" width="640"&gt;&lt;/embed&gt; &lt;/object&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-7250123356583675684?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/7250123356583675684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=7250123356583675684' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7250123356583675684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/7250123356583675684'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/08/webcast-on-sql-server-2008-t-sql.html' title='Webcast on SQL Server 2008 T-SQL Enhancements Now Publicly Available!'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-3245396093335981418</id><published>2009-07-30T16:09:00.006+03:00</published><updated>2009-07-30T16:24:47.536+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='DATETIME2'/><category scheme='http://www.blogger.com/atom/ns#' term='Programmability'/><title type='text'>New Date-Related Functions in SQL Server 2008</title><content type='html'>Along with the new data types DATE, TIME and DATETIME2 in SQL Server 2008, new and enhanced functions are also included.&lt;br /&gt;&lt;br /&gt;These functions are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SYSDATETIME &lt;/li&gt;&lt;li&gt;SYSUTCDATETIME &lt;/li&gt;&lt;li&gt;SYSDATETIMEOFFSET &lt;/li&gt;&lt;li&gt;SWITCHOFFSET &lt;/li&gt;&lt;li&gt;TODATETIMEOFFSET&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;A more thorough explanation follows:&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;span style="font-weight: bold;"&gt;SYSDATETIME&lt;br /&gt;------------------&lt;/span&gt;&lt;br /&gt;This function is like the GETDATE function with the difference that it returns the current date and time with the precision of DATETIME2.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-----------------------&lt;/span&gt;&lt;br /&gt;This function returns the current date and time in UTC again with the precision of DATETIME2.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SYSDATETIMEOFFSET&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-------------------------&lt;/span&gt;&lt;br /&gt;This function returns the current date and time along with the system time zone as a DATETIMEOFFSET value.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For all the above functions, if desirable, you can cast its values to DATE or TIME.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SWITCHOFFSET&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;------------------&lt;/span&gt;&lt;br /&gt;This function adjusts an input DATETIMEOFFSET value to a specified time zone, while preserving the UTC vaslue. In plain words it returns the date and time along with the current time offset.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;TODATETIMEOFFSET&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;------------------------&lt;/span&gt;&lt;br /&gt;Even though it might seem similar to the SWITCHOFFSET function, the TODATETIMEOFFSET function has a different purpose.&lt;br /&gt;It actually converts types that are not time zone aware to DATETIMEOFFSET by the given time zone offset. So, if for an example you execute the following T-SQL statement:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT TODATETIMEOFFSET('2009-07-29 20:00', '+03:00') AS CURRENT_DATE_TIME_OFFSET&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;you will get a DATETIMEOFFSET value saying that the date is: 2009-07-29 and time: 20:00 and the time zone offset is +03:00.&lt;br /&gt;&lt;br /&gt;The exact result of the above T-SQL statement is: &lt;span style="color: rgb(0, 0, 153);"&gt;2009-07-29 20:00:00.0000000 +03:00&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another difference between SWITCHOFFSET and TODATETIMEOFFSET is that the latter is not restricted to a DATETIMEOFFSET as an input value rather it accepts any date and time value (like in the above example).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;------------------------------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;T-SQL code examples using the above functions&lt;/span&gt;&lt;br /&gt;------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;--SYSDATETIME (Returns the System date and time with DATETIME2 precision)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT GETDATE() AS CURRENT_DATETIME_OLD, SYSDATETIME() AS CURRENT_DATETIME_NEW&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT (CAST (GETDATE() AS DATE)) AS CURRENT_DATE_OLD, (CAST (SYSDATETIME() AS DATE)) AS CURRENT_DATE_NEW&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT (CAST (GETDATE() AS TIME)) AS CURRENT_TIME_OLD, (CAST (SYSDATETIME() AS TIME)) AS CURRENT_TIME_NEW&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;--SYSUTCDATETIME (Returns the UTC date and time with DATETIME2 precision)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT SYSUTCDATETIME() AS CURRENT_UTC_DATETIME&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT (CAST (SYSUTCDATETIME() AS DATE)) AS CURRENT_UTC_DATE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT (CAST (SYSUTCDATETIME() AS TIME)) AS CURRENT_UTC_TIME&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;--SYSDATETIMEOFFSET (Returns the Date and time along with the current time offset)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT SYSDATETIMEOFFSET() as CURRENT_DATE_TIME_OFFSET&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;--SWITCHOFFSET (Adjusts an input DATETIMEOFFSET value to a specified time zone, while preserving the UTC value)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT SWITCHOFFSET(SYSDATETIMEOFFSET(), '+03:00') AS CURRENT_DATE_TIME_OFFSET&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;--TODATETIMEOFFSET (Converts types that are not time zone aware to DATETIMEOFFSET by the given time zone offset)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT TODATETIMEOFFSET(SYSDATETIMEOFFSET(), '+03:00') AS CURRENT_DATE_TIME_OFFSET&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT TODATETIMEOFFSET(GETDATE(), '+03:00') AS CURRENT_DATE_TIME_OFFSET&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT TODATETIMEOFFSET(SYSDATETIME(), '+03:00') AS CURRENT_DATE_TIME_OFFSET&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;SELECT TODATETIMEOFFSET('2009-07-29 20:00', '+03:00') AS CURRENT_DATE_TIME_OFFSET&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-3245396093335981418?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/3245396093335981418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=3245396093335981418' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3245396093335981418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/3245396093335981418'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/07/new-date-related-functions-in-sql.html' title='New Date-Related Functions in SQL Server 2008'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-5136735116515028481</id><published>2009-07-21T14:42:00.007+03:00</published><updated>2009-07-27T21:29:05.745+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Webcasts'/><title type='text'>Live Webcast Announcement - SQL Server 2008 Programmability</title><content type='html'>One of the things that inspires me the most in SQL Server, is the continuous enhancement of its programmability features like Data Access (Entity Framework and Data Services support), Visual Studio Integration, LINQ, Sync Framework, Project "&lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/velocity.aspx"&gt;Velocity&lt;/a&gt;" and of course, T-SQL Enhancements.&lt;br /&gt;&lt;br /&gt;So I think that it is time for a Live Webcast!&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;On Wednesday, &lt;span style="font-weight: bold;"&gt;July 29&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;8:00 PM&lt;/span&gt; Cyprus Local Time (&lt;span style="font-weight: bold;"&gt;GMT+2&lt;/span&gt;), I will be delivering a public Live Meeting Webcast on SQL Server 2008 Programmability and more specifically on &lt;span style="font-weight: bold;"&gt;T-SQL Enhancements&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;See below for event specific details:&lt;br /&gt;&lt;br /&gt;-----------------------------------------------&lt;br /&gt;Title: &lt;span style="font-weight: bold;"&gt;Microsoft SQL Server 2008 Programmability: T-SQL Enhancements&lt;/span&gt;&lt;br /&gt;Type: Live Meeting Webcast&lt;br /&gt;Language:  English&lt;br /&gt;Product:  Microsoft SQL Server&lt;br /&gt;Audience:  Developer&lt;br /&gt;Duration:  60 Minutes&lt;br /&gt;Start Date: Wednesday, &lt;span style="font-weight: bold;"&gt;July 29&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;2009 8:00 PM &lt;/span&gt;Cyprus Local Time (&lt;span style="font-weight: bold;"&gt;GMT+2&lt;/span&gt;)&lt;br /&gt;Presenter: Artemakis Artemiou [Microsoft SQL Server MVP]&lt;br /&gt;Level: 200-300&lt;br /&gt;Registration (&lt;span style="color: rgb(204, 0, 0);"&gt;*Required&lt;/span&gt;): Click on &lt;a href="http://spreadsheets.google.com/viewform?formkey=dEVndERrbkRUc1RtR01tbE9QTk4wa0E6MA"&gt;this &lt;/a&gt;link.&lt;br /&gt;-----------------------------------------------&lt;br /&gt;&lt;br /&gt;* Note: The GMT offset above does not reflect daylight saving time adjustments.&lt;br /&gt;&lt;br /&gt;The event was also announced on CDNUG's &lt;a href="http://www.cdnug.net/Events/Coming/event_16_live_webcast.aspx"&gt;website&lt;/a&gt;.&lt;br /&gt;The official announcement can be found &lt;a href="http://www.cdnug.net/Docs/Event_16_Live_Meeting_Webcast_T_SQL_Enhancements.pdf"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;See you all online!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-5136735116515028481?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/5136735116515028481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=5136735116515028481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5136735116515028481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/5136735116515028481'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/07/live-webcast-announcement-sql-server.html' title='Live Webcast Announcement - SQL Server 2008 Programmability'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-4564644930389005525</id><published>2009-07-21T13:58:00.006+03:00</published><updated>2009-07-21T14:19:53.406+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><title type='text'>SQL Server 2008 Collation Alignment with Windows Server 2008</title><content type='html'>SQL Server 2008 is fully aligned with the collations in Windows Server 2008.&lt;br /&gt;To this end, it has 80 new collations which are denoted by &lt;span style="font-weight: bold;"&gt;*_100&lt;/span&gt; version references.&lt;br /&gt;&lt;br /&gt;The total number of variations for these collations exceeds 1400.&lt;br /&gt;The purpose of this enhancement is to provide users with the most up-to-date and linguistically accurate cultural sorting conventions.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;In order to see the new collations along with their variations in SQL Server 2008 you can use the following T-SQL query:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;--Get new collation details&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;SELECT [name], [description]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;FROM sys.fn_helpcollations()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;WHERE [name] LIKE '%100%'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For more information on SQL Server 2008 Collation and Unicode Support you can check out the following &lt;a href="http://msdn.microsoft.com/en-us/library/ms143503.aspx"&gt;link&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6369017162723772053-4564644930389005525?l=aartemiou.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aartemiou.blogspot.com/feeds/4564644930389005525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6369017162723772053&amp;postID=4564644930389005525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4564644930389005525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6369017162723772053/posts/default/4564644930389005525'/><link rel='alternate' type='text/html' href='http://aartemiou.blogspot.com/2009/07/sql-server-2008-collation-alignment.html' title='SQL Server 2008 Collation Alignment with Windows Server 2008'/><author><name>Artemakis Artemiou [MVP]</name><uri>http://www.blogger.com/profile/11342421189098310902</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_tEowgAvs-mQ/S84o2OoJYRI/AAAAAAAAAWw/2lHtOtSSg3g/S220/artemakis.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6369017162723772053.post-4632621963848947584</id><published>2009-07-13T23:39:00.008+03:00</published><updated>2009-07-14T00:19:37.303+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Error Messages'/><title type='text'>Error converting data type varchar to float</title><content type='html'>You might get the above error message in different scenarios when trying to convert a string to a float.&lt;br /&gt;&lt;br /&gt;The reason for getting this error message is that you are passing as a parameter to the &lt;span style="font-weight: bold;"&gt;cast&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;convert &lt;/span&gt;SQL Server functions, a varchar expression that is invalid.&lt;br /&gt;&lt;br /&gt;Consider the following example:&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color:green;"&gt;&lt;i&gt;-----------------------------------------&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color:green;"&gt;&lt;i&gt;--Variable declaration and initialization&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt;  &lt;span style="color: rgb(128, 0, 255);"&gt;@value&lt;/span&gt;  &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:black;"&gt;&lt;i&gt;VARCHAR&lt;/i&gt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;(&lt;/span&gt;&lt;span style="color:black;"&gt;50&lt;/span&gt;&lt;span style="color:maroon;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;SET&lt;/span&gt; &lt;span style="color: rgb(128, 0, 255);"&gt;@value&lt;/span&gt; &lt;span style="color:silver;"&gt;=&lt;/span&gt; &lt;span style="color:red;"&gt;'12.340.111,91'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:green;"&gt;&lt;i&gt;--Perform the casting&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;&lt;i&gt;Cast&lt;/i&gt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 255);"&gt;@value&lt;/span&gt; &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:black;"&gt;&lt;i&gt;FLOAT&lt;/i&gt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:green;"&gt;&lt;i&gt;--or&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:green;"&gt;&lt;i&gt;--Perform the conversion&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;&lt;i&gt;Convert&lt;/i&gt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;(&lt;/span&gt;&lt;span style="color:black;"&gt;&lt;i&gt;FLOAT&lt;/i&gt;&lt;/span&gt;&lt;span style="color:silver;"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 255);"&gt;@value&lt;/span&gt;&lt;span style="color:maroon;"&gt;)&lt;/span&gt; &lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color:green;"&gt;&lt;i&gt;-----------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;If you execute the above code you will get an error message in the following type:&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Msg 8114, Level 16, State 5, Line 6&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Error converting data type varchar to float.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The exact reason for getting the error message in this case is that you are using the comma (,) as a decimal point and also the dots as group digit symbols.&lt;br /&gt;&lt;br /&gt;Though SQL Server considers as a decimal point the dot (.). Also when converting a varchar to float you must not use any digit grouping symbols.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;In order for the above code to execute you would need to first remove the dots (that is the digit grouping symbols in this case) and then replace the comma with a dot thus properly defining the decimal symbol for the varchar expression.&lt;br /&gt;&lt;br /&gt;The code then can be modified as follows:&lt;br /&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color:green;"&gt;&lt;i&gt;-----------------------------------------&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color:green;"&gt;&lt;i&gt;--Variable declaration and initialization&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt;  &lt;span style="color: rgb(128, 0, 255);"&gt;@value&lt;/span&gt;  &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:black;"&gt;&lt;i&gt;VARCHAR&lt;/i&gt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;(&lt;/span&gt;&lt;span style="color:black;"&gt;50&lt;/span&gt;&lt;span style="color:maroon;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;SET&lt;/span&gt; &lt;span sty
