<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Title</title><link>http://beyondrelational.com</link><description>description</description><webMaster>beyondrelational</webMaster><language>en-us</language><image><url>http://beyondrelational.com/modules/23/groups/362/images/17021eb5-e554-4269-a990-37b1db2393c9thumbnail.jpg</url><title>Title</title><link>http://beyondrelational.com</link><width>50</width><height>50</height></image><copyright>Copyright © Beyondrelational.com</copyright><lastBuildDate>Sun, 27 May 2012 23:14:10 GMT</lastBuildDate><ttl>60</ttl><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TsqlChallenges" /><feedburner:info uri="tsqlchallenges" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>TsqlChallenges</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>Relog command</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/e9n630pHZGc/relog-command.aspx</link><description>RELOG command can be used to convert the performance counters collected in binary format to CSV format. There are many more options available.

    relog C:\PerfLogs\Baseline.blg -o C:\PerfLogs\Baseline.csv -f csv&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/e9n630pHZGc" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/1/justlearned/412/tips/14940/relog-command.aspx</guid><pubDate>Fri, 25 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/1/justlearned/412/tips/14940/relog-command.aspx</feedburner:origLink></item><item><title>#0163&amp;ndash;SQL Server 2012&amp;ndash;Deprecated Features&amp;ndash;Table Hint: FASTFIRSTROW-Msg: 321</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/xaN_tUzLLuQ/0163-sql-server-2012-deprecated-features-table-hint-fastfirstrow-msg-321.aspx</link><description>&lt;P&gt;Every version of SQL Server comes with a lot of optimizations to the database engine, and these changes require changes to the T-SQL syntax. New statements are introduced or modified and existing ones are dropped. Often table and query hints are optimized and modified in a similar fashion. These table and query hints are often used (in many cases, indiscriminately) to “improve the performance” of Microsoft SQL Server.&lt;/P&gt;
