<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3076504683384247039</id><updated>2012-02-16T20:32:05.933-08:00</updated><title type='text'>Joseph Gozlan, Information Systems Engineer</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-3443114371035180156</id><published>2012-01-12T14:20:00.000-08:00</published><updated>2012-01-12T14:20:34.962-08:00</updated><title type='text'>Elegant solution for splitting a Comma Delimited string in SQL</title><content type='html'>came across this elegant simple solution for splitting a Comma Delimited string in SQL. &lt;br /&gt;This will only work with SQL 2005 and up but it's so simple and elegant i had to share it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="font-family: Verdana;"&gt;There can be different types of Delimiters also : like Comma ' , ', vertical bar ' | ', Single space or a Tab.&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="font-family: Verdana;"&gt;For example here is our Sample Table -&lt;/span&gt;&lt;/div&gt;&lt;table bgcolor="#ffffff" border="1" bordercolor="#000000" bordercolordark="#808080" bordercolorlight="#808080" height="100" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 172px; word-spacing: 0px;"&gt;&lt;tbody&gt;&lt;tr bgcolor="#c6c3b5"&gt;             &lt;td align="center" width="51"&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;&lt;strong&gt;Id&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="119"&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;&lt;strong&gt;AllNames&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="51"&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;1&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="119"&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;A,B,C&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="51"&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;2&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="119"&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;A,B&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="51"&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;3&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="120"&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;X,Y,Z&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="font-family: Verdana;"&gt;And here is the expected output -&lt;/span&gt;&lt;/div&gt;&lt;table bg="bg" border="1" bordercolordark="#808080" bordercolorlight="#808080" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: white; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 141px; word-spacing: 0px;"&gt;&lt;tbody&gt;&lt;tr bgcolor="#c6c3b5"&gt;             &lt;td align="center" width="52"&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;Id&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;             &lt;td align="center" width="87"&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;Names&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="52"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="87"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;A&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="52"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="87"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;B&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="52"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="87"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;C&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="52"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="87"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;A&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="52"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="87"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;B&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="52"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="87"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;X&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="52"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="87"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;Y&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td align="center" width="52"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;             &lt;td align="center" width="87"&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="color: black;"&gt;Z&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;strong&gt;&lt;span style="font-family: Verdana;"&gt;Create Sample Data :&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;table bgcolor="#f4f4f4" border="0" cellpadding="0" cellspacing="0" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 600px; word-spacing: 0px;"&gt;&lt;tbody&gt;&lt;tr&gt;             &lt;td valign="top" width="598"&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="color: #008040;"&gt;-- Create Table for&amp;nbsp; Sample Data&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;CREATE TABLE&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;Test&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ID&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;INT&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;AllNames&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;VARCHAR&lt;/span&gt;(100)&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;)&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;GO&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008040;"&gt;-- Load Sample Data&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;INSERT INTO&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;test&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;SELECT&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1, 'A,B,C'&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;UNION &lt;br /&gt;ALL SELECT&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2, 'A,B'&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;UNION &lt;br /&gt;ALL SELECT&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3, 'X,Y,Z'&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="color: #008040;"&gt;-- Verify the Sample Data&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;SELECT&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;Id, &lt;br /&gt;AllNames&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;FROM&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;Test&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;strong&gt;And here is the query for How to split a comma &lt;br /&gt;delimited string :&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;table bgcolor="#f4f4f4" border="0" bordercolor="#000000" bordercolordark="#808080" bordercolorlight="#808080" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 596px; word-spacing: 0px;"&gt;&lt;tbody&gt;&lt;tr&gt;             &lt;td width="594"&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;;&lt;span style="color: blue;"&gt;WITH&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;Cte&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;(&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;SELECT&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: magenta;"&gt;CAST&lt;/span&gt;('&amp;lt;M&amp;gt;' &lt;br /&gt;+&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: magenta;"&gt;REPLACE&lt;/span&gt;( &lt;br /&gt;Allnames,&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;','&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;'&amp;lt;/M&amp;gt;&amp;lt;M&amp;gt;'&lt;/span&gt;) +&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;'&amp;lt;/M&amp;gt;'&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;AS XML&lt;/span&gt;)&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;Names&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;FROM&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;Test&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;)&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;SELECT&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Split.a.&lt;span style="color: blue;"&gt;value&lt;/span&gt;(&lt;span style="color: red;"&gt;'.'&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;'VARCHAR(100)'&lt;/span&gt;)&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;Names&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;FROM&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;Cte&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;CROSS APPLY Names.nodes(&lt;span style="color: red;"&gt;'/M'&lt;/span&gt;) Split(a)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana;"&gt;---------------------------------------------------------&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="font-family: Verdana;"&gt;Acknowledgement : &lt;a href="http://mangalpardeshi.blogspot.com/2009/03/how-to-split-comma-delimited-string.html"&gt;SQL WITH MANGAL&lt;/a&gt;  &lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-3443114371035180156?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/3443114371035180156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2012/01/elegant-solution-for-splitting-comma.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/3443114371035180156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/3443114371035180156'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2012/01/elegant-solution-for-splitting-comma.html' title='Elegant solution for splitting a Comma Delimited string in SQL'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-8315899992243846812</id><published>2011-10-02T08:17:00.000-07:00</published><updated>2011-10-02T08:17:05.238-07:00</updated><title type='text'>Debugging VBS with Visual Studio</title><content type='html'>If you must use VBS scripts (I can't think of a reason why you would WANT to use them) then there is an easier way to debug these (other than the old school printouts).&lt;br /&gt;&lt;br /&gt;from the command prompt run: &lt;br /&gt;&lt;br /&gt;cscript.exe test.vbs //X&lt;br /&gt;&lt;br /&gt;this will pop up the debugger choice with the list of Visual Studio apps available (2003/05/08/10 etc.) and will allow you to step in and debug line by line.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-8315899992243846812?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/8315899992243846812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2011/10/debugging-vbs-with-visual-studio.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/8315899992243846812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/8315899992243846812'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2011/10/debugging-vbs-with-visual-studio.html' title='Debugging VBS with Visual Studio'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-489052985529489390</id><published>2011-10-02T08:10:00.000-07:00</published><updated>2011-10-02T08:10:20.040-07:00</updated><title type='text'>Apppools on Windows Server 2008</title><content type='html'>If you need to set a flag on the apppool in server 2008 you can also do that via script. Here is an example of how to set the "Enable 32bit application support" flag to "true" in server 2008 apppool:&lt;br /&gt;&lt;br /&gt;cd %windir%\system32\inetsrv\ &lt;br /&gt;appcmd set apppool /apppool.name:CPOSBackOfficeWS /enable32BitAppOnWin64:true&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-489052985529489390?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/489052985529489390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2011/10/apppools-on-windows-server-2008.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/489052985529489390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/489052985529489390'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2011/10/apppools-on-windows-server-2008.html' title='Apppools on Windows Server 2008'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-1617756773910285601</id><published>2010-11-12T09:02:00.000-08:00</published><updated>2010-11-12T09:02:04.147-08:00</updated><title type='text'>Task failed because “sgen.exe” was not found, or the correct Microsoft Windows SDK is not installed.</title><content type='html'>If you started using Visual Studio 2008 and didn't have a previous version of it then you will get this error trying to compile project that reference a web service. It only happens if you use .NET 2.0 version and compile in Release mode.&lt;br /&gt;&lt;br /&gt;it's actually looking for a 2.0 component from the 2.0 SDK that is not being installed with your VS2008.&lt;br /&gt;&lt;br /&gt;The solution:&lt;br /&gt;Download and install .NET 2.0 SDK (from the Microsoft website) then copy the sgen.exe file from C:\Program Files\Microsoft.NET\SDK\v2.0 to C:\Windows\Microsoft.NET\Framework\v3.5&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-1617756773910285601?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/1617756773910285601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/11/task-failed-because-sgenexe-was-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/1617756773910285601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/1617756773910285601'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/11/task-failed-because-sgenexe-was-not.html' title='Task failed because “sgen.exe” was not found, or the correct Microsoft Windows SDK is not installed.'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-3136439674278452540</id><published>2010-11-11T10:58:00.000-08:00</published><updated>2010-11-11T10:59:02.956-08:00</updated><title type='text'>Call stack window missing from VS2008?</title><content type='html'>I get asked that a lot recently so I thought I'll share it with the world. No Microsoft didn't remove the Call Stack window from Visual Studio 2008. they just moved it to another menu entry.&lt;br /&gt;&lt;br /&gt;You can find it under Debug-&gt;Windows-&gt;Call Stuck&lt;br /&gt;&lt;br /&gt;Keep coding...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-3136439674278452540?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/3136439674278452540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/11/call-stack-winndow-missing-from-vs2008.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/3136439674278452540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/3136439674278452540'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/11/call-stack-winndow-missing-from-vs2008.html' title='Call stack window missing from VS2008?'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-7821454111211839108</id><published>2010-09-13T08:43:00.000-07:00</published><updated>2010-09-13T08:43:48.596-07:00</updated><title type='text'>Migrating databases from SQL 7/2000 to 2005/2008 version</title><content type='html'>When you migrate a database from a SQL server 7 or 2000 to a SQL server 2005 &amp;amp; Up it's important to check that the database's Auto_Close flag is set to "FALSE" OR "OFF" (binary 0).&lt;br /&gt;&lt;br /&gt;In order to find out which databases have it set to "TRUE" or "ON" (Binary 1) run this script:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;SET NOCOUNT ON&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT [name] AS DatabaseName&lt;br /&gt;, CONVERT(varchar(100),DATABASEPROPERTYEX([Name] , 'Recovery')) AS RecoveryType&lt;br /&gt;, CONVERT(varchar(10),DATABASEPROPERTYEX([Name] , 'IsAutoClose')) AS AutoClose&lt;br /&gt;, CONVERT(varchar(10),DATABASEPROPERTYEX([Name] , 'IsAutoShrink')) AS AutoShrink&lt;br /&gt;FROM master.dbo.sysdatabases&lt;br /&gt;Order By DatabaseName &lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;Then in order to set a flag to "FALSE" / "OFF" run the following script:&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span style="color: green;"&gt;ALTER DATABASE [DB_NAME_HERE] SET AUTO_CLOSE OFF WITH NO_WAIT&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Here is Microsoft Best practice recommendation:&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/library/bb402929.aspx"&gt;http://technet.microsoft.com/en-us/library/bb402929.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-7821454111211839108?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/7821454111211839108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/09/migrating-databases-from-sql-72000-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/7821454111211839108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/7821454111211839108'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/09/migrating-databases-from-sql-72000-to.html' title='Migrating databases from SQL 7/2000 to 2005/2008 version'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-8561203358565814224</id><published>2010-06-15T15:01:00.000-07:00</published><updated>2010-06-15T15:01:27.780-07:00</updated><title type='text'>Code Snippets in Visual Studio 2008/2010</title><content type='html'>Another cool feature of Microsoft Visual Studio 2008/2010. Code snippets are pieces of codes that are pre-set in snippets files and has a shortcut associated with it. This feature can save you a lot of time coding. &lt;br /&gt;we all build our "for" statements and "if" statements and all kind of code parts that we code repeatedly almost everyday. &lt;br /&gt;VS comes with many snippets preloaded but you can add your own if you have a specific code snippets specific to you that you want to add to the library.&lt;br /&gt;&lt;br /&gt;Here is how it looks when you start typing the shortcuts. The code snippets has their own icon (Click the Image to enlarge)::&lt;br /&gt;&lt;br/&gt;&lt;img src="http://www.JosephGozlan.com/Blog/snippet1.PNG"&gt; &lt;br/&gt; &lt;br/&gt;&lt;br /&gt;Once you choose your snippet than click the "tab" button twice and the code will populate:&lt;br /&gt;&lt;br/&gt;&lt;img src="http://www.JosephGozlan.com/Blog/snippet2.PNG"&gt; &lt;br/&gt; &lt;br/&gt;&lt;br /&gt;&lt;br /&gt;In order to see all the available snippets or add your own go to "tools" -&gt; "Code Snippets Manager"&lt;br /&gt;&lt;br/&gt;&lt;a href="http://www.JosephGozlan.com/Blog/snippet3.PNG" target="_blank"&gt;&lt;img alt="Click the Image to enlarge" src="http://www.JosephGozlan.com/Blog/snippet3.PNG" width="450"&gt;&lt;/a&gt; &lt;br/&gt; &lt;br/&gt;&lt;br /&gt;&lt;br /&gt;And you will see this screen (Click the Image to enlarge):&lt;br /&gt;&lt;br/&gt;&lt;a href="http://www.JosephGozlan.com/Blog/snippet4.PNG" target="_blank"&gt;&lt;img alt="Click the Image to enlarge" src="http://www.JosephGozlan.com/Blog/snippet4.PNG" width="450"&gt;&lt;/a&gt; &lt;br/&gt; &lt;br/&gt;&lt;br /&gt;&lt;br /&gt;To create a code snippet of your own you will need to build the file in a n XML format and supply it with all the attributes (shortcut, code etc.).&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;Here is how the above "for" statement snippet file looks like (Click the Image to enlarge)::&lt;br /&gt;&lt;br/&gt;&lt;a href="http://www.JosephGozlan.com/Blog/snippet5.PNG" target="_blank"&gt;&lt;img alt="Click the Image to enlarge" src="http://www.JosephGozlan.com/Blog/snippet5.PNG" width="450"&gt;&lt;/a&gt; &lt;br/&gt; &lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-8561203358565814224?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/8561203358565814224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/06/code-snippets-in-visual-studio-20082010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/8561203358565814224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/8561203358565814224'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/06/code-snippets-in-visual-studio-20082010.html' title='Code Snippets in Visual Studio 2008/2010'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-4384912144857603876</id><published>2010-06-14T13:38:00.000-07:00</published><updated>2010-06-25T08:04:53.131-07:00</updated><title type='text'>ToDo List - an .NET 3.5 MVC2 project utilizing Entity framework &amp; MS-SQL</title><content type='html'>Well, Since my web hosting does not support MVC2 framework at the moment I can't give you a full demonstration but I Can show you some of the neat, cool stuff Microsoft added to the .NET 3.5 framework.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Motivation&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;The MVC is Microsoft's implementation of the MVC design pattern (Model–View–Controller) (Click the link in order to learn more about the design pattern). With the increasing importance of a strong web presence for today's business world and the constant change and evolution of the search engines (Google, Bing, Yahoo, etc.) there are new development requirements that didn't exist before.&lt;br /&gt;The business' SEO (Search Engine Optimization) activities added new technical development requirement. If until now nobody cared how our URL addresses looked like or what keywords they contained, it has changes dramatically in the last year or so. Search engines these days look at the folder names, the page name and the suffixes as input for the ranking algorithms. &lt;br /&gt;I do not wish to open a SEO debate here (I might add a post about it to my Blog soon), I want to show you a new EASY way to make your web application's URLs a lot more SE friendly and user friendly at the same time. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;Technology&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;I used Visual Studio 2008 over .NET framework 3.5 and MS-SQL Server 2008&lt;br /&gt;The new features introduced in this project are: ASP.NET MVC2.0 &amp; ADO.NET Entity Framework . Combined together these new features of .NET 3.5 are very powerful and make the development of new, SEO friendly websites really simple. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;The Main Idea&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;We have three main components: &lt;br /&gt;•Model - the Data layer of our projects. Provide access to the data.&lt;br /&gt;•Control - the Business layer, where we do all the business logic of our project and function as an intermediate between the Model (Data) layer and the View(UI) layer.&lt;br /&gt;•View - a presentation layer, the UI (User Interface) layer. May contain some logic but only UI related logic (validations etc.).&lt;br /&gt;&lt;big&gt;&lt;big&gt;&lt;br /&gt;&lt;b&gt;Want to read more? &lt;a href="http://www.josephgozlan.com/index.php?option=com_content&amp;view=article&amp;id=7"&gt;Click Here&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/big&gt;&lt;/big&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-4384912144857603876?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/4384912144857603876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/06/todo-list-net-35-mvc2-project-utilizing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/4384912144857603876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/4384912144857603876'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/06/todo-list-net-35-mvc2-project-utilizing.html' title='ToDo List - an .NET 3.5 MVC2 project utilizing Entity framework &amp; MS-SQL'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-8011466641925728020</id><published>2010-06-08T05:51:00.000-07:00</published><updated>2010-06-08T05:51:53.061-07:00</updated><title type='text'>Super cool UNdocumented SQL procedure</title><content type='html'>xp_dirtree is an UNdocumented SQL procedure. you can use it to get a list of folders in a directory, including sub-folder to any depth!!!&lt;br /&gt;&lt;br /&gt;EXEC master..xp_dirtree '[&lt;i&gt;&lt;b&gt;directory_path&lt;/b&gt;&lt;/i&gt;]', [&lt;i&gt;&lt;b&gt;depth&lt;/b&gt;&lt;/i&gt;]&lt;br /&gt;&lt;br /&gt;for example:&lt;br /&gt;EXEC master..xp_dirtree 'c:\Installs', 1&lt;br /&gt;will get you a list of folders in the directory c:\Installs.&lt;br /&gt;&lt;br /&gt;another example&lt;br /&gt;EXEC master..xp_dirtree 'c:\Installs', 1&lt;br /&gt;will get you a list of folders in the directory c:\Installs AND all the folders under these folders (2 levels down)&lt;br /&gt;&lt;br /&gt;small query that can make your life easier sometimes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-8011466641925728020?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/8011466641925728020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/06/super-cool-undocumented-sql-procedure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/8011466641925728020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/8011466641925728020'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/06/super-cool-undocumented-sql-procedure.html' title='Super cool UNdocumented SQL procedure'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-5517678618382251563</id><published>2010-06-01T12:06:00.000-07:00</published><updated>2010-06-01T12:06:50.879-07:00</updated><title type='text'>Search &amp; Replace values in MS-SQL 2005/20088 text fields</title><content type='html'>Starting from MS-SQL 2005 there is a new SQL function called "REPLACE" and you can use it to replace values in text fields (varchar/nvarchar/nchar...).&lt;br /&gt;&lt;br /&gt;just put the right table names and the right column names in the following code:&lt;br /&gt;&lt;br /&gt;update TableTable&lt;br /&gt;set ArticleContent = (&lt;br /&gt;      SELECT REPLACE(TargetColumn, 'old value', 'new  value')&lt;br /&gt;      FROM TargetTable Table_In&lt;br /&gt;      where Table_Outside.ArticleId = Table_In.ArticleId&lt;br /&gt;      )&lt;br /&gt;from TargetTable Table_Outside&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-5517678618382251563?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/5517678618382251563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/06/search-replace-values-in-ms-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/5517678618382251563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/5517678618382251563'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/06/search-replace-values-in-ms-sql.html' title='Search &amp; Replace values in MS-SQL 2005/20088 text fields'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-8592887680472978989</id><published>2010-05-28T15:42:00.000-07:00</published><updated>2010-05-28T15:42:53.076-07:00</updated><title type='text'>How to generate WSDL files</title><content type='html'>So you created a new web service in .NET and want to start integration with the application that is going to use your web service. &lt;br /&gt;&lt;br /&gt;Wait, there is a problem. The other application is written in JAVA and they ask you to get them the WSDL file so they can build a reference.&lt;br /&gt;&lt;br /&gt;Here is how you get the *.wsdl file:&lt;br /&gt;1) run CMD&lt;br /&gt;2) go to C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin&lt;br /&gt;********* can be other VS version&lt;br /&gt;3) run: disco.exe [WS URL]&lt;br /&gt;&lt;br /&gt;and there you have it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-8592887680472978989?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/8592887680472978989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/how-to-generate-wsdl-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/8592887680472978989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/8592887680472978989'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/how-to-generate-wsdl-files.html' title='How to generate WSDL files'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-789476804139629830</id><published>2010-05-26T07:12:00.000-07:00</published><updated>2010-05-26T07:14:45.575-07:00</updated><title type='text'>How to launch the MS download manager</title><content type='html'>Have you ever stated downloading from Microsoft's website using the MS download manager and it closed in the middle for some reason?&lt;br /&gt;&lt;br /&gt;Here is what you can do to get it started again (open the UI):&lt;br /&gt;&lt;br /&gt;1) Open a command window&lt;br /&gt;&lt;br /&gt;2) Change Directory to %SystemRoot%\Downloaded Program Files\&lt;br /&gt;&lt;br /&gt;3) Type TransferMgr.exe and press Enter&lt;br /&gt;&lt;br /&gt;That's it. Simple.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-789476804139629830?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/789476804139629830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/how-to-launch-ms-download-manager.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/789476804139629830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/789476804139629830'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/how-to-launch-ms-download-manager.html' title='How to launch the MS download manager'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-4245953428469988699</id><published>2010-05-25T16:37:00.000-07:00</published><updated>2010-05-25T16:41:26.642-07:00</updated><title type='text'>New website - SQL Basic Training</title><content type='html'>I recently uploaded a new website for &lt;strong&gt;SQL Basics training&lt;/strong&gt;: &lt;a href="http://www.sqlbasics.com"&gt;www.SQLBasics.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I tried to cover the basics just enough to get someone started. &lt;br /&gt;I'll appreciate any comments, questions or requests you might have.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-4245953428469988699?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/4245953428469988699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/new-website-sql-basic-training.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/4245953428469988699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/4245953428469988699'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/new-website-sql-basic-training.html' title='New website - SQL Basic Training'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-984708681654675102</id><published>2010-05-24T14:52:00.001-07:00</published><updated>2010-05-26T18:37:04.804-07:00</updated><title type='text'>SQL tempdb and constraint names</title><content type='html'>A weird thing I found out about MS-SQL's tempdb a few days ago was that the server does not hash the constraint names.&lt;br /&gt;&lt;br /&gt;I don't know if you know the way tempdb is working in MS-SQL but the basic concept is that when a process is creating a temp table the tempdb is hashing the name to create a unique instance for the running session.&lt;br /&gt;&lt;br /&gt;so if you write a code that looks like this:&lt;br /&gt;create table #TestTabe (id int, descript nvarchar(50))&lt;br /&gt;&lt;br /&gt;in runtime you will see in the tempdb something that looks like this:&lt;br /&gt;#TestTable________________123213E2B&lt;br /&gt;&lt;br /&gt;the main reason is that you can have multiple sessions running at the same time.&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Let's add a constraint to the equation:&lt;br /&gt;&lt;br /&gt;CREATE TABLE #TestTable(&lt;br /&gt;id int, descript nvarchar(50),&lt;br /&gt;CONSTRAINT [PK_#TestTable] PRIMARY KEY CLUSTERED&lt;br /&gt;(&lt;br /&gt;[id] ASC&lt;br /&gt;)&lt;br /&gt;)&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;in runtime you will see something like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="WIDTH: 450px;" src="http://www.josephgozlan.com/blog/tempdb1.JPG"/&gt;&lt;br /&gt;&lt;br /&gt;The normal way tempdb is operating is when the session ends (i.e. stored procedure finished it's execution) or when the user manually drop the table it's deleted from the tempdb with all of it's constraints. &lt;/div&gt;&lt;div&gt;if your session fails for some reason and you didn't catch it the tempdb is not cleaned and the table (with the hashed name) and it's constraints are left in the tempdb.&lt;/div&gt;&lt;div&gt;This is not a big deal in general cause the table name is hashed for each session so the next session will have no problem creating it's own instance of the table.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;The weird stuff I found out and kind'a puzzled me was that MSSQL does not hash the constraint name! so the next session that tried to create the table FAILD with the error of "Constraint already exists in the db"!&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;So until the next cleanup of the tempdb (restart of the sql server should do the job) the process is stuck and will fail every time!&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;The solution?&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;Wrap your code with try &amp;amp; catch so you can drop all the temp tables in the case of a failure! The code I saw (not my code of course :-) )was not wrapped and this created an issue. &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;That's it for today. &lt;/div&gt;&lt;div&gt;Till the next time, keep coding...&lt;/div&gt;&lt;div&gt;Joseph Gozlan&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-984708681654675102?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/984708681654675102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/sql-tempdb-and-constraint-names.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/984708681654675102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/984708681654675102'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/sql-tempdb-and-constraint-names.html' title='SQL tempdb and constraint names'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-1042121824263690394</id><published>2010-05-24T14:38:00.000-07:00</published><updated>2010-05-24T14:51:44.626-07:00</updated><title type='text'>Who am I?</title><content type='html'>I guess what you are thinking to yourself is "who is this guy?" and "why should I bother reading his Blog?"&lt;br /&gt;&lt;br /&gt;Well, I can answer the first question easily, my name is &lt;strong&gt;Joseph Gozlan&lt;/strong&gt; and I'm an &lt;strong&gt;Information Systems Engineer&lt;/strong&gt; from Plano, TX, USA.&lt;br /&gt;&lt;br /&gt;I work for Retalix USA (&lt;a href="http://www.google.com/url?q=/finance%3Fclient%3Dob%26q%3DNASDAQ:RTLX&amp;amp;ei=jvL6S4CzAZPYNYq48bwF&amp;amp;sa=X&amp;amp;oi=stock&amp;amp;ct=title&amp;amp;ved=0CBQQowE&amp;amp;usg=AFQjCNGCHLNAHC0ItZx1YIuOMyruvAlnjw"&gt;RTLX&lt;/a&gt;). I've been with Retalix for the past 6 years doing all kind of jobs and filling a few positions. I've started as a .NET developer, been a .NET Team Leader and a technical expert.&lt;br /&gt;&lt;br /&gt;I was Born and raised in Israel and relocated to Plano Texas in 2007.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why should you read my Blog?&lt;br /&gt;&lt;/strong&gt;I don't have a really good answer for that there are many great Bloggers out there with great writing skills. I can only say what kind of info I plan on posting here and you will be the judge if you think this can interest you or not. Every once in a while I find out small technical things that I find interesting or helpful (see next entry about SQL's tempdb). So this is the kind of stuff I'll share here. it can be from the .NET development world, SQL server tricks or even some motivation related items (I follow &lt;a href="http://www.danpink.com/"&gt;Daniel Pink's great Blog&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;That's it. If you have any questions, shoot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-1042121824263690394?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/1042121824263690394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/who-am-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/1042121824263690394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/1042121824263690394'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/who-am-i.html' title='Who am I?'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076504683384247039.post-8423036124852626039</id><published>2010-05-24T14:34:00.000-07:00</published><updated>2010-05-24T14:38:24.052-07:00</updated><title type='text'>First Blog entry</title><content type='html'>So I figured it's about time I joined the Bloggers community.&lt;br /&gt;for a while now I've been emailing people with interesting technological stuff and I figured It'll be easier to maintain a Blog than to send emails. Plus, let's face it, Blog helps with the SEO to my website: &lt;a href="http://www.josephgozlan.com/"&gt;www.JosephGozlan.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3076504683384247039-8423036124852626039?l=josephgozlan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://josephgozlan.blogspot.com/feeds/8423036124852626039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/first-blog-entry.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/8423036124852626039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076504683384247039/posts/default/8423036124852626039'/><link rel='alternate' type='text/html' href='http://josephgozlan.blogspot.com/2010/05/first-blog-entry.html' title='First Blog entry'/><author><name>Joseph Gozlan, Information Systems Engineer</name><uri>http://www.blogger.com/profile/14089530074961352864</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
