<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>TSQLNet Weblog - Cihangir Biyikoglu</title><link>http://blogs.msdn.com/cbiyikoglu/default.aspx</link><description>&lt;img src="http://blogs.msdn.com/photos/tsqlnetblog/images/591030/thumb.aspx" /&gt;</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Upgrading to SQL Server 2005 - How DEFAULT_SCHEMA helped improve performance for a number of apps.</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2007/03/30/upgrading-to-sql-server-2005-how-default-schema-helped-improve-performance-for-a-number-of-apps.aspx</link><pubDate>Fri, 30 Mar 2007 17:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1994735</guid><dc:creator>cihangir</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/1994735.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=1994735</wfw:commentRss><description>&lt;P&gt;Here is my blog post at the ISV Team blog. DEFAULT_SCHEMA setting helped in a number of cases, especially with legacy code. It could help you if have upgraded from an earlier version of SQL Server and you are not parameterizing your trivial queries. &lt;A href="http://blogs.msdn.com/mssqlisv/archive/2007/03/23/upgrading-to-sql-server-2005-and-default-schema-setting.aspx" mce_href="http://blogs.msdn.com/mssqlisv/archive/2007/03/23/upgrading-to-sql-server-2005-and-default-schema-setting.aspx"&gt;http://blogs.msdn.com/mssqlisv/archive/2007/03/23/upgrading-to-sql-server-2005-and-default-schema-setting.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-Cihan&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1994735" width="1" height="1"&gt;</description></item><item><title>PASS 06: Hidden Gems in SQL Server 2005 - Slides available at the PASS website</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2006/12/04/pass-06-hidden-gems-in-sql-server-2005-slides-available-at-the-pass-website.aspx</link><pubDate>Mon, 04 Dec 2006 20:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1207476</guid><dc:creator>cihangir</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/1207476.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=1207476</wfw:commentRss><description>&lt;P&gt;Greetings, my pass talk is now available at sqlpass.org for download. The session was on some of the great hidden parts of sql server that served us well in real life imlpementations. There are quite a few I could have mentioned but I picked the top 10 that I think is the most impactful. Here is the list;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;10&lt;/STRONG&gt;&amp;nbsp;Tablediff.exe : Table1 == Table2?&lt;BR&gt;&lt;STRONG&gt;9&lt;/STRONG&gt;&amp;nbsp;Trigger for Logon events (SP2)&lt;BR&gt;&lt;STRONG&gt;8&lt;/STRONG&gt; Boosting performance with persisted-computed-columns &lt;BR&gt;&lt;STRONG&gt;7&lt;/STRONG&gt; Can you fix bad code automagically? DEFAULT_SCHEMA setting in sys.database_principals&lt;BR&gt;&lt;STRONG&gt;6 &lt;/STRONG&gt;Can you fix more bad code automagically? Forced Parameterization&lt;BR&gt;&lt;STRONG&gt;5 &lt;/STRONG&gt;Same data, less space? (SP2) VarDecimal storage format&lt;BR&gt;&lt;STRONG&gt;4 &lt;/STRONG&gt;Autoindex: What would you like to index today?: sys.dm_db_index_usage_stats &amp;amp; sys.dm_db_missing_index_*&lt;BR&gt;&lt;STRONG&gt;3 &lt;/STRONG&gt;“What is the hottest query?” answered in seconds: sys.dm_exec_query_stats&lt;BR&gt;&lt;STRONG&gt;2 &lt;/STRONG&gt;Scalable Shared Databases - Scaleout for eradonly reporting servers.&lt;BR&gt;&lt;STRONG&gt;1 &lt;/STRONG&gt;Softer side of Numa - Soft vs Hard Numa - the magic of '8'.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Enjoy&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1207476" width="1" height="1"&gt;</description></item><item><title>MARS, Transactions and SQL Error 3997, 3988 or 3983</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2006/11/21/mars-transactions-and-sql-error-3997-3988-or-3983.aspx</link><pubDate>Tue, 21 Nov 2006 00:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1111943</guid><dc:creator>cihangir</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/1111943.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=1111943</wfw:commentRss><description>&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Mars and Transactions&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;MARS (multiple active result-sets) does allow multiple commands to be active on the same connection, however there are some limitations on allowing multiple transactions to be active. I received a number of questions around this lately. I'll try to address the common denominator scenario in these questions and how to work around some of the error messages you may receive if MARS does not like what you are trying to do with your transactions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Scenario:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;The scenario in question involves implementing a flow that reads a result-set from SQL Server in a loop and goes back into the database to update some records. The app executes the update(s) in a transaction. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Here is the simplified ado.net code: Note that I am leaving out the cleanup and some of the initialization for compactness and table t1 is defined as "id int primary key, c2 xml not null".&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SqlConnection mycconnection1 = new SqlConnection(@"...;MultipleActiveResultSets=true");&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SqlCommand mycommand1 = new SqlCommand("select * from t1", mycconnection1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SqlCommand mycommand2 = new SqlCommand("update t1 set c2='&amp;lt;test&amp;gt;123&amp;lt;/test&amp;gt;' where id=@id", mycconnection1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mycommand2.Parameters.Add("@id", SqlDbType.Int, 4);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mycconnection1.Open();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SqlDataReader mydr = mycommand1.ExecuteReader();// SELECT * FROM T1&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;while (mydr.Read()) //WHILE READING RESULTS&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 63pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;(new SqlCommand("begin tran", mycconnection1)).ExecuteNonQuery(); //BEGIN TRAN&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 63pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;int id = mydr.GetInt32(0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 63pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mycommand2.Parameters["@id"].Value = id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 63pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mycommand2.ExecuteNonQuery(); //UPDATE T1 SET C2=... WHERE ID=@ID&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 63pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;(new SqlCommand("commit tran", mycconnection1)).ExecuteNonQuery(); //COMMIT TRAN&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 27pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;The code will error at runtime. The error message you get back will depend on the method you used to manage your transactions but it is likely going to be one of these;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 27pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SQL Error 3997 "A transaction that was started in a MARS batch is still active at the end of the batch. The transaction is rolled back."&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 27pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SQL Error 3988 "New transaction is not allowed because there are other threads running in the session."&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 27pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SQL Error 3983 "The operation failed because the session is not single threaded."&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;So… What now?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;When thinking about transactions it is critical to understand that almost all statements in SQL Server run in a transaction without you having to implicitly or explicitly start one. Most obvious example is :&amp;nbsp;'delete from t1' will delete all records or none. There is nothing in between when SQL Server executes this statement. In the case above however, starting a new transaction on connection that already has an active atomic command executing is not allowed. Depending on the situation and the behavior you want you may be able to do one of the following;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;STRONG&gt;#1&lt;/STRONG&gt; You can simply encapsulate all commands in a single transaction. Obviously in this case, you get one big transaction and that means you hold on to all your resources until the end of the entire transaction.&amp;nbsp; That could mean more blocking in your application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;SqlConnection mycconnection1 = new SqlConnection(@"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=tempdb;Data Source=patates\yukon;MultipleActiveResultSets=true");&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SqlCommand mycommand1 = new SqlCommand("select * from t1", mycconnection1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SqlCommand mycommand2 = new SqlCommand("update t1 set c2='&amp;lt;test&amp;gt;123&amp;lt;/test&amp;gt;' where id=@id", mycconnection1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mycommand2.Parameters.Add("@id", SqlDbType.Int, 4);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SqlTransaction mytransaction1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mycconnection1.Open();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mytransaction1 = mycconnection1.BeginTransaction();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mycommand1.Transaction = mytransaction1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mycommand2.Transaction = mytransaction1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;SqlDataReader mydr = mycommand1.ExecuteReader();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;while (mydr.Read())&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 27pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;int id = mydr.GetInt32(0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 27pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mycommand2.Parameters["@id"].Value = id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 27pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mycommand2.ExecuteNonQuery();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;STRONG&gt;#2&lt;/STRONG&gt; alternatively, you can submit the inner command you want transacted as a single batch or pack the commands in a stored procedure with the transaction statements with the transaction statements in the batch or the procedure. SQL Server can allow this special case and the batch or the stored procedure can work in its own transaction. So the code looks like this;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 27pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;//BATCH&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlConnection mycconnection1 = new SqlConnection(@"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=tempdb;Data Source=patates\yukon;MultipleActiveResultSets=true");&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlCommand mycommand1 = new SqlCommand("select * from t1", mycconnection1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlCommand mycommand2 = new SqlCommand("&lt;B&gt;begin tran&lt;/B&gt;;update t1 set c2='&amp;lt;test&amp;gt;123&amp;lt;/test&amp;gt;' where id=@id;&lt;B&gt;commit tran&lt;/B&gt;", mycconnection1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mycommand2.Parameters.Add("@id", SqlDbType.Int, 4);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mycconnection1.Open();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlDataReader mydr = mycommand1.ExecuteReader();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (mydr.Read())&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&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; int id = mydr.GetInt32(0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&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; mycommand2.Parameters["@id"].Value = id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&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; mycommand2.ExecuteNonQuery();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;This is stating the obvious but&amp;nbsp;the code above works because we have a well defined boundary for the transactions. &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;o:p&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;If you have comments on MARS and transactions and other data retrieval ‘flows’ that you are having difficulties with, please send those my way through the comments section below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;That's it for now. Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1111943" width="1" height="1"&gt;</description></item><item><title>Financial Services Developers Conference Presentation - Data Integration</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2006/04/26/584105.aspx</link><pubDate>Wed, 26 Apr 2006 13:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:584105</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/584105.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=584105</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;FSG Dev. Conf. 06 is over. Thanks to the folks who attended. Here is the presentation and the Demos as promised for the SQL &lt;A HREF="/cbiyikoglu/attachment/584105.ashx"&gt;Server Data Integration - Turning Data Into Intelligence&lt;/A&gt;. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;"OPENROWSET BULK" and "Fuzzy Lookup"&amp;nbsp;were the champions of the presentation. I'd certainly like to find out about your experience with both of these components.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Many Thanks&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=584105" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/cbiyikoglu/attachment/584105.ashx" length="1548855" type="application/x-zip-compressed" /></item><item><title>SQL ISV Advisory Team Blog</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2006/03/28/563410.aspx</link><pubDate>Tue, 28 Mar 2006 20:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:563410</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/563410.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=563410</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;ISV Advisory team is starting to blog as well. Good one to bookmark!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A HREF="/mssqlisv/Default.aspx"&gt;&lt;FONT face=Verdana size=2&gt;http://blogs.msdn.com/mssqlisv/Default.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=563410" width="1" height="1"&gt;</description></item><item><title>Forced and Simple Parameterization in SQL Server 2005</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2005/11/03/488920.aspx</link><pubDate>Fri, 04 Nov 2005 03:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:488920</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/488920.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=488920</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;As the optimizer gets more and more sophisticated, cost of optimization naturally increases. When that is the case; simple and forced parameterization comes to the rescue (much like you neighborhood plumber). These features simply allow the reuse of execution plans from similar queries thus minimizing the parse &amp;amp; compile time. The benefits vary from workload to workload but applications with simpler-but-chatty query workloads that spend relatively large percentage of the execution time in compilation (parse and compile time outputed from STATISTICS TIME output) will benefit greatly from these features in SQL Server 2005.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Many of you are probably familiar with auto or simple parameterization so I’ll jump to the new forced option right away. This is a new database level option in SQL Server 2005. It simply lets you parameterize a much wider range of queries. The following queries for example would not get parameterize in SQL Server 2000 or 2005 so they would by default be parsed and complied twice.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"select top 1 c1 from t1 where c2=0" &amp;amp; "select top 1 c1 from t1 where c2=1"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;However force parameterization can help turn this query into a parameterized form that gets reused on the second execution.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"(@0 int)select top 1 c1 from t1 where c2 = @0"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Forced Parameterization comes with a warning however: sometimes you want similar queries to recompile and use distinct execution plans. With forced parameterization queries may end up sharing plans inappropriately. I highly recommend you digest the information on the book online page and test before you decide to enable this in your environment. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;What I’d like to do for the rest of the text is to talk about what you will&amp;nbsp;oserve in SQL Server 2005 execution plan cache with parameterization options, as it may seem a little unusual once you start digging in. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;First, if you look into your good old &lt;FONT color=#0000ff&gt;syscacheobjects&lt;/FONT&gt; or the new &lt;FONT color=#0000ff&gt;sys.dm_exec_cached_plans &lt;/FONT&gt;views, you will still see the individual statements with the literals in the query text in your execution plan cache (both in simple and forced parameterization). However if you observe closely you will see that we do not have full blown execution plans for these objects with literals (sys.dm_exec_query_plan) and naturally we do not keep query statistics (dm_exec_query_stats) because they never really get executed. Their purpose in life is mainly to serve as pointers back to the actual parameterized plan. In fact the &lt;FONT color=#0000ff&gt;sys.dm_exec_cached_plans.refcounts&lt;/FONT&gt; of the parameterized plan reflects the count of these empty objects in the cache. The presence of these objects does not mean simple or forced parameterization is not doing its job. As long as the parameterized version is in the cache, you are in good shape. You could use something like the following query to see the query text and the plans of the cached queries:&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" face=Verdana color=#0000ff size=2&gt;select c.text,a.refcounts,a.usecounts,d.query_plan from sys.dm_exec_cached_plans a&amp;nbsp;outer apply sys.dm_exec_plan_attributes(a.plan_handle) b outer apply sys.dm_exec_sql_text(cast(b.value as varbinary)) c outer apply sys.dm_exec_query_plan(a.plan_handle) d where b.attribute='sql_handle' and a.cacheobjtype = 'Compiled Plan' order by a.usecounts desc&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I also have seen a few people trip over this: when looking at compilations, performance monitor (perfmon) counters can be deceptive. You may see a none-zero SQL Compilations/Sec value even after enabling forced parameterization. Don’t panic… We still report compilation with simple/forced-parameterized queries. If SQL Server 2005 is not reporting Failed or Unsafe Auto-Params/Sec, then we are doing all we can to reuse execution plans. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Happy Testing…&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Cihangir Biyikoglu&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=488920" width="1" height="1"&gt;</description></item><item><title>SQL Server 2005 is out the door</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2005/10/30/487033.aspx</link><pubDate>Sun, 30 Oct 2005 19:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:487033</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/487033.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=487033</wfw:commentRss><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: verdana; mso-outline-level: 1"&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: verdana; mso-outline-level: 1"&gt;Well, many lines of code and 5 years later, SQL Server 2005 is out the door. I have been in the lab benchmarking with close partners lately and I am certainly impressed with the results. With all the added sophistication and new features, we are still providing many perf benefits to apps upgrading from SQL 2000. I thought I point out one cool presentation to people who are doing the same type of work these days:&amp;nbsp;This presentation highlights all the tranparant features that you get for free when you upgrade to 2005.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: verdana; mso-outline-level: 1"&gt;&lt;A href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032275601"&gt;&lt;SPAN style="COLOR: blue"&gt;http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032275601&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032275601&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;amp;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032275601&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;&lt;SPAN style="COLOR: blue"&gt;EventCategory=5&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032275601&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;amp;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032275601&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;&lt;SPAN style="COLOR: blue"&gt;culture=en-US&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032275601&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;amp;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032275601&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;&lt;SPAN style="COLOR: blue"&gt;CountryCode=US&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=487033" width="1" height="1"&gt;</description></item><item><title>Phenomenal Result from Dell/Intel and x64 SQL Server 2005</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2005/09/27/474606.aspx</link><pubDate>Tue, 27 Sep 2005 21:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:474606</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/474606.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=474606</wfw:commentRss><description>&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" face=Verdana size=2&gt;&lt;FONT color=#000000&gt;I have not had too much time to blog lately but here is a great result from SQL Server 2005 x64 on Dell Poweredge 2800 with Dual-Code Intel Xeon. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: blue; FONT-FAMILY: verdana; mso-outline-level: 1"&gt;&lt;A href="http://www.tpc.org/tpcc/results/tpcc_result_detail.asp?id=105092601"&gt;&lt;FONT color=#000000&gt;&lt;A href="http://www.tpc.org/tpcc/results/tpcc_result_detail.asp?id=105092601"&gt;http://www.tpc.org/tpcc/results/tpcc_result_detail.asp?id=105092601&lt;/FONT&gt;&lt;/A&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: blue; FONT-FAMILY: verdana; mso-outline-level: 1"&gt;&lt;FONT color=#000000&gt;The $0.99 Price/Performance number is a great results that proves how far we came on pushing the cost of technology down.&amp;nbsp;For a little over $38K, being able to drive close to 31K users on the standard edition of SQL Server 2005 and Windows 2003 is just phenomenal. I think dual-core should take off (if it has not already) from here.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: blue; FONT-FAMILY: verdana; mso-outline-level: 1"&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: blue; FONT-FAMILY: verdana; mso-outline-level: 1"&gt;&lt;FONT color=#000000&gt;Enjoy.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: blue; FONT-FAMILY: verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; COLOR: blue; FONT-FAMILY: verdana; mso-outline-level: 1"&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=474606" width="1" height="1"&gt;</description></item><item><title>SQL Server in the Financial Services Industry Webcast</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2005/06/30/434436.aspx</link><pubDate>Thu, 30 Jun 2005 23:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:434436</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/434436.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=434436</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I shared some of our experiences with financial services industry implementations in a 90 min webcast. I touched on 5 distinct scenarios where SQL Server 2005 may help financial services partners and customers. &lt;BR&gt;&amp;nbsp; - Cost: full lifecycle of a solution - Development, deployment and maintenance&lt;BR&gt;&amp;nbsp; - Regulations and Compliance issues - How does SQL Server 2005 help you comply with Sarbanes-Oxley, AMI, BASEL II etc.&lt;BR&gt;&amp;nbsp; - Data and Information integration - Access to many data formats and data system from within SQL Server.&lt;BR&gt;&amp;nbsp; - Business Continuity and Reliability - Low cost High Availability&lt;BR&gt;&amp;nbsp; - Scalability and Performance&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The recorded version of the live webcast is available here:&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032275631&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;&lt;FONT face=Verdana size=2&gt;http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032275631&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;Cihangir Biyikoglu - SQL Server Program Manager&lt;BR&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=434436" width="1" height="1"&gt;</description></item><item><title>Great Samples on Service Broker</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2005/05/24/421569.aspx</link><pubDate>Wed, 25 May 2005 00:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:421569</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/421569.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=421569</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;I recently came across a few good samples:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;Async Task Management: &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/technet/technetmag/issues/2005/05/ServiceBroker/default.aspx"&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;http://www.microsoft.com/technet/technetmag/issues/2005/05/ServiceBroker/default.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Very Basic Trading System: &lt;/FONT&gt;&lt;a href="https://blogs.msdn.com:443/rushidesai/archive/2005/05/19/420212.aspx"&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;http://blogs.msdn.com/rushidesai/archive/2005/05/19/420212.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;Enjoy!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=421569" width="1" height="1"&gt;</description></item><item><title>Algorithmic Trading</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2005/05/11/416709.aspx</link><pubDate>Thu, 12 May 2005 01:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:416709</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/416709.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=416709</wfw:commentRss><description>&lt;P&gt;&lt;SPAN&gt;I recently started reading about Algorithmic Trading. There is a huge potential here for computer science. According to this presentation by &lt;B&gt;Carl Carrie - &lt;/B&gt;JPMorgan &amp;amp; &lt;B&gt;Scott Atwell&lt;/B&gt; - Manager of FIX Trading and Connectivity: &lt;SPAN&gt;&lt;A href="http://www.jandj.com/presentations/wednesday/AlgoTradingFIX.pdf"&gt;(http://www.jandj.com/presentations/wednesday/AlgoTradingFIX.pdf&lt;/A&gt;)&lt;/SPAN&gt;, algorithmic trading will make up %21 of the buy-side trading. That is huge. Certain futurists even believe traders will be&amp;nbsp;endangered species&amp;nbsp;within our lifetime. I am a little skeptic on that one but I have been proven wrong once or twice before :).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There certainly is a great need for high performance computing, large-volume and real-time data processing in the financial vertical and SQL is ready for that type of game with CLR integration. I have seen very creative uses of SQL and SQLCLR already but if you are tackling these types of tough problems, contact me... I am certainly interesting in hearing about it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;By the way; all Financial Services DevCon material is available at &amp;nbsp;&lt;/FONT&gt;&lt;A href="http://www.financialdevelopers.com/fsdevcon05.aspx"&gt;&lt;FONT face=Verdana size=2&gt;http://www.financialdevelopers.com/fsdevcon05.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=416709" width="1" height="1"&gt;</description></item><item><title>Slides and Demos from Financial Services Developer Conference in NY</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2005/04/25/411869.aspx</link><pubDate>Mon, 25 Apr 2005 19:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:411869</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/411869.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=411869</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;I promised to make the presentation and demos available here and here they are:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;SPAN&gt;&lt;FONT color=#000000 size=2&gt;Presentation: &lt;/FONT&gt;&lt;/SPAN&gt;&lt;A href="http://www.tsqlnet.com/downloads/fsgdevcon/fsgdevcon_presentation.zip"&gt;&lt;SPAN&gt;&lt;A href="http://www.tsqlnet.com/downloads/fsgdevcon/fsgdevcon_presentation.zip"&gt;&lt;FONT color=#0000ff size=2&gt;http://www.tsqlnet.com/downloads/fsgdevcon/fsgdevcon_presentation.zip&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;Data Integration Demo: &lt;/FONT&gt;&lt;A href="http://www.tsqlnet.com/downloads/fsgdevcon/fsgdevcon_demo.zip"&gt;&lt;SPAN&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;http://www.tsqlnet.com/downloads/fsgdevcon/fsgdevcon_demo.zip&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I have only demo #1 shared here. Demo is on data integration and was run on SQL Server 2005 April CTP. I demonstrate a few uses of OPENROWSET BULK and relational, custom, semi or unstructured files using format files, UDTs, TVFs,&amp;nbsp;XML data types and&amp;nbsp;SINGLE_BLOB options. Very similar to the example in my earlier blog entry: &lt;a href="http://blogs.msdn.com/cbiyikoglu/archive/2005/03/17/398321.aspx"&gt;http://blogs.msdn.com/cbiyikoglu/archive/2005/03/17/398321.aspx&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;Demo #2 was on the great profiler and perfmon integration we achieved: if you'd like to see it for yourself, just record perfmon and profiler together against sql server while you have some decent load.&amp;nbsp;Then open the profiler data you save and use "file&amp;gt;import performance data" to bring in correlated perfmon data. Just play with selecting a range from perfmon or clicking commands in profiler etc. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;Let me know if you have trouble getting the data integration demo to work or if you have any questions. As I said I am very interested in hearing about the testing you guys are doing on SQL Server 2005 and would love to hear about any backward compatibility issues and any numbers comparing your SQL Server 2000 and 2005 numbers on the same HW.&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=411869" width="1" height="1"&gt;</description></item><item><title>FSG Developer Conference in New York</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2005/04/10/406961.aspx</link><pubDate>Sun, 10 Apr 2005 22:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:406961</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/406961.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=406961</wfw:commentRss><description>&lt;P&gt;&lt;SPAN&gt;Next week, I am heading out to the financial services developer conference to deliver a SQL Server 2005 presentation. The toughest part of delivering a talk on SQL Server 2005 is to find a way to fit it all into a&amp;nbsp;90 minute slot. You can talk about individual features for 24 hours nonstop but I am planning on taking a different approach this time around: instead of talking about individual features, I'll cover the scenarios we enabled in SQL Server 2005…&amp;nbsp;Feature bags that can help solve a&amp;nbsp;number of&amp;nbsp;classic problems that resonate with the financial developer. Here is a quick peak at the list:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;SQL Server Central Data Store: Enhanced bridging capabilities for bringing heterogeneous systems and data together.&lt;/SPAN&gt; 
&lt;LI&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Extensibility &amp;amp; Rich Development Platform: Great developer productivity features and language synergy: SQLCLR, XML and TSQL.&lt;/SPAN&gt; 
&lt;LI&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Privacy, Auditing and Security: Hardened and reduced product surface and new encryption capabilities.&lt;/SPAN&gt; 
&lt;LI&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Improved Scalability &amp;amp; Performance: Scale from pocket devices to high end servers. I'll also talk about query processing enhancements that can help your app when you upgrade your backend to SQL Server 2005.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;This talk is talking place on the 21st of April at 12:30 in the breakout room at the Grand Hyatt. I'll see you there.&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=406961" width="1" height="1"&gt;</description></item><item><title>Some good blogs I read today.</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2005/03/23/401284.aspx</link><pubDate>Wed, 23 Mar 2005 21:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:401284</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/401284.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=401284</wfw:commentRss><description>&lt;p&gt;&lt;font face="Verdana" size="2"&gt;I don't like pointing to other blogs too much but I want to make sure noone misses these:&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;A href="http://blogs.msdn.com/slavao/archive/2005/03/18/398651.aspx"&gt;&lt;font face="Verdana" size="2"&gt;SQLOS Caching&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;by Slava&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;a href="http://download.microsoft.com/download/c/f/8/cf8444d2-66cc-41cf-9ae0-f888b5a1b2d9/ed_triou_sql_server.wmv"&gt;SQL Testing&lt;/a&gt; from Ed Triou and Andre Milbradt &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;Enjoy!&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=401284" width="1" height="1"&gt;</description></item><item><title>Data Integration - Part II - UDTs and OPENROWSET to parse custom file formats</title><link>http://blogs.msdn.com/cbiyikoglu/archive/2005/03/17/398321.aspx</link><pubDate>Thu, 17 Mar 2005 23:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:398321</guid><dc:creator>cbiyikoglu</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cbiyikoglu/comments/398321.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cbiyikoglu/commentrss.aspx?PostID=398321</wfw:commentRss><description>&lt;SPAN&gt;&lt;o:p&gt;
&lt;P&gt;&lt;SPAN&gt;SQLCLR is the Swiss Army knife with&amp;nbsp;1000s of foldable parts. You cannot beat the ability to plug right in and reuse good set of framework functions from the DBMS. If your DBA is one of those that say; “no way. I am not letting C# into my database”, this is what I’d tell him… I am sure one day someone insane enough will to try to write the entire framework using sql but until then we need SQLCLR. =)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Enough said: Here is a quick example of how to use UDTs as a way to parse custom file formats. I am not sure if this is the killer UDT demo but it certainly is a good example of SQL Server 2005 as a data integration platform. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let’s say you have a folder full of files that have the following custom format and want to bring this data into your database. You have the ticker, the date and how many transactions are included in the file are all divided by ";". Right next to that part, you have and array of volume+price data delimited by “|”. This format and the data are totally arbitrary but you get the idea.&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;File1.txt - MSFT;10/10/04;3;10|5.001;20|6.05;30|7.33 &lt;BR&gt;File2.txt -&amp;nbsp;ORCL;10/11/04;5;1|1.01;20|5.05;300|4.04;4000|3.03;50000|2.02 &lt;BR&gt;File3.txt - IBM;10/10/04;2;100|0.5;10|0.025&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You create a user defined type - UDT that can parse this out.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;SPAN&gt;CustomTradeDataStruct: &lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN&gt;This is the main struct for the whole file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;SPAN&gt;TradeArrayStruct: &lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN&gt;This is the struct that represents the variable length array for volume and price data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;[&lt;B&gt;&lt;SPAN&gt;Serializable&lt;/SPAN&gt;&lt;/B&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;public&lt;/SPAN&gt;&lt;SPAN&gt; &lt;SPAN&gt;struct&lt;/SPAN&gt; &lt;B&gt;&lt;SPAN&gt;TradeArrayStruct&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;int&lt;/SPAN&gt; volume;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;decimal&lt;/SPAN&gt; price;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; TradeArrayStruct(&lt;SPAN&gt;string&lt;/SPAN&gt; s){…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;override&lt;/SPAN&gt; &lt;SPAN&gt;string&lt;/SPAN&gt; ToString(){…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;void&lt;/SPAN&gt;&lt;SPAN&gt; &lt;B&gt;&lt;SPAN&gt;IBinarySerialize&lt;/SPAN&gt;&lt;/B&gt;.Read(System.IO.&lt;B&gt;&lt;SPAN&gt;BinaryReader&lt;/SPAN&gt;&lt;/B&gt; r){…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;void&lt;/SPAN&gt; &lt;B&gt;&lt;SPAN&gt;IBinarySerialize&lt;/SPAN&gt;&lt;/B&gt;.Write(System.IO.&lt;B&gt;&lt;SPAN&gt;BinaryWriter&lt;/SPAN&gt;&lt;/B&gt; w){…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;[&lt;B&gt;&lt;SPAN&gt;Serializable&lt;/SPAN&gt;&lt;/B&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;[&lt;B&gt;&lt;SPAN&gt;SqlUserDefinedType&lt;/SPAN&gt;&lt;/B&gt;(&lt;B&gt;&lt;SPAN&gt;Format&lt;/SPAN&gt;&lt;/B&gt;.UserDefined, MaxByteSize = 8000)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;public&lt;/SPAN&gt;&lt;SPAN&gt; &lt;SPAN&gt;struct&lt;/SPAN&gt; &lt;B&gt;&lt;SPAN&gt;CustomTradeDataStruct&lt;/SPAN&gt;&lt;/B&gt; : &lt;B&gt;&lt;SPAN&gt;INullable&lt;/SPAN&gt;&lt;/B&gt;, &lt;B&gt;&lt;SPAN&gt;IBinarySerialize&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;string&lt;/SPAN&gt; ticker;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;string&lt;/SPAN&gt; startdate;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;int&lt;/SPAN&gt; daterange;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN&gt;TradeArrayStruct&lt;/SPAN&gt;&lt;/B&gt;[] trades;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;CustomTradeDataStruct&lt;/SPAN&gt;(&lt;SPAN&gt;string&lt;/SPAN&gt; s){…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;override&lt;/SPAN&gt; &lt;SPAN&gt;string&lt;/SPAN&gt; ToString(){…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;bool&lt;/SPAN&gt; IsNull {…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;…&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;static&lt;/SPAN&gt; &lt;B&gt;&lt;SPAN&gt;CustomTradeDataStruct&lt;/SPAN&gt;&lt;/B&gt; Null {…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;static&lt;/SPAN&gt; &lt;B&gt;&lt;SPAN&gt;CustomTradeDataStruct&lt;/SPAN&gt;&lt;/B&gt; Parse(&lt;B&gt;&lt;SPAN&gt;SqlString&lt;/SPAN&gt;&lt;/B&gt; s) {…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;void&lt;/SPAN&gt; &lt;B&gt;&lt;SPAN&gt;IBinarySerialize&lt;/SPAN&gt;&lt;/B&gt;.Read(System.IO.&lt;B&gt;&lt;SPAN&gt;BinaryReader&lt;/SPAN&gt;&lt;/B&gt; r){…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;void&lt;/SPAN&gt; &lt;B&gt;&lt;SPAN&gt;IBinarySerialize&lt;/SPAN&gt;&lt;/B&gt;.Write(System.IO.&lt;B&gt;&lt;SPAN&gt;BinaryWriter&lt;/SPAN&gt;&lt;/B&gt; w){…}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ok here is the stuff we have been building up to:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; &lt;SPAN&gt;cast&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;t1&lt;SPAN&gt;.&lt;/SPAN&gt;c1 &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;CustomTradeDataStruct&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;ToString&lt;SPAN&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FROM&lt;/SPAN&gt;&lt;SPAN&gt; &lt;SPAN&gt;OPENROWSET&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;BULK&lt;/SPAN&gt; &lt;SPAN&gt;'C:\File1.txt'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; SINGLE_NCLOB&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;AS&lt;/SPAN&gt; t1&lt;SPAN&gt;(&lt;/SPAN&gt;c1&lt;SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now you have the data in SQL Server, parsed through a UDT. There is a great set of things you can do to improve the access to this data like creating a bunch of properties to allow access to individual fields in the file or creating a table valued function to manipulate the volume+price array like a table etc.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cool or not so cool? Let me know what you guys think.&lt;/SPAN&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=398321" width="1" height="1"&gt;</description></item></channel></rss>