&lt;P&gt;Let me start outright by saying that till date, I have never encountered the need to use the hint that we are about to discuss today.&lt;/P&gt;
&lt;H2&gt;Table v/s Query hints&lt;/H2&gt;
&lt;P&gt;Before going any further, I thought it best to revisit the simple method of identifying which is a table hint and which one is a query hint. For example, take the query below:&lt;/P&gt;&lt;PRE class="brush: sql"&gt;--Query for demonstration purposes only!
USE AdventureWorks2012
GO
SELECT *
FROM HumanResources.Employee WITH (NOLOCK) -- WITH (NOLOCK) is the table hint
WHERE OrganizationLevel = 3
OPTION (MAXDOP 1)                          -- OPTION (MAXDOP 1) is the query hint&lt;/PRE&gt;
&lt;P&gt;The &lt;FONT face=Consolas&gt;WITH (NOLOCK)&lt;/FONT&gt; hint is applied to the table/CTE/sub-query, i.e. a data source. Hence the name – table hint.&lt;/P&gt;
&lt;P&gt;The &lt;FONT face=Consolas&gt;OPTION (MAXDOP 1)&lt;/FONT&gt; is applied to the entire query, and hence the name – query hint.&lt;/P&gt;
&lt;P&gt;[Edit]: You may also find the following post from Pinal Dave, a.k.a. “&lt;EM&gt;SQLAuthority&lt;/EM&gt;” (&lt;A href="http://blog.sqlauthority.com/"&gt;&lt;FONT color=#3366cc&gt;B&lt;/FONT&gt;&lt;/A&gt;|&lt;A href="http://twitter.com/pinaldave"&gt;&lt;FONT color=#3366cc&gt;T&lt;/FONT&gt;&lt;/A&gt;),&amp;nbsp;useful in understanding Query Hints: &lt;A href="http://blog.sqlauthority.com/2012/05/09/sql-server-quiz-and-video-introduction-to-basics-of-a-query-hint/"&gt;http://blog.sqlauthority.com/2012/05/09/sql-server-quiz-and-video-introduction-to-basics-of-a-query-hint/&lt;/A&gt;&lt;/P&gt;
&lt;H2&gt;FASTFIRSTROW&lt;/H2&gt;
&lt;P&gt;According to SQL Server Books On Line, the FASTFIRSTROW is a table hint that helps the developer control the behaviour of the optimizer such that the optimizer,&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Optimizes for overall minimum cost (minimum processing time/resources, etc), OR 
&lt;LI&gt;Optimizes such that the time taken for the first row to be returned is minimized &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The FASTFIRSTROW tells the optimizer that it is important to have the first row returned as fast as possible, allowing the application to return results to the users faster. You can see the difference by comparing the actual execution plans produced by the queries below:&lt;/P&gt;&lt;PRE class="brush: sql"&gt;--Query for demonstration purposes only!
USE AdventureWorks2008
GO
--Without the table hint
SELECT *
FROM HumanResources.Employee 
GO
--With the table hint
SELECT *
FROM HumanResources.Employee WITH (FASTFIRSTROW)
GO&lt;/PRE&gt;
&lt;P&gt;&lt;A href="http://media.beyondrelational.com/images.ashx?id=1312e69e268b4243b461918bdf93de68&amp;amp;w=-1&amp;amp;h=-1"&gt;&lt;IMG style="BACKGROUND-IMAGE: none; BORDER-RIGHT-WIDTH: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; PADDING-TOP: 0px" title=image border=0 alt=image src="http://media.beyondrelational.com/images.ashx?id=be3021fc30dc41b1a86fb0969f5d5321&amp;amp;w=-1&amp;amp;h=-1" width=569 height=263&gt;&lt;/A&gt;&lt;/P&gt;
&lt;H2&gt;OPTION (FAST n)&lt;/H2&gt;
&lt;P&gt;Running the above query in SQL Server 2012 results in the following error:&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000 size=2 face=Consolas&gt;Msg 321, Level 15, State 1, Line 3 &lt;BR&gt;"FASTFIRSTROW" is not a recognized table hints option. If it is intended as a parameter to a table-valued function or to the CHANGETABLE function, ensure that your database compatibility mode is set to 90.&lt;/FONT&gt; &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;The message says it all – FASTFIRSTROW is no longer available, and if you would like to use it, the database compatibility level needs to be set to 90 (i.e.&amp;nbsp; SQL Server 2005).&lt;/P&gt;
&lt;P&gt;The replacement available is not a table hint, but a new query hint – &lt;FONT face=Consolas&gt;FAST number_rows&lt;/FONT&gt;. This query hint specifies that the query is optimized for fast retrieval of the first &lt;FONT face=Consolas&gt;number_rows&lt;/FONT&gt;. This is a nonnegative integer. After the first &lt;FONT face=Consolas&gt;number_rows&lt;/FONT&gt; are returned, the query continues execution and produces its full result set. SQL Server 2012 has given more flexibility to the developer/administrator because the table hint only optimized for the first row, whereas the query hint allows you to specify a custom number of first rows to optimize for.&lt;/P&gt;
&lt;P&gt;As a replacement of &lt;FONT face=Consolas&gt;FASTFIRSTROW&lt;/FONT&gt;, you can use &lt;FONT face=Consolas&gt;OPTION (FAST 1)&lt;/FONT&gt;.&lt;/P&gt;&lt;PRE class="brush: sql"&gt;--Query for demonstration purposes only!
USE AdventureWorks2012
GO
--Without the table hint
SELECT *
FROM HumanResources.Employee 
GO
--With the table hint
SELECT *
FROM HumanResources.Employee
OPTION (FAST 1);
GO&lt;/PRE&gt;
&lt;P&gt;&lt;A href="http://media.beyondrelational.com/images.ashx?id=8a1491c5c6d048dbbd8005bfccbbc80b&amp;amp;w=-1&amp;amp;h=-1"&gt;&lt;IMG style="BACKGROUND-IMAGE: none; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px; PADDING-TOP: 0px" title=image border=0 alt=image src="http://media.beyondrelational.com/images.ashx?id=9160f90fcb964efab2fe55737192f29e&amp;amp;w=-1&amp;amp;h=-1" width=578 height=241&gt;&lt;/A&gt;&lt;/P&gt;
&lt;H2&gt;References:&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;Table hints supported by SQL Server 2008 R2: &lt;A title=http://msdn.microsoft.com/en-us/library/ms187373(v=sql.105).aspx href="http://msdn.microsoft.com/en-us/library/ms187373(v=sql.105).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms187373(v=sql.105).aspx&lt;/A&gt; 
&lt;LI&gt;Query Hints: &lt;A title=http://msdn.microsoft.com/en-us/library/ms181714.aspx href="http://msdn.microsoft.com/en-us/library/ms181714.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms181714.aspx&lt;/A&gt; 
&lt;LI&gt;As I was learning about this table hint, I came across the following post, which I thought might make interesting reading: &lt;A title=http://sqlblog.com/blogs/kalen_delaney/archive/2008/12/02/using-a-nonclustered-index-to-avoid-a-sort.aspx href="http://sqlblog.com/blogs/kalen_delaney/archive/2008/12/02/using-a-nonclustered-index-to-avoid-a-sort.aspx"&gt;http://sqlblog.com/blogs/kalen_delaney/archive/2008/12/02/using-a-nonclustered-index-to-avoid-a-sort.aspx&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blog.sqlauthority.com/2012/05/09/sql-server-quiz-and-video-introduction-to-basics-of-a-query-hint/"&gt;http://blog.sqlauthority.com/2012/05/09/sql-server-quiz-and-video-introduction-to-basics-of-a-query-hint/&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Until we meet next time, &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;A href="http://www.cars.com/go/advice/Story.jsp?section=top&amp;amp;subject=more&amp;amp;story=top10annoying&amp;amp;referer&amp;amp;year&amp;amp;aff=national"&gt;&lt;STRONG&gt;Be courteous. Drive responsibly.&lt;/STRONG&gt;&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/xaN_tUzLLuQ" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/77/Posts/14808/0163-sql-server-2012-deprecated-features-table-hint-fastfirstrow-msg-321.aspx</guid><pubDate>Thu, 24 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/77/Posts/14808/0163-sql-server-2012-deprecated-features-table-hint-fastfirstrow-msg-321.aspx</feedburner:origLink></item><item><title>SQL Server - How do you find un-used stored procedures and un-used views?</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/nq5uMkWLPxI/sql-server-how-do-you-find-un-used-stored-procedures-and-un-used-views.aspx</link><description>There is no in-built mechanism to identify the un-used stored procedures. When an stored procedure is called, an entry will be created in "sys.dm_exec_query_stats". Based on this information, we can find un-used stored procedures by using below query. However, this information will be deleted once the server re-starts. 



    SELECT * from sys.procedures P 
    LEFT OUTER JOIN
    (
    SELECT x.objectid
    FROM sys.dm_exec_query_stats AS s1
    CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS x
    WHERE
     OBJECTPROPERTYEX(x.objectid,'IsProcedure') = 1
    )T on P.object_id = T.objectid
    WHERE T.objectid is null

For views, it will store the execution plan in DMVs. Below query can be used to get un-used views. When the server is re-started, this information will be cleared. Also, when the server has more run out of procedure cache, it will dump the old execution plans. so, this query result might not be approximate.



    SELECT v.name [ViewName] 
    FROM sys.views v 
    WHERE v.is_ms_shipped = 0
    EXCEPT SELECT o.Name [ViewName] 
    FROM master.sys.dm_exec_cached_plans p 
    CROSS APPLY sys.dm_exec_sql_text(p.plan_handle) t 
    INNER JOIN sys.objects o ON t.objectid = o.object_id [here][1]

(Above script taken from Michael K. Campbell article  [here][1])


  [1]: http://www.sqlmag.com/blog/practical-sql-server-45/sql-server-2008-r2/finding-potentially-unused-views-databases-140294[here][1]93&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/nq5uMkWLPxI" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/17/interview-questions/238/interview-questions/14934/sql-server-how-do-you-find-un-used-stored-procedures-and-un-used-views.aspx</guid><pubDate>Thu, 24 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/17/interview-questions/238/interview-questions/14934/sql-server-how-do-you-find-un-used-stored-procedures-and-un-used-views.aspx</feedburner:origLink></item><item><title>BIDS No More Exist in SQL Server 2012. </title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/76yUCbkAqWY/bids-no-more-exist-in-sql-server-2012.aspx</link><description>&lt;P&gt;Once you will installed SQL Server 2012 you could not find the BIDS to develop SSAS/SSIS/SSRS application. BIDS will replace with SSDT i.e. SQL Server Data Tools. &lt;/P&gt;
&lt;P&gt;Comparison of SQL Server 2012 Vs SQL Server 2008 R2. You can get more idea on below Screen shot how SQL Server 2012 looks compare with SQL Server 2008 R2 components.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;IMG src="http://biauthority.files.wordpress.com/2012/05/12.png"&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;SQL Server 2012 Components&lt;/U&gt;&lt;/STRONG&gt; &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;SQL Server Data Tools &lt;/LI&gt;
&lt;LI&gt;SQL Server Management Studio &lt;/LI&gt;
&lt;LI&gt;Analysis SErvices &lt;/LI&gt;
&lt;LI&gt;Configuration Tools &lt;/LI&gt;
&lt;LI&gt;Data Quality Services &lt;/LI&gt;
&lt;LI&gt;Documentation &amp;amp; Community &lt;/LI&gt;
&lt;LI&gt;Integration Services &lt;/LI&gt;
&lt;LI&gt;Master Data Services &lt;/LI&gt;
&lt;LI&gt;Performance Tools &lt;BR&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;So in SQL Server 2012 we have below four new components available. &lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;SQL Server Data Tools &lt;/LI&gt;
&lt;LI&gt;Data Quality Services &lt;/LI&gt;
&lt;LI&gt;Documentation &amp;amp; Community &lt;/LI&gt;
&lt;LI&gt;Master Data Services &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Today will discuss more on SSDT i.e. SQL Server Data Tools.&lt;/P&gt;
&lt;P&gt;SSDT (SQL Server Data Tools)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Developing SSAS/SSIS/SSRS Projects.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Developing Databases in Visual Studio like working in SQL Server Management studio.&lt;/P&gt;
&lt;P&gt;Will discuss the how we can use SSDT one by one.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=4&gt;1-Developing SSAS/SSIS/SSRS Projects.&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;·&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;EM&gt; If you are looking for BIDS (Business Intelligence Development Studio) in SQL Server 2012, then you will not find it. It is replaced with SQL Server Data Tools (SSDT) in SQL Server 2012. &lt;BR&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You can start the SSRS/SSAS/SSIS Projects as we created in BIDS in SQL Server 2008/R2. &lt;BR&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL Server 2012 installs "SQL Server Data Tools" under the "SQL Server 2012" Start Menu option - this includes BIDS but not Database Projects.&lt;BR&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In this use can create the SSAS Tabular Projects called as BISM.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 603px; HEIGHT: 379px" src="http://biauthority.files.wordpress.com/2012/05/2.png" width=509 height=436&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=4&gt;2-Developing Databases in Visual Studio like working in SQL Server Management studio.&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;In this you can create new Database Design features with schema management etc in Visual Studio more like working in SQL Server Management studio.&lt;BR&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The idea is that developers want to develop databases using similar methods to working with regular (i.e. .NET code) object within VS.&amp;nbsp; To that end, SSDT includes offline projects, object creation interfaces (i.e. for tables, views, etc…) schema snapshot and compare, database version targeting (for SQL Server 2005, 2008, 2012 and for SQL Azure) and refactoring with preview.&lt;BR&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Database Projects installs "MICROSOFT SQL Server Data Tools" under the root of the Start Menu - this doesn't have BIDS functionality included if installed separately&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;IMG src="http://biauthority.files.wordpress.com/2012/05/3.png"&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=4&gt;Features&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Responsive SSDT'S GUI as compared to SQL Server Management Studio.&lt;/LI&gt;
&lt;LI&gt;Fast and reliable build of deployment scripts.&lt;/LI&gt;
&lt;LI&gt;Detection of isolated changes in the target database.&lt;/LI&gt;
&lt;LI&gt;Resolve references to other production and system databases like msdb &amp;amp; databases connected by a linked server.&lt;/LI&gt;
&lt;LI&gt;Support of migration scripts to enable data preservation and to add static data.&lt;/LI&gt;
&lt;LI&gt;Possibility of executing and deploying a single file.&lt;/LI&gt;
&lt;LI&gt;Comfortable T-SQL writing.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;IMG src="http://biauthority.files.wordpress.com/2012/05/4.png"&gt;&lt;/P&gt;
&lt;P&gt;Suhas R. Kudekar&lt;/P&gt;&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/76yUCbkAqWY" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/616/posts/14931/bids-no-more-exist-in-sql-server-2012.aspx</guid><pubDate>Wed, 23 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/616/posts/14931/bids-no-more-exist-in-sql-server-2012.aspx</feedburner:origLink></item><item><title>Retrieve the queries that are Most expensive / use the Most IO</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/4Rt9EjeJJ-s/retrieve-the-queries-that-are-most-expensive-use-the-most-io.aspx</link><description>&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;The core functionality of database systems is to retrieve data, and this is reflected in the amount of I/O involved, total CPU time, logical reads/writes etc. &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;We can look at the queries that are most expensive (taking more time to execute), use the most I/O to determine whether they can be changed to retrieve data more efficiently. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;The script below helps to identify the top 10 queries that use the most I/O as ordered by Total IO, taking more time to execute (means most expensive) &lt;U&gt;across all databases&lt;/U&gt; on the server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;Query:&lt;/SPAN&gt;&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;The query calculates the Total IO by summing the columns total_logical_reads and total_logical_writes.&lt;/SPAN&gt; 
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;The Average IO is calculated by dividing the sum of the total_logical_reads and total_logical_writes by the number of times the query has executed (execution_count). &lt;/SPAN&gt;
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;The other output column are: &lt;/SPAN&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;Database Name&lt;/SPAN&gt; 
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;Individual Query&lt;/SPAN&gt; 
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;Parent Query (from where the query is executing)&lt;/SPAN&gt; 
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;Total elapsed time in seconds &lt;/SPAN&gt;
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;Query’s cached plan (query_plan)&amp;nbsp;&lt;/SPAN&gt; 
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;The output is sorted by Total IO in descending order as of now.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;You can modify the query as per your requirement like filter on database name only, set required Order by.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class=brush:sql&gt;SELECT TOP 10
        [Individual Query] = SUBSTRING(qt.TEXT,
                                       ( qs.statement_start_offset / 2 ) + 1,
                                       ( ( CASE qs.statement_end_offset
                                             WHEN -1 THEN DATALENGTH(qt.TEXT)
                                             ELSE qs.statement_end_offset
                                           END - qs.statement_start_offset )
                                         / 2 ) + 1),
        [Total IO] = ( qs.total_logical_reads + qs.total_logical_writes ),
        [Average IO] = ( qs.total_logical_reads + qs.total_logical_writes ) / qs.execution_count,
        [Execution Count] = qs.execution_count,
        [Total Logical Reads] = qs.total_logical_reads,
        [Total Logical Writes] = qs.total_logical_writes,
        [Total Worker Time/CPU time] = qs.total_worker_time,
        [Total Elapsed Time In Seconds] = qs.total_elapsed_time / 1000000,
        [Parent Query] = qt.text,
        [DatabaseName] = DB_NAME(qt.dbid),
        [Query Plan] = qp.query_plan
FROM    sys.dm_exec_query_stats qs
        CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) qt
        CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp
ORDER BY [Total IO] DESC --IO
-- ORDER BY [Total Elapsed Time In Seconds] DESC  --elapsed time
-- ORDER BY qs.total_logical_reads DESC -- logical reads
-- ORDER BY qs.total_logical_writes DESC -- logical writes
-- ORDER BY qs.total_worker_time DESC -- CPU time
&lt;/PRE&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;FONT color=#2a2a2a&gt;&lt;FONT face=Calibri&gt;To reduce reads you need to look at a couple of things, first being query design, secondly being indexing. If your query is pulling a large number of records that could be filtered by getting a smaller set prior to pulling that data then you can always cut down on reads that way. With improved indexing, specifically with covering indexes, you can reduce the number of pages that are being read as well. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&lt;FONT color=#2a2a2a&gt;&lt;FONT face="Times New Roman"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;BR&gt;&lt;FONT face=Calibri&gt;I hope this will be helpful somewhere sometime. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; COLOR: #2a2a2a; FONT-SIZE: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: Calibri"&gt;J&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;Appendix&lt;/SPAN&gt;&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;&lt;STRONG&gt;Logical reads&lt;/STRONG&gt; - number of pages read from the data cache&lt;/SPAN&gt; 
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;Logical read indicates total number of data pages needed to be accessed from data cache to process query. It is very possible that logical read will access same data pages many times, so count of logical read value may be higher than actual number of pages in a table. Usually the best way to reduce logical read is to apply correct index or to rewrite the query.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;&lt;STRONG&gt;Physical reads&lt;/STRONG&gt; - number of pages read from disk&lt;/SPAN&gt; 
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: ''''''''''''''''Calibri'''''''''''''''',''''''''''''''''sans-serif''''''''''''''''; COLOR: #2a2a2a; FONT-SIZE: 11pt"&gt;Physical read indicates total number of data pages that are read from disk. In case no data in data cache, the physical read will be equal to number of logical read in most of the cases. And usually it happens for first query request. And for subsequent same query request the number will be substantially decreased because the data pages have been in data cache.&lt;BR&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/4Rt9EjeJJ-s" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/60/posts/14912/retrieve-the-queries-that-are-most-expensive-use-the-most-io.aspx</guid><pubDate>Tue, 22 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/60/posts/14912/retrieve-the-queries-that-are-most-expensive-use-the-most-io.aspx</feedburner:origLink></item><item><title>NULL, NULL, NULL and nothing but NULL</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/yzJV96Baq9o/null-null-null-and-nothing-but-null.aspx</link><description>&lt;P&gt;&lt;STRONG&gt;NULL&lt;/STRONG&gt;. This is a magical word in Database programming. Here are&amp;nbsp;some interesting facts about NULL in SQL Server.&lt;/P&gt;
&lt;P&gt;1 NULL can be defined as absense of value, undefined, or the value which is unknown at this point of time.&lt;BR&gt;2 All datatypes can be defined with NULL constraint&lt;BR&gt;3 Direct usage of artimetic or logical operations on NULL will not work as expected&lt;BR&gt;4 The system functions ISNULL, COALESE and NULLIF are used only to deal with NULL&lt;BR&gt;5 NOT NULL constraint cannot be defined for a computed column until it is also PERSISTED&lt;BR&gt;6 The only datatypes that will interpret NULL differently are&amp;nbsp;rowversion and timestamp&lt;/P&gt;
&lt;P&gt;Run this code and see the output&lt;/P&gt;&lt;PRE class=brush:sql&gt;declare @rv rowversion , @ts timestamp 
select @rv=null, @ts=null
select @rv as rowversion,@ts as timestamp
&lt;/PRE&gt;&lt;BR&gt;Output is &lt;PRE class=brush:sql&gt;rowversion         timestamp
------------------ ------------------
0x                 0x
&lt;/PRE&gt;&lt;BR&gt;7 NULL=NULL will never be true unless SET ANSI_NULLS is OFF&lt;BR&gt;&lt;BR&gt;While the first query returns nothing, the second will return 6 &lt;PRE class=brush:sql&gt;--Query 1
set ansi_nulls on
select 6
where null=null

--Query 2
set ansi_nulls off
select 6
where null=null
&lt;/PRE&gt;&lt;BR&gt;The condition WHERE col IS NULL will not be affected by the above setting&lt;BR&gt;&lt;BR&gt;8&amp;nbsp;&amp;nbsp; The default datatype of NULL is INT. Refer &lt;A href="http://beyondrelational.com/modules/2/blogs/70/posts/10982/default-datatype-of-null.aspx"&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;Default datatype of NULL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt; for more information&lt;BR&gt;9&amp;nbsp;&amp;nbsp; Column with UNIQUE constraint will allow only one NULL value in SQL Server (But not true in other RDBMSs)&lt;BR&gt;10 &amp;nbsp;NULL will make SQL Server to use short circuit logic in some cases&lt;BR&gt;&lt;BR&gt;Consider this example &lt;PRE class=brush:sql&gt;select 6/0/null

select null/6/0
&lt;/PRE&gt;
&lt;P&gt;While the first query throws an error the second query returns NULL&lt;/P&gt;
&lt;P&gt;11 The value NULL is not equal to string value 'NULL'&lt;BR&gt;12 By default NULL values come first when a column is ordered in ascending order and come last when ordered in descending order &lt;BR&gt;13 If you dont use GROUP BY clause, the aggregate functions will always return single value (NULL)&amp;nbsp;when the condition is false&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=brush:sql&gt;select sum(col) as col from
(
	select 45 as col
) as t
where 1=0
&lt;/PRE&gt;&lt;BR&gt;The above returns NULL &lt;BR&gt;&lt;BR&gt;14 NULL values are by default omitted in all aggregate functions&lt;BR&gt;&lt;BR&gt;Consider the following example&lt;BR&gt;&lt;PRE class=brush:sql&gt;select sum(col) as col_cum,count(col) as col_count,avg(col*1.0) as col_avg from
(
	select 1 as col union all
	select null as col union all
	select 2 as col union all
	select 3 as col 
) as t
&lt;/PRE&gt;The output is &lt;PRE class=brush:sql&gt;col_cum     col_count   col_avg
----------- ----------- -----------
6           3           2.000000
&lt;/PRE&gt;&lt;BR&gt;15 Agrregate functions cannot be directly applied over NULL value&lt;BR&gt;&lt;BR&gt;This code &lt;PRE class=brush:sql&gt;select sum(null) as null_sum&lt;/PRE&gt;returns the following error &lt;PRE class=brush:sql&gt;Msg 8117, Level 16, State 1, Line 1
Operand data type NULL is invalid for sum operator.
&lt;/PRE&gt;&lt;BR&gt;You can wonder whether NULL is a datatype&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/yzJV96Baq9o" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/70/posts/14865/null-null-null-and-nothing-but-null.aspx</guid><pubDate>Mon, 21 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/70/posts/14865/null-null-null-and-nothing-but-null.aspx</feedburner:origLink></item><item><title>#0162&amp;ndash;SQL Server 2012&amp;ndash;Deprecated Features&amp;ndash;Modify database options with sp_dboption&amp;ndash;Msg 2812</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/ehvF5feQ5sg/0162-sql-server-2012-deprecated-features-modify-database-options-with-spdboption-msg-2812.aspx</link><description>&lt;p&gt;If you have been into database administration &amp;amp; development for a while now, what is the first thing that comes to your mind when someone asks to modify database options like setting the database read-only, or taking it offline? Answer: The &lt;em&gt;sp_dboption&lt;/em&gt; system stored procedure.&lt;/p&gt;  &lt;p&gt;The typical way to modify these database options would be:&lt;/p&gt;  &lt;pre class="brush: sql"&gt;--&amp;quot;Before&amp;quot; state
SELECT 'Before',is_read_only,state,state_desc,* FROM sys.databases db WHERE db.name = 'TestDB'
GO
--Set the database to READ-ONLY mode
sp_dboption 'TestDB','read only','TRUE'
GO
--&amp;quot;After&amp;quot; state
SELECT 'Post Read Only',is_read_only,state,state_desc,* FROM sys.databases db WHERE db.name = 'TestDB'
GO
--Set the database OFFLINE
sp_dboption 'TestDB','offline','TRUE'
GO
--&amp;quot;After&amp;quot; state
SELECT 'All done',is_read_only,state,state_desc,* FROM sys.databases db WHERE db.name = 'TestDB'
GO&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://media.beyondrelational.com/images.ashx?id=252b2c8b49754c5395305325856faa7c&amp;amp;w=-1&amp;amp;h=-1"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://media.beyondrelational.com/images.ashx?id=7cc1d3d1bd3a4e6b8a35e87c8a710880&amp;amp;w=-1&amp;amp;h=-1" width="381" height="241" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;SQL Server 2012 – Replacement – ALTER DATABASE…SET&lt;/h2&gt;

