<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://beyondrelational.com/live/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag '2012'</title><link>http://beyondrelational.com/live/search/SearchResults.aspx?a=1&amp;o=DateDescending&amp;tag=2012&amp;orTags=0</link><description>Search results matching tag '2012'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Dedicated Admin Connection (DAC) error in SQL Server 2012 RC0</title><link>http://beyondrelational.com/live/blogs/sankarreddy/archive/2012/01/22/dedicated-admin-connection-dac-error-in-sql-server-2012-rc0.aspx</link><pubDate>Sun, 22 Jan 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">6e5011fa-7db5-4df3-bb79-9085c1d333b3:15287</guid><dc:creator>SankarReddy13</dc:creator><description>&lt;p&gt;Dedicated Admin Connection (DAC) in SQL Server doesn&amp;#8217;t need any introduction now that it is in the product for almost 6-7 years i.e from the days of SQL Server 2005. Starting from the early builds of SQL Server 2012, there is an error when connecting to DAC in SQL Server DENALI. This bug exists in SQL Server 2012 RC0 build as well but somehow MSFT can&amp;#8217;t reproduce it and has been closed as won&amp;#8217;t fix. To some extent I agree that this bug is NOT a big deal in the large scheme of things and am writing this to bring some awareness to the issue in case you happen to stumble upon it when using DAC in a real world scenario.&lt;/p&gt;
&lt;p&gt;&lt;hr /&gt;&lt;br /&gt;
The bug is if you connect to a &amp;#8220;New Query&amp;#8221; window and try to use the same query window to change the connection to use DAC then it throws an error message that failed to connect to DAC. The end result is DAC connection succeeds and works fine but throws an error message which can be confusing. If you are using DAC to solve a real issue on a production box and at that time stumbling on this bug can be really frustrating and this can compound to stress you are already on. Knowing about this bug and the work around, may help to avoid getting into that situation. &lt;/p&gt;
&lt;p&gt;&lt;hr /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Steps to reproduce:&lt;/strong&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt; Go to File | New | Database Engine Query | and connect to server with a regular connection. &lt;/li&gt;
&lt;div id="attachment_1417" class="wp-caption aligncenter" style="width:651px;border:1px solid #dddddd;background-color:#f3f3f3;padding-top:4px;margin:10px;text-align:center;display:block;margin-right:auto;margin-left:auto;"&gt;&lt;a href="http://SankarReddy.com/wp-content/uploads/2012/01/Step-1-DAC-Error.jpg"&gt;&lt;img align="left" src="http://SankarReddy.com/wp-content/uploads/2012/01/Step-1-DAC-Error.jpg" alt="" title="Step 1 DAC Error" width="641" height="376" class="size-full wp-image-1417" /&gt;&lt;/a&gt;&lt;p style="padding:0 4px 5px;margin:0;" class="wp-caption-text"&gt;Step 1 for DAC error in SQL Server 2012 RC0&lt;/p&gt;&lt;/div&gt;
&lt;li&gt; Change Connection | use ADMIN: to connect to DAC&lt;br /&gt;
&lt;div id="attachment_1419" class="wp-caption aligncenter" style="width:528px;border:1px solid #dddddd;background-color:#f3f3f3;padding-top:4px;margin:10px;text-align:center;display:block;margin-right:auto;margin-left:auto;"&gt;&lt;a href="http://SankarReddy.com/wp-content/uploads/2012/01/Step-2-DAC-Error.jpg"&gt;&lt;img align="left" src="http://SankarReddy.com/wp-content/uploads/2012/01/Step-2-DAC-Error.jpg" alt="" title="Step 2 DAC Error" width="518" height="371" class="size-full wp-image-1419" /&gt;&lt;/a&gt;&lt;p style="padding:0 4px 5px;margin:0;" class="wp-caption-text"&gt;Step 2 DAC Error in SQL Server 2012 RC0&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;
&lt;li&gt; Shows error message below &lt;/li&gt;
&lt;div id="attachment_1414" class="wp-caption aligncenter" style="width:446px;border:1px solid #dddddd;background-color:#f3f3f3;padding-top:4px;margin:10px;text-align:center;display:block;margin-right:auto;margin-left:auto;"&gt;&lt;a href="http://SankarReddy.com/wp-content/uploads/2012/01/DAC_SQLServer2012_Error.jpg"&gt;&lt;img align="left" src="http://SankarReddy.com/wp-content/uploads/2012/01/DAC_SQLServer2012_Error.jpg" alt="Dedicated Admin Connection error in SQL Server 2012 RC0" title="DAC_SQLServer2012_Error" width="436" height="170" class="size-full wp-image-1414" /&gt;&lt;/a&gt;&lt;p style="padding:0 4px 5px;margin:0;" class="wp-caption-text"&gt;DAC error in SQL Server 2012 RC0&lt;/p&gt;&lt;/div&gt;
&lt;li&gt; Click ok and use DAC connection without any issues. How do I know that DAC connection succeeded? One can use the below query to find if DAC connection is being used or NOT. And also there is the information at the bottom of the screen as well. &lt;/li&gt;
&lt;div id="attachment_1426" class="wp-caption aligncenter" style="width:497px;border:1px solid #dddddd;background-color:#f3f3f3;padding-top:4px;margin:10px;text-align:center;display:block;margin-right:auto;margin-left:auto;"&gt;&lt;a href="http://SankarReddy.com/wp-content/uploads/2012/01/Step-4-DAC-Error.jpg"&gt;&lt;img align="left" src="http://SankarReddy.com/wp-content/uploads/2012/01/Step-4-DAC-Error.jpg" alt="" title="Step 4 DAC Error" width="487" height="53" class="size-full wp-image-1426" /&gt;&lt;/a&gt;&lt;p style="padding:0 4px 5px;margin:0;" class="wp-caption-text"&gt;Step 4 DAC Error in SQL Server 2012 RC0&lt;/p&gt;&lt;/div&gt;
&lt;pre class="brush :sql"&gt;
SELECT
	c.session_id
	, s.login_name
	, c.connect_time
	, c.last_read
	, c.last_write
	, s.host_name
	, c.client_net_address