&lt;p&gt;However, starting SQL Server 2012, attempting to change the database options this way would produce the following results.&lt;/p&gt;

&lt;p&gt;&lt;font color="#ff0000" size="2" face="Consolas"&gt;Msg 2812, Level 16, State 62, Line 1 
    &lt;br /&gt;Could not find stored procedure 'sp_dboption'.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;The system could not find the system stored procedure! That’s simply because it has been deprecated! The replacement is the ALTER DATABASE statement, and the existing &lt;font face="Consolas"&gt;sp_dboption&lt;/font&gt; calls need to be modified as demonstrated in the script below:&lt;/p&gt;

&lt;pre class="brush: sql"&gt;--&amp;quot;Before&amp;quot; state
SELECT 'Before',is_read_only,state,state_desc,* FROM sys.databases db WHERE db.name = 'TestDB'
GO
--Set the database to READ-ONLY mode
ALTER DATABASE TestDB SET READ_ONLY
GO
--&amp;quot;After&amp;quot; state
SELECT 'Post Read Only',is_read_only,state,state_desc,* FROM sys.databases db WHERE db.name = 'TestDB'
GO
--Set the database OFFLINE
ALTER DATABASE TestDB SET OFFLINE
GO
--&amp;quot;After&amp;quot; state
SELECT 'All done',is_read_only,state,state_desc,* FROM sys.databases db WHERE db.name = 'TestDB'
GO&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://media.beyondrelational.com/images.ashx?id=4e84e6601ecc4e4db979cf2e8b03dee1&amp;amp;w=-1&amp;amp;h=-1"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://media.beyondrelational.com/images.ashx?id=1c0e5772b0224fc3b8915e27c761a2ea&amp;amp;w=-1&amp;amp;h=-1" width="392" height="269" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;font face="Consolas"&gt;sp_dboption&lt;/font&gt; system stored procedure was marked as “discontinued” ever since SQL Server 2005. Yet, I have seen&amp;#160; a lot of production code this year itself that uses the &lt;font face="Consolas"&gt;sp_dboption&lt;/font&gt; statement. All of this code will break unless it is replaced with &lt;font face="Consolas"&gt;ALTER DATABASE…SET&lt;/font&gt; statement.&lt;/p&gt;

&lt;h2&gt;References:&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;sp_dboption - &lt;a title="http://msdn.microsoft.com/en-us/library/ms187310(v=sql.90).aspx" href="http://msdn.microsoft.com/en-us/library/ms187310(v=sql.90).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms187310(v=sql.90).aspx&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;ALTER DATABASE statement - &lt;a title="http://msdn.microsoft.com/en-us/library/bb522682.aspx" href="http://msdn.microsoft.com/en-us/library/bb522682.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb522682.aspx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Until we meet next time, &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="http://www.cars.com/go/advice/Story.jsp?section=top&amp;amp;subject=more&amp;amp;story=top10annoying&amp;amp;referer&amp;amp;year&amp;amp;aff=national"&gt;&lt;strong&gt;Be courteous. Drive responsibly.&lt;/strong&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/ehvF5feQ5sg" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/77/Posts/14807/0162-sql-server-2012-deprecated-features-modify-database-options-with-spdboption-msg-2812.aspx</guid><pubDate>Mon, 21 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/77/Posts/14807/0162-sql-server-2012-deprecated-features-modify-database-options-with-spdboption-msg-2812.aspx</feedburner:origLink></item><item><title>The sp_dboption system stored procedure was marked as “discontinued” SQl Server 2012</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/-Bw161PzwaU/the-spdboption-system-stored-procedure-was-marked-as-discontinued-sql-server-2012.aspx</link><description>I just learn from [Nakul''s Blog][1] That sp_dboption store procedure is “discontinued” SQl Server 2012 

Replacement is the ALTER DATABASE statement, for existing sp_dboption 


    ALTER DATABASE TestDB SET READ_ONLY

Thank You


  [1]: http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx?tab=posts&amp;bs=43&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/-Bw161PzwaU" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/1/justlearned/388/tips/14913/the-spdboption-system-stored-procedure-was-marked-as-discontinued-sql-server-2012.aspx</guid><pubDate>Mon, 21 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/1/justlearned/388/tips/14913/the-spdboption-system-stored-procedure-was-marked-as-discontinued-sql-server-2012.aspx</feedburner:origLink></item><item><title>Displaying your photo when google shows your beyondrelational.com posts in search results</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/Oe-8qg_U0VM/displaying-your-photo-when-google-shows-your-beyondrelationalcom-posts-in-search-results.aspx</link><description>You may have noticed that google shows a picture of the author when displaying certain posts in the search results. The steps given below will help you to configure your beyondrelational.com profile so that when google search results displays your posts it may also show your photograph. 

Here is an example of how it may look like when google displays one of your posts created at beyondrelational.com, in search results.

![Paresh prajapati search result][1]

**Step 1 - Create a Google Plus profile (if you do not have one already)** 

The photograph comes from google plus profile. So the first step is to create a google plus profile if you do not have one already. If you already have one, then make sure that you have uploaded a profile picture that you would like to see in the search results.

**Step 2 - Add your beyondrelational.com profile URL to Google Plus profile**

The next step is to connect your Google Plus Profile with beyondrelational.com profile. To do that, click on the **profile** button on your google plus profile. 

![Google plus profile][2]

Then click on **edit profile** button.

![edit profile button][3]

Next, locate the section **other profiles** or **Contributor to** towards the bottom of the page. Click on the link and select **Add a custom link**.

![add custom link to beyondrelational.com profile][4]

Give a proper label such as "My beyondrelational.com profile" and add the URL of your beyondrelational.com profile in the second text box. You can open your beyondrelational.com profile by clicking on your name on the top-right corner of the web page if you are logged in to beyondrelational.com

![locate your profile page at beyondrelational.com][5]

Save the information.

**Step 3 - Add your Google Plus profile URL to your beyondrelational.com profile**

Next, go to your profile at beyondrelational.com. Click on the **edit** link shows on the center-top of the profile section. 

![beyondrelational.com profile snippet][6]

Copy and paste your Google Plus profile URL into the last text box and save the information.

![enter google plus profile URL into beyondrelational.com profile][7]

**What Next?**

If you have completed all the steps given above, your profile should be configured correctly by now. The next step is to wait for a few **weeks** before you start seeing your profile photo when google displays search results that includes your posts.

**Notes**

1. Please note that this does not guarantee that the profile photo will be listed in google search results.
2. Steps listed above are just recommendations and Google may or may not show your profile photo when displaying search results
3. The steps listed above are identified by our own experiment

  [1]: http://media.beyondrelational.com/images.ashx?id=44c7dc79956946cfa3850a6cc30c8a7d&amp;w=-1&amp;h=-1
  [2]: http://media.beyondrelational.com/images.ashx?id=769dc9fd39874b80b80770763564a5aa&amp;w=-1&amp;h=-1
  [3]: http://media.beyondrelational.com/images.ashx?id=2fb77739a61844f1a5683f8a12241a1e&amp;w=-1&amp;h=-1
  [4]: http://media.beyondrelational.com/images.ashx?id=ae3577695edb46b691a88fd968dd01f7&amp;w=-1&amp;h=-1
  [5]: http://media.beyondrelational.com/images.ashx?id=28b029a595c84f7789cc8ccb9c8e6216&amp;w=-1&amp;h=-1
  [6]: http://media.beyondrelational.com/images.ashx?id=ca4baa27a31448459fb43ca3cbfb5f06&amp;w=-1&amp;h=-1
  [7]: http://media.beyondrelational.com/images.ashx?id=65906407e8274486b721368c0e39565b&amp;w=-1&amp;h=-1&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/Oe-8qg_U0VM" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/23/pages/362/posts/14914/displaying-your-photo-when-google-shows-your-beyondrelationalcom-posts-in-search-results.aspx</guid><pubDate>Mon, 21 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/23/pages/362/posts/14914/displaying-your-photo-when-google-shows-your-beyondrelationalcom-posts-in-search-results.aspx</feedburner:origLink></item><item><title>What is wrong with IsNumeric()?</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/E7C-aq_FwKU/what-is-wrong-with-isnumeric.aspx</link><description>T-SQL's ISNUMERIC() function has a problem. It can falsely interpret non-numeric letters and symbols (such as D, E, and £), and even tabs (CHAR(9)) as numeric.&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/E7C-aq_FwKU" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/1/justlearned/388/tips/14894/what-is-wrong-with-isnumeric.aspx</guid><pubDate>Sat, 19 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/1/justlearned/388/tips/14894/what-is-wrong-with-isnumeric.aspx</feedburner:origLink></item><item><title>5 Ways to Make Ajax Calls with jQuery</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/AMp5xAAwjOo/5-ways-to-make-ajax-calls-with-jquery.aspx</link><description>There is five way make  Ajax calls with Jquery 
 

   

      load(): Load a piece of html into a container DOM.
    
      $.getJSON(): Load a JSON with GET method.
    
     $.getScript(): Load a JavaScript.
    
      $.get(): Use this if you want to make a GET call and play extensively with the response.
    
       $.post(): Use this if you want to make a POST call and don’t want to load the response to some container DOM.
    
       $.ajax(): Use this if you need to do something when XHR fails, or you need to specify ajax options (e.g. cache: true) on the fly.&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/AMp5xAAwjOo" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/1/justlearned/440/tips/14903/5-ways-to-make-ajax-calls-with-jquery.aspx</guid><pubDate>Sat, 19 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/1/justlearned/440/tips/14903/5-ways-to-make-ajax-calls-with-jquery.aspx</feedburner:origLink></item><item><title>What is wrong with IsNumeric()?</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/-428OQNieiM/what-is-wrong-with-isnumeric.aspx</link><description>&lt;P&gt;I face very strange thing with IsNumeric() function in sql&lt;/P&gt;