FROM sys.dm_exec_connections c
    JOIN sys.endpoints e
        ON c.endpoint_id = e.endpoint_id
    JOIN sys.dm_exec_sessions s
        ON s.session_id = c.session_id
WHERE e.is_admin_endpoint = 1
&lt;/pre&gt;
&lt;div id="attachment_1428" class="wp-caption aligncenter" style="width:820px;border:1px solid #dddddd;background-color:#f3f3f3;padding-top:4px;margin:10px;text-align:center;display:block;margin-right:auto;margin-left:auto;"&gt;&lt;a href="http://SankarReddy.com/wp-content/uploads/2012/01/Proof-that-DAC-connection-succeeded.jpg"&gt;&lt;img align="left" src="http://SankarReddy.com/wp-content/uploads/2012/01/Proof-that-DAC-connection-succeeded.jpg" alt="" title="Proof that DAC connection succeeded" width="810" height="66" class="size-full wp-image-1428" /&gt;&lt;/a&gt;&lt;p style="padding:0 4px 5px;margin:0;" class="wp-caption-text"&gt;Proof that DAC connection succeeded&lt;/p&gt;&lt;/div&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;hr /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Workaround:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Until the bug is fixed, always use a new query window to connect to DAC directly. Don&amp;#8217;t use an existing query window for a DAC connection.&lt;/p&gt;
&lt;p&gt;&lt;hr /&gt;&lt;br /&gt;
If you can reproduce the issue, and if you think its important then vote and/or add comments for the bug below.&lt;/p&gt;
&lt;p&gt;&lt;a&gt;DAC Connection throws error&lt;/a&gt;&lt;/p&gt;
&lt;img align="left" src="http://feeds.feedburner.com/~r/SankarReddyBR/~4/R4DcQdgjfLY" height="1" width="1" alt="" /&gt;&lt;div class="InlineAdBox"&gt;&lt;b&gt;Republished with author&amp;#39;s permission. See the original post &lt;a href="http://feedproxy.google.com/~r/SankarReddyBR/~3/R4DcQdgjfLY/" target="_blank"&gt;here.&lt;/a&gt; &lt;/b&gt;&lt;/div&gt;</description></item><item><title>DIRTY_PAGE_POLL wait type in SQL Server 2012</title><link>http://beyondrelational.com/live/blogs/sankarreddy/archive/2012/01/15/dirty-page-poll-wait-type-in-sql-server-2012.aspx</link><pubDate>Sun, 15 Jan 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">6e5011fa-7db5-4df3-bb79-9085c1d333b3:15288</guid><dc:creator>SankarReddy13</dc:creator><description>&lt;p&gt;Looking at wait types in SQL Server is a great way to get some insight into how SQL Server is operating under the current load. Although wait types in SQL Server are around from the days of SQL Server 2000 (may be earlier), it has improved significantly from SQL Server 2005. New wait types are being added almost in every new SQL Server versions, providing us with great insight to how SQL Server is performing. This post is to understand the DIRTY_PAGE_POLL wait type in SQL Server 2012.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;DIRTY_PAGE_POLL is a new wait type added in SQL Server 2012. If you see high values for this wait type on your server, should you be concerned? What is this wait type referring to? Let&amp;#8217;s get into the details of what functionality of SQL Server does this refer to.&lt;/p&gt;
&lt;p&gt;Before SQL Server 2012, the recovery time of the database(s) after an unexpected shutdown or crash used to depend on the &amp;#8216;recovery interval&amp;#8217; sp_configure option which in turn was responsible for issuing &amp;#8220;automatic checkpoints&amp;#8221;. The timing of these automatic checkpoints used to vary a lot depending on the activity on the database and the algorithm had some issues as well to determine how frequently the checkpoint should be run to support the recovery time accurately. There is a myth that checkpoint will run every minute and that is NOT true and its a story for another post.&lt;/p&gt;
&lt;hr /&gt;
In SQL Server 2012, a new concept known as &amp;#8220;Indirect checkpoints&amp;#8221; is added which allows to control the recovery time much more accurately compared to previous versions. This is controlled at the database level unlike the old option in previous versions was at server level. The option is called &amp;#8220;TARGET_RECOVERY_TIME&amp;#8221; and is set using ALTER DATABASE command. For more details refer BOL at &lt;a href="http://msdn.microsoft.com/en-us/library/hh403416(v=sql.110).aspx" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/hh403416(v=sql.110).aspx&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When you use &amp;#8220;Indirect Checkpoint&amp;#8221;, the background thread constantly looks for dirty pages to be written to disk at a much more aggressive rate (compared to automatic checkpoints) i.e to support the recovery time interval that is set using the &amp;#8220;TARGET_RECOVERY_TIME&amp;#8221;. Even if you are NOT using the &amp;#8220;Indirect checkpoint&amp;#8221;, the background thread may be waiting to poll for dirty pages. So, it is possible to see high values for this wait type especially when you aren&amp;#8217;t using &amp;#8220;Indirect checkpoint&amp;#8221; feature. It is a benign wait type and shouldn&amp;#8217;t be any concern if you happen to see high values for this wait type on your systems.&lt;/p&gt;
&lt;p&gt;So the next question is should we change all databases to use &amp;#8220;Indirect checkpoint&amp;#8221; when upgraded to SQL Server 2012? While &amp;#8220;Indirect checkpoint&amp;#8221; has great promise, you should rely on extensive testing for your workload before using this feature as it changes the how much data is being written to the disk constantly.&lt;/p&gt;
&lt;hr /&gt;
Recommended Reading:&lt;br /&gt;
&lt;a href="http://www.sqlskills.com/blogs/joe/post/Adjusting-target-recovery-time-by-database-in-SQL-Server-2012.aspx"&gt;http://www.sqlskills.com/blogs/joe/post/Adjusting-target-recovery-time-by-database-in-SQL-Server-2012.aspx&lt;br /&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/ms189573(v=sql.110).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms189573(v=sql.110).aspx&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://sankarreddy.com/2011/03/does-checkpoint-write-uncommitted-data/"&gt;http://sankarreddy.com/2011/03/does-checkpoint-write-uncommitted-data/&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/category/Checkpoint.aspx"&gt;http://www.sqlskills.com/BLOGS/PAUL/category/Checkpoint.aspx&lt;/a&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/SankarReddyBR/~4/ZlpPuZqN4tQ" height="1" width="1" alt="" /&gt;&lt;div class="InlineAdBox"&gt;&lt;b&gt;Republished with author&amp;#39;s permission. See the original post &lt;a href="http://feedproxy.google.com/~r/SankarReddyBR/~3/ZlpPuZqN4tQ/" target="_blank"&gt;here.&lt;/a&gt; &lt;/b&gt;&lt;/div&gt;</description></item><item><title>SQL Server 2012 FileTable – Part 1</title><link>http://beyondrelational.com/live/blogs/geniiius/archive/2012/01/03/sql-server-2012-filetable-part-1.aspx</link><pubDate>Tue, 03 Jan 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">6e5011fa-7db5-4df3-bb79-9085c1d333b3:15142</guid><dc:creator>Geniiius</dc:creator><description>&lt;p&gt;In a series of blog posts we will have a look at the new SQL Server 2012 table type called FileTable. This first blog post will be a simple getting started – how to create a FileTable and how to dump files into the folder and do some simple file manipulation.&lt;/p&gt;
&lt;p&gt;A SQL Server FileTable is a special table where you can store directory and files – that’s not special I know, the special thing is that you can access these files and directories from windows applications as if they were stored in the file system.&lt;/p&gt;
&lt;p&gt;The data stored in the FileTable is exposed to windows through a windows share, and via this share it is possible to gain non-transactional access to the data.&lt;/p&gt;
&lt;p&gt;If you create or change a file through the windows share the command is intercepted by a SQL Server component and the changes are applied to the corresponding data in the FileTable.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ff929144(v=sql.110).aspx" target="_blank"&gt;Read more about FileTables in BOL&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let’s create a demo database with a FILESTREAM filegroup, I’ll be setting the NON_TRANSACTED_ACCESS to FULL this gives me full non-transactional access to the share, this option can be changed later if you want to do that. Here is the code:&lt;/p&gt;
&lt;pre class="brush:sql"&gt;CREATE DATABASE MyFileTableTest
ON  PRIMARY
(
    NAME = N&amp;#39;MyFileTableTest&amp;#39;,
    FILENAME = N&amp;#39;C:\FileTable\MyFileTableTest.mdf&amp;#39;
),
FILEGROUP FilestreamFG CONTAINS FILESTREAM
(
    NAME = MyFileStreamData,
    FILENAME= &amp;#39;C:\FileTable\Data&amp;#39;
)
LOG ON
(
    NAME = N&amp;#39;MyFileTableTest_Log&amp;#39;,
    FILENAME = N&amp;#39;C:\FileTable\MyFileTableTest_log.ldf&amp;#39;
)
WITH FILESTREAM
(
    NON_TRANSACTED_ACCESS = FULL,
    DIRECTORY_NAME = N&amp;#39;FileTable&amp;#39;
)

&lt;/pre&gt;

&lt;p&gt;That’s the database done, now let’s create the magic table – that is simple done with the “AS FileTable” keyword. When creating a FileTable there is only two options that you can change, everything else is out of the box. Let’s have a look at how I created the table:&lt;/p&gt;
&lt;pre class="brush:sql"&gt;USE MyFileTableTest
go

CREATE TABLE MyDocumentStore AS FileTable
WITH
(
    FileTable_Directory = &amp;#39;MyDocumentStore&amp;#39;,
    FileTable_Collate_Filename = database_default
);
GO

&lt;/pre&gt;

&lt;p&gt;If we take a look at the GUI after creating the table, we can see that the table is created under the new folder called FileTables&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.geniiius.com/wp-content/uploads/image34.png"&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://www.geniiius.com/wp-content/uploads/image_thumb34.png" width="334" height="136" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;that is not the only new thing, if we right click at the table that we just created we will see an option called “Explore FileTable Directory” – click that and a windows opens with the content of your FileTable. If you drop a file into this folder it will be accessible from SSMS, with a simple SELECT from the MyDocumentStore.&lt;/p&gt;
&lt;p&gt;Here is how the folder looks:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.geniiius.com/wp-content/uploads/image35.png"&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://www.geniiius.com/wp-content/uploads/image_thumb35.png" width="352" height="264" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And if you query the table you get the following: (This query only shows a few of the columns off the table)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.geniiius.com/wp-content/uploads/image36.png"&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://www.geniiius.com/wp-content/uploads/image_thumb36.png" width="392" height="127" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now you can do file manipulation with SSMS, something like renaming the files is just an update statement – easy peasy &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.geniiius.com/wp-content/uploads/wlEmoticon-smile5.png" /&gt;.&lt;/p&gt;
&lt;pre class="brush:sql"&gt;UPDATE MyDocumentStore
SET name = &amp;#39;Geniiius.txt&amp;#39;
WHERE stream_id = &amp;#39;05A9F338-CF32-E111-BB43-080027F9EB26&amp;#39;