&lt;P&gt;select IsNumeric('1234D234')&lt;BR&gt;select IsNumeric('123A123')&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Both query have alphanumeric value and both give different answer. very strange.&lt;/P&gt;
&lt;P&gt;After a long time spent on google i get solution. We can say or cannot say that there are bug in IsNumeric() function.&lt;/P&gt;
&lt;P&gt;IsNumeric() can falsely interpret non-numeric letters and symbols (such as D, E, and £, $), and even tabs (CHAR(9)) as numeric.&lt;/P&gt;
&lt;P&gt;With this character, Why IsNumeric() can not give right answer? because D stand for Decimal. that value consider as a decimal value, E stand for exponential and $,£ is stand for currency symbol. so Isnumeric() fail to convert those values which has like D,E,$,£ characters.&lt;/P&gt;
&lt;P&gt;so to get around this problem, we can create user define function which find the value is integer/numeric. as below.&lt;/P&gt;
&lt;P&gt;CREATE FUNCTION dbo.CheckNumeric&lt;BR&gt;(&lt;BR&gt;&amp;nbsp; @num VARCHAR(64)&lt;BR&gt;)&lt;BR&gt;RETURNS BIT&lt;BR&gt;&amp;nbsp; BEGIN&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF LEFT(@num, 1) = '-'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET @num = SUBSTRING(@num, 2, LEN(@num))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DECLARE @pos TINYINT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET @pos = 1 + LEN(@num) - CHARINDEX('.', REVERSE(@num))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN CASE&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN PATINDEX('%[^0-9.-]%', @num) = 0&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND @num NOT IN ('.', '-', '+', '^')&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND LEN(@num)&amp;gt;0&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND @num NOT LIKE '%-%'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AND&lt;BR&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;(&lt;BR&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;((@pos = LEN(@num)+1)&lt;BR&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;OR @pos = CHARINDEX('.', @num))&lt;BR&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;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;THEN&amp;nbsp;&amp;nbsp; 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ELSE&lt;BR&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;0&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;END&lt;BR&gt;GO&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;P&gt;CREATE FUNCTION dbo.CheckInteger&lt;BR&gt;(&lt;BR&gt;@num VARCHAR(64)&lt;BR&gt;)&lt;BR&gt;RETURNS BIT&lt;BR&gt;BEGIN&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;IF LEFT(@num, 1) = '-'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SET @num = SUBSTRING(@num, 2, LEN(@num))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;RETURN CASE&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHEN PATINDEX('%[^0-9-]%', @num) = 0&lt;BR&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;AND CHARINDEX('-', @num) &amp;lt;= 1&lt;BR&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;AND @num NOT IN ('.', '-', '+', '^')&lt;BR&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;AND LEN(@num)&amp;gt;0&lt;BR&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;AND @num NOT LIKE '%-%'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;THEN&lt;BR&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;1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ELSE&lt;BR&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;0&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END&lt;BR&gt;GO&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://codesimplified.com/2012/05/18/what-is-wrong-with-isnumeric/"&gt;http://codesimplified.com/2012/05/18/what-is-wrong-with-isnumeric/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Learn From: &lt;A href="http://classicasp.aspfaq.com/general/what-is-wrong-with-isnumeric.html"&gt;http://classicasp.aspfaq.com/general/what-is-wrong-with-isnumeric.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/-428OQNieiM" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/374/posts/14897/what-is-wrong-with-isnumeric.aspx</guid><pubDate>Sat, 19 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/374/posts/14897/what-is-wrong-with-isnumeric.aspx</feedburner:origLink></item><item><title>SSIS &amp;ndash; TransactionOption NotSupported</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/goVAemZGAps/ssis-transactionoption-notsupported.aspx</link><description>&lt;p&gt;When I take interview for SSIS I tend to ask this question one way or other. Here goes the question: “&lt;em&gt;What will happen if I have a sequence container with TransactionOption set to Required. This Sequence Container contains 3 Execute SQL Tasks. Out of the 3 Execute SQL Tasks 2 have TransactionOption set to Supported while the third is set to NotSupported. What will be the impact on the 1st 2 Execute SQL Task’s operation if the 3rd Execute SQL Task Fails?&lt;/em&gt;”&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Let me show the scenario that is described above.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://media.beyondrelational.com/images.ashx?id=aec1c7daa885467fb776af88feaa5d00&amp;amp;w=-1&amp;amp;h=-1" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://media.beyondrelational.com/images.ashx?id=386f02c5310145cb99de7798dcca163a&amp;amp;w=-1&amp;amp;h=-1" width="244" height="152" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The details of the tasks setup is available in the table below:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td width="153"&gt;&lt;font color="#ff8040" size="2"&gt;&lt;strong&gt;TASK&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td width="164"&gt;&lt;font color="#ff8040" size="2"&gt;&lt;strong&gt;Task/Container&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td width="153"&gt;&lt;font color="#ff8040" size="2"&gt;&lt;strong&gt;TransactionOption&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td width="218"&gt;&lt;font color="#ff8040" size="2"&gt;&lt;strong&gt;Query&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Tran_Required&lt;/td&gt;        &lt;td&gt;Sequence Container&lt;/td&gt;        &lt;td&gt;Required&lt;/td&gt;        &lt;td&gt;NA- Container&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Tran_Supported&lt;/td&gt;        &lt;td&gt;Execute SQL Task&lt;/td&gt;        &lt;td&gt;Supported&lt;/td&gt;        &lt;td&gt;Select 1&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Tran_Supported1&lt;/td&gt;        &lt;td&gt;Execute SQL Task&lt;/td&gt;        &lt;td&gt;Supported&lt;/td&gt;        &lt;td width="218"&gt;Truncate Table Tbl         &lt;br /&gt;GO          &lt;br /&gt;INSERT INTO [Tbl] ([id])           &lt;br /&gt;VALUES (1)&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Tran_NOT_Supproted&lt;/td&gt;        &lt;td&gt;Execute SQL Task&lt;/td&gt;        &lt;td&gt;NOT Supproted&lt;/td&gt;        &lt;td&gt;Select 1/0&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So coming back to the interview, 99% of cases I get the answer that there will be no impact of the 3rd Execute SQL Task (&lt;em&gt;Tran_NOT_Supported&lt;/em&gt;) failing. They say that the record inserted by the task &lt;em&gt;Tran_Supported1&lt;/em&gt; will not be rolled back and the table will have one more entry created. Let us see what really happens.&lt;/p&gt;  &lt;p&gt;The package executes as shown below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://media.beyondrelational.com/images.ashx?id=ad8d230508ec4f05b753911155c0eca6&amp;amp;w=-1&amp;amp;h=-1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://media.beyondrelational.com/images.ashx?id=b3fe039c088e4286be1bb9b8558164ec&amp;amp;w=-1&amp;amp;h=-1" width="244" height="150" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In the data base too there are no records inserted.&lt;/p&gt;  &lt;p&gt;SELECT COUNT(1) FROM Tbl&lt;/p&gt;  &lt;p&gt;Outcome:&lt;/p&gt;  &lt;p&gt;Count   &lt;br /&gt;0&lt;/p&gt;  &lt;p&gt;So now we see that &lt;em&gt;NotSupported&lt;/em&gt; is not working the way we expect it to. Let us see how can we overcome this. There are multiple ways to achieve this I will show 2 methods to do this.&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff8000" size="3"&gt;&lt;strong&gt;First approach&lt;/strong&gt;&lt;/font&gt; is go to the &lt;em&gt;EventHandler&lt;/em&gt; of the &lt;em&gt;Tran_NOT_Suppoerted. &lt;/em&gt;On the Event &lt;em&gt;OnError &lt;/em&gt;enable it. Select the system variable &lt;em&gt;Propogate&lt;/em&gt; and set its value to False. That’s all you need to do and it will work the way we expect it to work.&lt;/p&gt;  &lt;p&gt;When we execute the package now we get the below behaviour:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://media.beyondrelational.com/images.ashx?id=0cefac0a563a4bdf90a7bc644e8a25d8&amp;amp;w=-1&amp;amp;h=-1"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://media.beyondrelational.com/images.ashx?id=1ba562414f094e49882d70b04d836939&amp;amp;w=-1&amp;amp;h=-1" width="244" height="150" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In the database we get the below result&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;SELECT COUNT(1) FROM Tbl&lt;/p&gt;  &lt;p&gt;Outcome:&lt;/p&gt;  &lt;p&gt;Count   &lt;br /&gt;1&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff8000" size="3"&gt;&lt;strong&gt;Second approach&lt;/strong&gt;&lt;/font&gt; is go to the properties of the Sequence Container &lt;em&gt;Tran_REQUIRED.&lt;/em&gt; Change the value of the property &lt;em&gt;MaxErrorCount to ‘2’&lt;/em&gt; from default value &lt;em&gt;‘1’. &lt;/em&gt;That’s even simpler compared to the first approach(esp. for lazy people like me).&lt;/p&gt;  &lt;p&gt;If you execute the package now you will get the expected behaviour as in the previous case.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;By these 2 examples you should I guessed the reason why &lt;em&gt;NotSupproted&lt;/em&gt; does not work the way it should or we feel that way. &lt;/p&gt;  &lt;p&gt;What is happening is that the &lt;em&gt;NotSupproted&lt;/em&gt; is working as it is, but as a child fails the error propagates to the parent container and the Parent fails due to which the Transaction is rolled back. &lt;/p&gt;  &lt;p&gt;The transaction is not getting rolled back due the failure of the not Supported Tasks but the failure of the Sequence container.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/goVAemZGAps" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/106/Posts/14884/ssis-transactionoption-notsupported.aspx</guid><pubDate>Fri, 18 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/106/Posts/14884/ssis-transactionoption-notsupported.aspx</feedburner:origLink></item><item><title>Use system functions cleverly</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/fOnCDWBRcx4/use-system-functions-cleverly.aspx</link><description>&lt;P&gt;My Co-worker complained me that AVG function is not properly working in SQL Server whereas it works correctly in mysql. I immediately told him that AVG does the implicit convertion by default and the result may be wrong (based on datatype). &lt;/P&gt;
&lt;P&gt;Consider the following set of data&lt;/P&gt;&lt;PRE class=brush:sql&gt;select avg(col) from
(
	select 1 as col union all
	select 2
) as t
&lt;/PRE&gt;The result is &lt;PRE class=brush:sql&gt;average
-----------
1
&lt;/PRE&gt;As you see, the result is not 1.5&amp;nbsp;but it is 1 becuase the return type of AVG function is same as that of column it is applied for. The datatype of col is INT and AVG function CASTs 1.5 into 1. To avoid this you need to CAST the datatype into DECIMAL (or multiply column by 1.0) &lt;PRE class=brush:sql&gt;select avg(col*1.0) as average,avg(cast(col as decimal(12,2))) as average from
(
	select 1 as col union all
	select 2
) as t
&lt;/PRE&gt;The result is &lt;PRE class=brush:sql&gt;average                                 average
--------------------------------------- ---------------------------------------
1.500000                                1.500000
&lt;/PRE&gt;So you need to aware of this when using system functions whose datatype depends on the datatype of the column&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/fOnCDWBRcx4" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/70/posts/14857/use-system-functions-cleverly.aspx</guid><pubDate>Thu, 17 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/70/posts/14857/use-system-functions-cleverly.aspx</feedburner:origLink></item><item><title>#0161 - SQL Server 2012&amp;ndash;Deprecated Features-CREATE TRIGGER-WITH APPEND option</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/XsSJBMWT3dg/0161-sql-server-2012-deprecated-features-create-trigger-with-append-option.aspx</link><description>&lt;p&gt;There would hardly be a database developer who hasn’t written triggers in their career. It is fairly common knowledge that you can have more than one trigger of the same type, i.e. INSERT/UPDATE/DELETE on the same table. Therefore, the following is perfectly valid:&lt;/p&gt;  &lt;pre class="brush: sql"&gt;USE tempdb
GO
CREATE TABLE dbo.AppendTriggerTest (RowId INT IDENTITY(1,1),
                                    RowValue VARCHAR(50)
                                   )
GO

CREATE TRIGGER dbo.MainTrigger
ON dbo.AppendTriggerTest
FOR INSERT
AS
BEGIN
  PRINT '&amp;lt;&amp;lt;&amp;lt;&amp;lt; INFO &amp;gt;&amp;gt;&amp;gt;&amp;gt; Main Trigger fired...'
END
GO

CREATE TRIGGER dbo.AppendTrigger
ON dbo.AppendTriggerTest
FOR INSERT
AS
BEGIN
  PRINT '&amp;lt;&amp;lt;&amp;lt;&amp;lt; INFO &amp;gt;&amp;gt;&amp;gt;&amp;gt; Append Trigger fired...'
END
GO&lt;/pre&gt;

&lt;p&gt;However, this was not the case in the days of SQL Server 6.5. In order to have a more than one trigger of the same type on the same table, the WITH APPEND clause needs to be used, which is effectively interpreted as AFTER. In the days of SQL Server 6.5, the trigger “AppendTrigger” will need to be defined as:&lt;/p&gt;

&lt;pre class="brush: sql"&gt;CREATE TRIGGER dbo.AppendTrigger
ON dbo.AppendTriggerTest
FOR INSERT
WITH APPEND     --NOTICE THE WITH APPEND CLAUSE HERE, 
                --DEPRECATED FROM SQL 2012 ONWARDS
AS
BEGIN
  PRINT '&amp;lt;&amp;lt;&amp;lt;&amp;lt; INFO &amp;gt;&amp;gt;&amp;gt;&amp;gt; Append Trigger fired...'
END
GO&lt;/pre&gt;

&lt;p&gt;Starting SQL Server 2012, the compatibility levels lower than 90 (i.e. SQL Server 2000 and below) are no longer supported. In accordance to this, the WITH APPEND clause has also been deprecated.&lt;/p&gt;

&lt;p&gt;I assume that you are not using this in your production code, if you are, please upgrade! There is no workaround/alternate to this.&lt;/p&gt;

&lt;h2&gt;Reference:&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;SQL 2000 Books-On-Line page for CREATE TRIGGER: &lt;a title="http://msdn.microsoft.com/en-us/library/aa258254(v=sql.80).aspx" href="http://msdn.microsoft.com/en-us/library/aa258254(v=sql.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa258254(v=sql.80).aspx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Until we meet next time, &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="http://www.cars.com/go/advice/Story.jsp?section=top&amp;amp;subject=more&amp;amp;story=top10annoying&amp;amp;referer&amp;amp;year&amp;amp;aff=national"&gt;&lt;strong&gt;Be courteous. Drive responsibly.&lt;/strong&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/XsSJBMWT3dg" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/77/Posts/14509/0161-sql-server-2012-deprecated-features-create-trigger-with-append-option.aspx</guid><pubDate>Thu, 17 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/77/Posts/14509/0161-sql-server-2012-deprecated-features-create-trigger-with-append-option.aspx</feedburner:origLink></item><item><title>SQL Server - What a table is called, if it has no clustered index?</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/3TPjICQ5kyw/sql-server-what-a-table-is-called-if-it-has-no-clustered-index.aspx</link><description>Answer:Heap&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/3TPjICQ5kyw" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/17/interview-questions/238/interview-questions/14873/sql-server-what-a-table-is-called-if-it-has-no-clustered-index.aspx</guid><pubDate>Thu, 17 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/17/interview-questions/238/interview-questions/14873/sql-server-what-a-table-is-called-if-it-has-no-clustered-index.aspx</feedburner:origLink></item><item><title>What is the use of SQL Server Browser ?</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/8xW5vGFrgFA/what-is-the-use-of-sql-server-browser-.aspx</link><description>SQL Server Browser contributes to the following actions:

1.Browsing a list of available servers.

2.connecting to correct server instance.

3.Connecting to dedicated administrator connection(DAC).&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/8xW5vGFrgFA" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/17/interview-questions/238/interview-questions/14855/what-is-the-use-of-sql-server-browser-.aspx</guid><pubDate>Wed, 16 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/17/interview-questions/238/interview-questions/14855/what-is-the-use-of-sql-server-browser-.aspx</feedburner:origLink></item><item><title>Getting Started with ASP.NET MVC - Part 5: How to do programming with razor syntax</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/tNeTsbFd0bs/getting-started-with-aspnet-mvc-part-5-how-to-do-programming-with-razor-syntax.aspx</link><description>In previous chapter, we have learnt about different view engines. In this chapter, we are going learn about how to do programming with the Razor syntax.

**What is razor syntax?**

As we all know, with ASP.NET MVC3 Microsoft has introduced new view engine, Razor, which was developed to simplify earlier aspx view engine syntax. Here you can write things @character, which called magic character in razor syntax. In razor view engine, you have .cshtml and .vbhtml for view. Where .cshtml is for C# language and .vbhtml is for VB.NET language.

**Fundamentals of razor syntax:**

  - @character is most important character in the Razor Syntax. You can do many things with @Character. Like to print the current datetime you can use @character as shown below:
   &lt;pre class="brush:plain"&gt;
    Current DataTime: @DateTime.Now
    &lt;/pre&gt;
  It will print current date time on the browser.
 
![Date Time][1]

  - You can also write single line statement and variable declaring with @{} syntax as shown below:
   &lt;pre class="brush:plain"&gt;
    @{ var number = 10; }

    Number is: @number 
    &lt;/pre&gt;

  It will print number in browser as below:

![Numbers][2]

  - Same way you can also have multiline syntax with @{} syntax like following. 
&lt;pre class="brush:plain"&gt;
    @{ 
    var firstName = "jalpesh";
    var lastName="vadgama";
    var nameMessage = string.Format("My full name is : {0} {1}", firstName, lastName);
    }

    My name is :@nameMessage 
&lt;/pre&gt;

  It will print the name as shown below:

![Full Name][3]

  - You can also print a path with “\” character. It supports escape character also.
&lt;pre class="brush:plain"&gt;
    @{ var filePath = @"C:\ApplicationFolder\"; }

    The file path is: @filePath
&lt;/pre&gt;
    
  It will print filepath in browser as follows:

![Escape Sequence][4]

Therefore, from all above syntax you can see @ is a magic character for the razor syntax and you can print anything with @character.

**Advance syntaxes for razor:**

  - **HTML Expressions in razor syntax:**

  Like other view engine, @razor syntax also supports the HTML expression seamless. You can write composite code with html tags and css etc. @ character with razor syntax supports it all.

  Some of the examples are:
&lt;pre class="brush:plain"&gt;
    @{ var name = "Jalpesh"; }

    The &lt;b&gt;Name&lt;/b&gt;: &lt;i&gt;@name&lt;/i&gt;
&lt;/pre&gt;

  It will print name in italic characters.

  - **IF and Else loop with razor syntax:**

  Like any other programming language Razor syntax also supports the ‘if and else’ loop. We can write if and loop like following.
 &lt;pre class="brush:plain"&gt;
    @{
    var message = string.Empty ;
    if(IsPost)
    {
    message = "Page was postback";
    }
    else
    {
    message = "Page was not posback";
    }
    }

    &lt;input type="submit" value="Click me to postback" /&gt;
    &lt;b&gt;Posback Status:@message &lt;/b&gt;
&lt;/pre&gt;
  As you can see in the above code I have checked IsPost with ‘if and else’ loop and assigning a message-to-message variable. In addition, I have a button for postback. Also, I have taken a form with post method on a submit button once we click it will post back the form. So first, we run application without postbacking the form. It will print message in browser like following:

![No Postback][5]

  Now once you click on **submit** button it will look like following:

![With Postback][6]

  - **For loop in Razor Syntax:**

  Razor syntax supports for loops also. Let’s take a simple example of for loop and then we will print a number with help of for loop. 

&lt;pre class="brush:plain"&gt;
    @for(var i = 1; i &lt; 10; i++)
    {
    &lt;p&gt;Number @i&lt;/p&gt;
    }
&lt;/pre&gt;
  This will print number like following in browser:

![For Loop][7]

  - **For each loop:** 

  For each loop in razor syntax look like following. Here I am going print all the variable collection.
&lt;pre class="brush:plain"&gt;
    @foreach (var variables in Request.ServerVariables)
    {
    }
&lt;/pre&gt;
  It will print server variables name like following.

![For each loop][8]

  - **Switch case statement in Razor Syntax:**

  Following is a example of switch case syntax and based on case selected it will print the output.
&lt;pre class="brush:plain"&gt;
    @{
    var number=1; var message = string.Empty;
    switch(number)
    {
    case 1:
    message = "Number is 1";
    break;
    case 2:
    message = "Number is 2";
    break;
    default:
    message = "Number is 0";
    break;
    }
    &lt;p&gt;@message&lt;/p&gt;
    }
&lt;/pre&gt;
   It will print case 1 message as we have number assigned to 1 in browser like following:

![Switch Case][9]

  - **Commenting in Razor Syntax:**

   Like any other languages, Razor syntax also have comments. Following are the syntaxs for single line and multi-line comments.
&lt;pre class="brush:plain"&gt;
    @* single line comment. *@

    @*
    Multi - Line
    Comment
    *@
&lt;/pre&gt;
That is it. As you can see Razor syntax is one of easiest syntax to learn. Hope you liked it. Stay tuned for next chapter. In next chapter, we are going to learn about entity framework and how we can use that in ASP.NET MVC.


  [1]: http://beyondrelational.com/images/images.ashx?id=241325a4a18f4d9ea282693030c5b786&amp;w=0&amp;h=0
  [2]: http://beyondrelational.com/images/images.ashx?id=05cc5b7b6785410a94a281662e3ffe30&amp;w=0&amp;h=0
  [3]: http://beyondrelational.com/images/images.ashx?id=1d75a35ae83b453e8f28d96c71c8a37e&amp;w=0&amp;h=0
  [4]: http://beyondrelational.com/images/images.ashx?id=e42062764fd240f0b8f1613b4578ad92&amp;w=0&amp;h=0
  [5]: http://beyondrelational.com/images/images.ashx?id=818fe6e005be433e87e2bc34c822a895&amp;w=0&amp;h=0
  [6]: http://beyondrelational.com/images/images.ashx?id=d87e92f15b5b4504b1f372ee878071e7&amp;w=0&amp;h=0
  [7]: http://beyondrelational.com/images/images.ashx?id=c8c953e909ac439e849218c501f883c6&amp;w=0&amp;h=0
  [8]: http://beyondrelational.com/images/images.ashx?id=d14ac9bd2bca415298a9f5daf865241e&amp;w=0&amp;h=0
  [9]: http://beyondrelational.com/images/images.ashx?id=dad1394ae10341bd9baedcdff1c87490&amp;w=0&amp;h=0&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/tNeTsbFd0bs" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/12/tutorials/33/tutorials/11970/getting-started-with-aspnet-mvc-part-5-how-to-do-programming-with-razor-syntax.aspx</guid><pubDate>Tue, 15 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/12/tutorials/33/tutorials/11970/getting-started-with-aspnet-mvc-part-5-how-to-do-programming-with-razor-syntax.aspx</feedburner:origLink></item><item><title>Compare numbers stored as characters seperated by space</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/GE8QbNM8hb0/compare-numbers-stored-as-characters-seperated-by-space.aspx</link><description>&lt;P&gt;In SQL forums, one of the memebers asked this question. &lt;BR&gt;&lt;BR&gt;&lt;EM&gt;&lt;FONT color=#800080&gt;&lt;STRONG&gt;"In the table a varchar column has values like '2.2020 30 4.0000', '2.20200 30 4.00', etc. When I pass a parameter with the value '2.202 30 4.0' , the above value should be returned as output. How do I do it?"&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;(Note that 2.2020&amp;nbsp; and 2.20200 from column value and 2.202 from parameter value are same when compared as Numeric values)&lt;/P&gt;
&lt;P&gt;Well. My first advice is not to store multiple values as characters in the single column. Normalization should be applied. If there is no chance to modify the existing structure, there are two ways to compare&lt;/P&gt;
&lt;P&gt;1 Split the column value and parameter value by space and compare each number (This whill be most suggested as usual)&lt;/P&gt;
&lt;P&gt;2 Do not use any split function. Make some changes in the column and parameter to effectively compare the value. &lt;/P&gt;
&lt;P&gt;Ok. We will see how to implement Method 2&lt;/P&gt;
&lt;P&gt;Consider the following set of data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=brush:sql&gt;declare @t table(col varchar(100))
insert into @t
select	'2.2020 30 4.0000' union all
select	'2.2020 30 4.05000' union all
select	'2.20200 30 4.00200' union all
select	'2.2020 300 4.00' union all
select	'2.202000 30 4.0000' 


declare @s varchar(100),@sql varchar(max)
set @s= '2.202 30 4.0' 
set @sql=''
select 
	@sql=@sql+
		'select '''+col+''' as original_col,sum('+replace(col,' ','+')+') as col1,sum('+replace(@s,' ','+')+') as col2,'''+@s+''' as variable_val union all ' 
from @t
select @sql='select original_col as col_val,variable_val from ('+left(@sql,len(@sql)-11)+') as t where col1=col2 and replace(replace(original_col,''0'','' ''),'' '','''')=replace(replace(variable_val,''0'','' ''),'' '','''')'
exec(@sql)
 
&lt;/PRE&gt;Now look at the result &lt;PRE class=brush:sql&gt;col_val            variable_val
------------------ ------------
2.2020 30 4.0000   2.202 30 4.0
2.20200 30 4.00    2.202 30 4.0
&lt;/PRE&gt;If you have any other method please post it in comment's section&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/GE8QbNM8hb0" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/70/posts/14825/compare-numbers-stored-as-characters-seperated-by-space.aspx</guid><pubDate>Tue, 15 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/70/posts/14825/compare-numbers-stored-as-characters-seperated-by-space.aspx</feedburner:origLink></item><item><title>comment code using Razor view engine</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/nWYJibVXT0o/comment-code-using-razor-view-engine.aspx</link><description>I just learn from mvc tutorial That we can comment code in Razor view engine also

This is syntax for comment code

Single line

    @* single line comment. *@

Multiline

    @*
    Line1
    Line2 
    Line3
    *@

Thank You&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/nWYJibVXT0o" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/1/justlearned/409/tips/14837/comment-code-using-razor-view-engine.aspx</guid><pubDate>Tue, 15 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/1/justlearned/409/tips/14837/comment-code-using-razor-view-engine.aspx</feedburner:origLink></item><item><title>HotKeys to comment in VisualStudio/ManagementStudio</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/xMcM1xbIT40/hotkeys-to-comment-in-visualstudiomanagementstudio.aspx</link><description>ManagementStudio &amp; Visual Studio:
&lt;ul&gt;
	&lt;li&gt;press &lt;kbd&gt;[Ctrl+KC]&lt;/kbd&gt; to comment code (works also on selected lines), but comment out only whole lines.&lt;/li&gt;
	&lt;li&gt;press &lt;kbd&gt;[Ctrl+KU]&lt;/kbd&gt; to uncomment code (works also on selected lines), but comment out only whole lines.&lt;/li&gt;
&lt;/ul&gt;
but for VS, at HTML source, it may comment only parts of code.&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/xMcM1xbIT40" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/1/justlearned/412/tips/14838/hotkeys-to-comment-in-visualstudiomanagementstudio.aspx</guid><pubDate>Tue, 15 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/1/justlearned/412/tips/14838/hotkeys-to-comment-in-visualstudiomanagementstudio.aspx</feedburner:origLink></item><item><title>A Great Chart for SQL Server Unofficial Builds that made our work easy.</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/rx5lWoFB0Cc/a-great-chart-for-sql-server-unofficial-builds-that-made-our-work-easy.aspx</link><description>Few hours before I was checking the special features, fixes, and builds of MS SQL Server. I got a great blog...So interesting....This contains unofficial build chart lists all of the known KB articles, hotfixes and other builds of MS SQL Server 2012, 2008 R2, 2008, 2005, 2000 and 7.0 that have been released.&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/rx5lWoFB0Cc" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/1/justlearned/388/tips/14845/a-great-chart-for-sql-server-unofficial-builds-that-made-our-work-easy.aspx</guid><pubDate>Tue, 15 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/1/justlearned/388/tips/14845/a-great-chart-for-sql-server-unofficial-builds-that-made-our-work-easy.aspx</feedburner:origLink></item><item><title>sysname does not allow null by default</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/F9EIRqi4lng/sysname-does-not-allow-null-by-default.aspx</link><description>sysname is a special datatype and by default it does not allow NULL, you need to explicitly add NULL in table definition to allow null. sysname is defined as 

    nvarchar(128) not null

Below code will give error

    declare @t1 table ( c1 int, c2 sysname)
    insert into @t1 
    select 1, NULL&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/F9EIRqi4lng" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/1/justlearned/388/tips/14614/sysname-does-not-allow-null-by-default.aspx</guid><pubDate>Mon, 14 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/1/justlearned/388/tips/14614/sysname-does-not-allow-null-by-default.aspx</feedburner:origLink></item><item><title>Adding Line break in SSRS expression( Reporting Services )</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/fYD2FGA8gGo/adding-line-break-in-ssrs-expression-reporting-services-.aspx</link><description>**&amp; VbCRLF  &amp;**&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/fYD2FGA8gGo" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/1/justlearned/388/tips/14826/adding-line-break-in-ssrs-expression-reporting-services-.aspx</guid><pubDate>Mon, 14 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/1/justlearned/388/tips/14826/adding-line-break-in-ssrs-expression-reporting-services-.aspx</feedburner:origLink></item><item><title>#0160-SQL Server 2012&amp;ndash;Deprecated Features-32-bit systems - AWE (Address Windowing Extensions) no longer supported</title><link>http://feedproxy.google.com/~r/TsqlChallenges/~3/sVf7Iaeamak/0160-sql-server-2012-deprecated-features-32-bit-systems-awe-address-windowing-extensions-no-longer-s.aspx</link><description>&lt;P&gt;For anybody who has worked with software products or recently bought a new piece of computer hardware, the terms “32-bit support” and “64-bit support” would be familiar. &lt;/P&gt;
&lt;P&gt;One of the prime differences between the 32-bit &amp;amp; 64-bit systems is the amount of memory that can be addressed by the operating system. 32-bit systems cannot address a memory space that is greater than 3GB. While 64-bit systems can run a 32-bit application under the Windows-On-Windows shell, these applications would not be able to take advantage of the increased memory addressing capabilities of the underlying operating system. Insufficient memory on a SQL Server host puts the system under undue memory pressure . Memory management is therefore a tricky and critical issue for 32-bit applications running on 64-bit environments.&lt;/P&gt;
&lt;P&gt;SQL Server 2005 introduced a switch on the SQL Server instance that allows the instance to use “AWE” (Address windowing extensions) for memory allocation. What this switch does is that it allows a 32-bit instance of SQL Server to access memory that is greater than 3GB. The screen-show below shows the location of this switch in the “Server Properties” dialog of the SSMS for SQL Server 2008.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://media.beyondrelational.com/images.ashx?id=a2686c6fc5254893b9957f74b9914214&amp;amp;w=-1&amp;amp;h=-1"&gt;&lt;IMG style="BACKGROUND-IMAGE: none; BORDER-RIGHT-WIDTH: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; PADDING-TOP: 0px" title=image border=0 alt=image src="http://media.beyondrelational.com/images.ashx?id=3a8a164828824a9bbe4bde063f94570a&amp;amp;w=-1&amp;amp;h=-1" width=448 height=402&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Server properties dialog for SQL Server 2008&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;However, things are changing with SQL Server 2012 – Address Windowing Extensions (AWE) is no longer supported. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://media.beyondrelational.com/images.ashx?id=3b66d8f33ca540fc8d23ab39f92bfd3b&amp;amp;w=-1&amp;amp;h=-1"&gt;&lt;IMG style="BACKGROUND-IMAGE: none; BORDER-RIGHT-WIDTH: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; PADDING-TOP: 0px" title=image border=0 alt=image src="http://media.beyondrelational.com/images.ashx?id=59570e18f5d84b4d985d7aa43d87c017&amp;amp;w=-1&amp;amp;h=-1" width=454 height=406&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Server properties dialog for SQL Server 2012&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This switch also has an equivalent advanced option called – “&lt;FONT face=Consolas&gt;awe enabled&lt;/FONT&gt;”. Attempting to access this option in SQL Server 2012 results in an error.&lt;/P&gt;&lt;PRE class="brush: sql"&gt;--Display advanced configuration options
sp_configure 'show advanced options',1
RECONFIGURE
GO
--Attempt to fetch the value of the AWE flag
sp_configure 'awe enabled'
GO
--Hide advanced configuration options
sp_configure 'show advanced options',0
RECONFIGURE
GO&lt;/PRE&gt;
&lt;P&gt;Here's the result:&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Consolas&gt;&lt;FONT size=2&gt;Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install. &lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#ff0000&gt;Msg 15123, Level 16, State 1, Procedure sp_configure, Line 62 &lt;BR&gt;The configuration option 'awe enabled' does not exist, or it may be an advanced option.&lt;/FONT&gt; &lt;BR&gt;Configuration option 'show advanced options' changed from 1 to 0. Run the RECONFIGURE statement to install.&lt;/FONT&gt;&lt;/FONT&gt; &lt;BR&gt;&lt;/P&gt;
&lt;H2&gt;Soltuions&lt;/H2&gt;There are no workarounds to this (in my opinion,&amp;nbsp;teams&amp;nbsp;shouldn't even be thinking in this direction). It is imperative that the 64-bit edition of the SQL Server must be used in order to access over 4GB of physical memory. 
&lt;H2&gt;References:&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;On SQL Server Books On Line: &lt;A href="http://msdn.microsoft.com/en-us/library/ms190673(v=sql.105).aspx"&gt;Enabling AWE memory for SQL Server&lt;/A&gt; 
&lt;LI&gt;Pinal Dave (&lt;A href="http://blog.sqlauthority.com"&gt;B&lt;/A&gt;|&lt;A href="https://twitter.com/pinaldave"&gt;T&lt;/A&gt;) post: &lt;A href="http://blog.sqlauthority.com/2009/03/20/sql-server-awe-address-windowing-extensions-explained-in-simple-words/"&gt;AWE Explained in simple words&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Until we meet next time, &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;A href="http://www.cars.com/go/advice/Story.jsp?section=top&amp;amp;subject=more&amp;amp;story=top10annoying&amp;amp;referer&amp;amp;year&amp;amp;aff=national"&gt;&lt;STRONG&gt;Be courteous. Drive responsibly.&lt;/STRONG&gt;&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;img src="http://feeds.feedburner.com/~r/TsqlChallenges/~4/sVf7Iaeamak" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://beyondrelational.com/modules/2/blogs/77/Posts/14504/0160-sql-server-2012-deprecated-features-32-bit-systems-awe-address-windowing-extensions-no-longer-s.aspx</guid><pubDate>Mon, 14 May 2012 00:00:00 GMT</pubDate><feedburner:origLink>http://beyondrelational.com/modules/2/blogs/77/Posts/14504/0160-sql-server-2012-deprecated-features-32-bit-systems-awe-address-windowing-extensions-no-longer-s.aspx</feedburner:origLink></item></channel></rss>