&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://www.geniiius.com/wp-content/uploads/image37.png"&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://www.geniiius.com/wp-content/uploads/image_thumb37.png" width="367" height="276" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the end of the first blog post in this series – stay tuned new posts will be online very soon.&lt;/p&gt;
&lt;div class="InlineAdBox"&gt;&lt;b&gt;Republished with author&amp;#39;s permission. See the original post &lt;a href="http://www.geniiius.com/blog/sql-server-2012-filetable-part-1/" target="_blank"&gt;here.&lt;/a&gt; &lt;/b&gt;&lt;/div&gt;</description></item><item><title>CONCAT() – SQL Server 2012</title><link>http://beyondrelational.com/live/blogs/geniiius/archive/2011/11/29/concat-sql-server-2012.aspx</link><pubDate>Tue, 29 Nov 2011 06:00:00 GMT</pubDate><guid isPermaLink="false">6e5011fa-7db5-4df3-bb79-9085c1d333b3:14662</guid><dc:creator>Geniiius</dc:creator><description>&lt;p&gt;With SQL Server 2012 a new string function is born – CONCAT(). The output is a string, as the result of the concatenation of two or more strings – if the input is another type than string a conversion will be done implicit. The CONCAT() function takes between 2 and 254 parameters.&lt;/p&gt;
&lt;p&gt;Here is how the syntax looks:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;CONCAT ( string_value1, string_value2 [, string_valueN ] ) &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Read the full BOL documentation &lt;a href="http://msdn.microsoft.com/en-us/library/hh231515(v=sql.110).aspx" target="_blank"&gt;here&lt;/a&gt;. Let’s have a look at code use cases.&lt;/p&gt;
&lt;pre class="brush:sql"&gt;/* The Simple one */

SELECT CONCAT(&amp;#39;AGF&amp;#39;,&amp;#39;Vinder&amp;#39;,&amp;#39;Guld&amp;#39;,&amp;#39;I&amp;#39;,&amp;#39;2012&amp;#39;) as GeniiiusOutput

Output: AGFVinderGuldI2012

/* Handling non varchar datatypes */

DECLARE @text1 varchar(10) = &amp;#39;AGF&amp;#39;
DECLARE @text2 varchar(10) = &amp;#39;Vinder&amp;#39;
DECLARE @text3 varchar(10) = &amp;#39;Guld&amp;#39;
DECLARE @text4 varchar(10) = &amp;#39;I&amp;#39;
DECLARE @Num1 int = 2012

SELECT CONCAT(@text1, @text2, @text3, @text4, @Num1) as GeniiiusOutput

Output: AGFVinderGuldI2012

/* Handling null values */

DECLARE @text1 varchar(10) = &amp;#39;AGF&amp;#39;
DECLARE @text2 varchar(10) = &amp;#39;Vinder&amp;#39;
DECLARE @text3 varchar(10) = null
DECLARE @text4 varchar(10) = &amp;#39;I&amp;#39;
DECLARE @Num1 int = 2012

SELECT CONCAT(@text1, @text2, @text3, @text4, @Num1) as GeniiiusOutput

Output: AGFVinderI2012
&lt;/pre&gt;
&lt;p&gt;This is for sure a feature that I have been missing, and already now it has become my new best friend.&lt;/p&gt;
&lt;p&gt;@Geniiiuscom&lt;/p&gt;
</description></item></channel></rss>