<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>SQL SERVER</title>
        <link>http://geekswithblogs.net/Gaurav/category/7931.aspx</link>
        <description>SQL SERVER</description>
        <language>en-US</language>
        <copyright>Gaurav Taneja</copyright>
        <managingEditor>taneja_gaurav@yahoo.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Truncating All Tables </title>
            <link>http://geekswithblogs.net/Gaurav/archive/2009/06/29/133114.aspx</link>
            <description>&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;Create&lt;/p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Procedure&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; GT_DeleteRecords_AllTables&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;As&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;/*********************************************************&lt;/p&gt;
&lt;p&gt;Stored Procedure: GT_DeleteRecords_AllTables&lt;/p&gt;
&lt;p&gt;Do not excute this proc &lt;/p&gt;
&lt;p&gt;Purpose: Delete ALL records within ALL the tables in a DB with ease.&lt;/p&gt;
&lt;p&gt;Test: Exec GT_DeleteRecords_AllTables**********************************************************/&lt;/p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;Set&lt;/p&gt;
&lt;p&gt;Exec&lt;/p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;nocount&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;on&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;sp_MSForEachTable&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;'Alter Table ? NoCheck Constraint All'&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;Exec&lt;/p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;sp_MSForEachTable&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;
&lt;p&gt;'&lt;/p&gt;
&lt;p&gt;If ObjectProperty(Object_ID(''?''), ''TableHasForeignRef'')=1&lt;/p&gt;
&lt;p&gt;Begin&lt;/p&gt;
&lt;p&gt;-- Just to know what all table used delete syntax.&lt;/p&gt;
&lt;p&gt;Print ''Delete from '' + ''?''&lt;/p&gt;
&lt;p&gt;Delete From ?&lt;/p&gt;
&lt;p&gt;End&lt;/p&gt;
&lt;p&gt;Else&lt;/p&gt;
&lt;p&gt;Begin&lt;/p&gt;
&lt;p&gt;-- Just to know what all table used Truncate syntax.&lt;/p&gt;
&lt;p&gt;Print ''Truncate Table '' + ''?''&lt;/p&gt;
&lt;p&gt;Truncate Table ?&lt;/p&gt;
&lt;p&gt;End&lt;/p&gt;
&lt;p&gt;'&lt;/p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;Exec&lt;/p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;sp_MSForEachTable&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;'Alter Table ? Check Constraint All'&lt;/font&gt;&lt;/font&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133114"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133114" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Gaurav/aggbug/133114.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gaurav Taneja</dc:creator>
            <guid>http://geekswithblogs.net/Gaurav/archive/2009/06/29/133114.aspx</guid>
            <pubDate>Mon, 29 Jun 2009 10:21:30 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Gaurav/comments/133114.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Gaurav/archive/2009/06/29/133114.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Gaurav/comments/commentRss/133114.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Gaurav/services/trackbacks/133114.aspx</trackback:ping>
        </item>
        <item>
            <title>Count No of Procedure in Database</title>
            <link>http://geekswithblogs.net/Gaurav/archive/2008/05/05/121919.aspx</link>
            <description>&lt;span style="font-weight: bold;"&gt;Count Procedure&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
select  count(*) from sysobjects where xtype='P'&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;other option is below&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
select CASE(XType) WHEN 'C' THEN 'CHECK constraint'&lt;br /&gt;
WHEN 'D' THEN 'Default or  DEFAULT constraint'&lt;br /&gt;
WHEN 'F' THEN 'FOREIGN KEY constraint'&lt;br /&gt;
WHEN 'L' THEN  'Log'&lt;br /&gt;
WHEN 'FN' THEN 'Scalar function'&lt;br /&gt;
WHEN 'IF' THEN 'Inlined  table-function'&lt;br /&gt;
WHEN 'P' THEN 'Stored procedure'&lt;br /&gt;
WHEN 'PK' THEN 'PRIMARY  KEY constraint (type is K)'&lt;br /&gt;
WHEN 'RF' THEN 'Replication filter stored  procedure' &lt;br /&gt;
WHEN 'S' THEN 'System table'&lt;br /&gt;
WHEN 'TF' THEN 'Table  function'&lt;br /&gt;
WHEN 'TR' THEN 'Trigger'&lt;br /&gt;
WHEN 'U' THEN 'User table'&lt;br /&gt;
WHEN 'UQ'  THEN 'UNIQUE constraint (type is K)'&lt;br /&gt;
WHEN 'V' THEN 'View'&lt;br /&gt;
WHEN 'X' THEN  'Extended stored procedure' END Type&lt;br /&gt;
, Count(*) as total from  sysObjects&lt;br /&gt;
GROUP BY xtype&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121919"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121919" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Gaurav/aggbug/121919.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gaurav Taneja</dc:creator>
            <guid>http://geekswithblogs.net/Gaurav/archive/2008/05/05/121919.aspx</guid>
            <pubDate>Mon, 05 May 2008 22:02:13 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Gaurav/comments/121919.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Gaurav/archive/2008/05/05/121919.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Gaurav/comments/commentRss/121919.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Gaurav/services/trackbacks/121919.aspx</trackback:ping>
        </item>
        <item>
            <title>New in Visual Studio 2008</title>
            <link>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120952.aspx</link>
            <description>&lt;table width="100%" cellspacing="0" cellpadding="0" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr style="font-weight: bold;"&gt;
            &lt;td valign="top" align="left" id="ctl00_ContentPlaceHolder1_tdBlogTitle" class="bluetxt"&gt;What is new in Visual Studio 2008&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt; &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td valign="top" id="ctl00_ContentPlaceHolder1_tdBlogText" class="normaltxt"&gt;
            &lt;p&gt;A quick list of some of the new features are: &lt;/p&gt;
            &lt;ul&gt;
                &lt;li&gt;Multi-Targeting support  &lt;/li&gt;
                &lt;li&gt;Web Designer and CSS support  &lt;/li&gt;
                &lt;li&gt;ASP.NET AJAX and JavaScript support  &lt;/li&gt;
                &lt;li&gt;Project Designer  &lt;/li&gt;
                &lt;li&gt;Data  &lt;/li&gt;
                &lt;li&gt;LINQ – Language Integrated Query &lt;/li&gt;
            &lt;/ul&gt;
            &lt;p&gt;The features listed and explained in this paper are not complete and this  document intends to give you a forehand to start off with VS 2008.&lt;/p&gt;
            &lt;h2 editor_id="mce_editor_0"&gt;&lt;a name="_Toc177808315"&gt;&lt;span class="bluetxt"&gt;&lt;span class="highlight"&gt;&lt;font size="3"&gt;1. Multi-Targeting  Support&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;
            &lt;p&gt;Earlier, each Visual Studio release only supported a specific version of the  .NET Framework. For example, VS 2003 only works with .NET 1.1, and VS 2005 only  works with .NET 2.0. &lt;/p&gt;
            &lt;p&gt;One of the major changes with the VS 2008 release is to support what  Microsoft calls "Multi-Targeting". This means that Visual Studio will now  support targeting multiple versions of the .NET Framework, and developers will  be able to take advantage of the new features that Visual Studio provides  without having to migrate their existing projects and deployed applications to  use a new version of the .NET Framework. &lt;/p&gt;
            &lt;p&gt;Now when we open an existing project or create a new one with VS 2008, we can  pick which version of the .NET Framework to work with. The IDE will update its  compilers and feature-set to match the chosen .NET Framework. &lt;/p&gt;
            &lt;p&gt;Features, controls, projects, item-templates, and references that do not work  with the selected version of the Framework will be made unavailable or will be  hidden. &lt;/p&gt;
            &lt;p&gt;Unfortunately, support has not been included to work with Framework versions  1.1 and earlier. The present release supports 2.0/3.0 and 3.5 .NET Frameworks.  &lt;/p&gt;
            &lt;p&gt;Microsoft plans to continue multi-targeting support in all future releases of  Visual Studio. &lt;/p&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span editor_id="mce_editor_0" class="bluetxt"&gt;Creating a New Project with Visual Studio 2008 that  Targets .NET 2.0 Framework Library&lt;/span&gt; &lt;/h3&gt;
            &lt;p&gt;The screenshots below depict the creation of a new web application targeting  .NET 2.0 Framework. Choose File-&amp;gt;New Project. As we see in the snapshot below  in the top-right of the new project dialog, there is now a dropdown that allows  us to choose which versions of the .NET Framework we want to target when we  create the new project. The templates available are filtered depending on the  version of the Framework chosen from the dropdown: &lt;/p&gt;
            &lt;img width="533" height="358" border="0" editor_id="mce_editor_0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image002.jpg" alt="" /&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span class="bluetxt"&gt;Can I Upgrade an Existing  Project to .NET 3.5?&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;When we open a solution created using an older version of Visual Studio and  Framework, VS 2008 would ask if migration is required. If we opt to migrate,  then a migration wizard would start. If we wish to upgrade our project to target  a newer version of the Framework at a later point of time, we can pull up the  project properties page and choose the Target Framework. The required assemblies  are automatically referenced. The snapshot below shows the properties page with  the option Target Framework marked. &lt;/p&gt;
            &lt;img width="597" height="378" border="0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image003.gif" alt="" /&gt;
            &lt;h2 editor_id="mce_editor_0"&gt;&lt;span editor_id="mce_editor_0" class="bluetxt"&gt;&lt;span class="highlight"&gt;&lt;font size="3"&gt;2. &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;a name="_Toc177808315"&gt;&lt;span class="bluetxt"&gt;&lt;span class="highlight"&gt;&lt;font size="3"&gt;Web Designer, Editing and CSS  Support&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;
            &lt;p editor_id="mce_editor_0"&gt;One feature that web developers will discover with  VS 2008 is its drastically improved HTML designer, and the extensive CSS support  made available. &lt;/p&gt;
            &lt;p&gt;The snapshots below depict some of the new web designer features in-built  into VS 2008. &lt;/p&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span class="bluetxt"&gt;Split View Editing&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;In addition to the existing views, Design view and Code view, VS 2008 brings  along the Split view which allows us to view both the HTML source and the Design  View at the same-time, and easily make changes in any of the views. As shown in  the image below, as we select a tag in code view, the corresponding  elements/controls are selected in design view. &lt;/p&gt;
            &lt;img width="602" height="457" border="0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image004.gif" alt="" /&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span class="bluetxt"&gt;CSS Style Manager&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;VS 2008 introduces a new tool inside the IDE called "Manage Styles". This  shows all of the CSS style sheets for the page. &lt;/p&gt;
            &lt;p&gt;It can be used when we are in any of the views - design, code and split  views. Manage Styles tool can be activated by choosing Format -&amp;gt; CSS Styles  -&amp;gt; Manage Styles from the menu. A snapshot of the same would look like the  following: &lt;/p&gt;
            &lt;img width="602" height="338" border="0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image005.gif" alt="" /&gt;
            &lt;p&gt;Create a new style using the new style dialog window as show in the snapshot  below.&lt;/p&gt;
            &lt;img width="340" height="325" border="0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image006.jpg" alt="" /&gt;
            &lt;p&gt;Now, the style manager would show &lt;code&gt;.labelcaption&lt;/code&gt; style as well in  the CSS styles list. However, if we observe that the body element has a circle  around it but the &lt;code&gt;.labelcaption&lt;/code&gt; does not have one, this is because  the style is not in use yet. &lt;/p&gt;
            &lt;img width="544" height="359" border="0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image007.jpg" alt="" /&gt;
            &lt;p&gt;We will not select all the labels below and apply our new style  &lt;code&gt;.labelcaption&lt;/code&gt;.&lt;/p&gt;
            &lt;img width="537" height="344" border="0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image008.jpg" alt="" /&gt;
            &lt;p&gt;We can choose to modify the existing style through GUI using "Modify  style..." menu option in the dropdown menu as shown above or choose to hand edit  the code by choosing the option "Go To Code". &lt;/p&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span class="bluetxt"&gt;CSS Source View  Intellisense&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;The designer is equipped with the ability to select an element or control in  design-view, and graphically select a rule from the CSS list to apply to it.  &lt;/p&gt;
            &lt;p&gt;We will also find when in source mode that we now have intellisense support  for specifying CSS class rules. The CSS Intellisense is supported in both  regular ASP.NET pages as well as when working with pages based on master pages.  &lt;/p&gt;
            &lt;img width="499" height="402" border="0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image009.jpg" alt="" /&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span class="bluetxt"&gt;Code Editing  Enhancements&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;Below is a non-exhaustive list of a few new code editing improvements. There  are many more about which I don't know yet. &lt;/p&gt;
            &lt;h4 editor_id="mce_editor_0"&gt;&lt;span class="bluetxt"&gt;Transparent Intellisense  Mode&lt;/span&gt; &lt;/h4&gt;
            &lt;p&gt;While using VS 2005/2003 we often find ourselves escaping out of intellisense  in order to better see the code around, and then go back and complete what we  were doing. &lt;/p&gt;
            &lt;p&gt;VS 2008 provides a new feature which allows us to quickly make the  intellisense drop-down list semi-transparent. Just hold down the "Ctrl" key  while the intellisense drop-down is visible and we will be able to switch it  into a transparent mode that enables us to look at the code beneath without  having to escape out of Intellisense. The screenshot below depicts the same.  &lt;/p&gt;
            &lt;img width="554" height="298" border="0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image0010.gif" alt="" /&gt;
            &lt;h4 editor_id="mce_editor_0"&gt;&lt;span class="bluetxt"&gt;Organize C# Using  Statements&lt;/span&gt; &lt;/h4&gt;
            &lt;p&gt;One of the small, but a nice new feature in VS 2008 is support for better  organizing &lt;code&gt;&lt;span class="code-keyword"&gt;using&lt;/span&gt;&lt;/code&gt; statements in C#.  We can now select a list of &lt;code&gt;&lt;span class="code-keyword"&gt;using&lt;/span&gt;&lt;/code&gt;  statements, right-click, and then select the "Organize Usings" sub-menu. When we  use this command the IDE will analyze what types are used in the code file, and  will automatically remove those namespaces that are declared but not required. A  small and handy feature for code refactoring. &lt;/p&gt;
            &lt;img width="476" height="347" border="0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image0011.jpg" alt="" /&gt;
            &lt;h2 editor_id="mce_editor_0"&gt;&lt;span class="highlight"&gt;&lt;font size="3" editor_id="mce_editor_0"&gt;3. &lt;/font&gt;&lt;/span&gt;&lt;a name="_Toc177808314"&gt;&lt;span class="highlight"&gt;&lt;font size="3"&gt;ASP.NET &lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="highlight"&gt;&lt;font size="3"&gt;AJAX and JavaScript Support&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span class="bluetxt"&gt;JavaScript  Intellisense&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;One new feature that developers will find with VS 2008 is its built-in  support for JavaScript Intellisense. This makes using JavaScript and building  AJAX applications significantly easier. A double click on HTML control in design  mode would automatically create a click event to the button and would create the  basic skeleton of the JavaScript function. As we see in the depicted image  below, JavaScript Intellisense is inbuilt now. Other JavaScript Intellisense  features include Intellisense for external JavaScript libraries and adding  Intellisense hints to JavaScript functions. &lt;/p&gt;
            &lt;img width="441" height="297" border="0" src="http://www.codeproject.com/KB/dotnet/Visual_Studio_2008/clip_image0012.jpg" alt="" /&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span class="bluetxt"&gt;JavaScript  Debugging&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;One new JavaScript feature in VS 2008 is the much-improved support for  JavaScript debugging. This makes debugging AJAX applications significantly  easier. JavaScript debugging was made available in VS 2005 itself. However, we  had to run the web application first to set the breakpoint or use the "debugger"  JavaScript statement. &lt;/p&gt;
            &lt;p&gt;VS 2008 makes this much better by adding new support that allows us to set  client-side JavaScript breakpoints directly within your server-side  &lt;em&gt;.aspx&lt;/em&gt; and &lt;em&gt;.master&lt;/em&gt; source files. &lt;/p&gt;
            &lt;p&gt;We can now set both client-side JavaScript breakpoints and VB/C# server-side  breakpoints at the same time on the same page and use a single debugger to step  through both the server-side and client-side code in a single debug session.  This feature is extremely useful for AJAX applications. The breakpoints are  fully supported in external JavaScript libraries as well. &lt;/p&gt;
            &lt;h2 editor_id="mce_editor_0"&gt;&lt;span class="highlight"&gt;&lt;font size="3"&gt;4.  &lt;/font&gt;&lt;/span&gt;&lt;a name="_Toc177808315"&gt;&lt;span class="highlight"&gt;&lt;font size="3"&gt;Few Other  Features and Enhancements&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;
            &lt;p&gt;Below is a list of few other enhancements and new features included in  Microsoft Visual Studio 2008. &lt;/p&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span class="bluetxt"&gt;Project Designer&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;Windows Presentation Foundation (WPF) applications have been added to Visual  Studio 2008. There are four WPF project types: &lt;/p&gt;
            &lt;ul&gt;
                &lt;li&gt;WinFX Windows Application  &lt;/li&gt;
                &lt;li&gt;WinFX Web Browser Application  &lt;/li&gt;
                &lt;li&gt;WinFX Custom Control Library  &lt;/li&gt;
                &lt;li&gt;WinFX Service Library &lt;/li&gt;
            &lt;/ul&gt;
            &lt;p&gt;When a WPF project is loaded in the IDE, the user interface of the Project  Designer pages lets us specify properties specific to WPF applications. &lt;/p&gt;
            &lt;h3&gt;&lt;span class="bluetxt"&gt;Data&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;&lt;a name="data"&gt;Microsoft Visual Studio 2008 Beta 2 includes the following new  features to incorporate data into applications: &lt;/a&gt;&lt;/p&gt;
            &lt;ul&gt;
                &lt;li&gt;The Object Relational Designer (O/R Designer) assists developers in creating  and editing the objects (LINQ to SQL entities) that map between an application  and a remote database  &lt;/li&gt;
                &lt;li&gt;Hierarchical update capabilities in Dataset Designer, providing generated  code that includes the save logic required to maintain referential integrity  between related tables  &lt;/li&gt;
                &lt;li&gt;Local database caching incorporates an SQL Server Compact 3.5 database into  an application and configures it to periodically synchronize the data with a  remote database on a server. Local database caching enables applications to  reduce the number of round trips between the application and a database server  &lt;/li&gt;
            &lt;/ul&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span class="highlight"&gt;&lt;span class="bluetxt"&gt;LINQ –  Language Integrated Query&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
            &lt;p editor_id="mce_editor_0"&gt;LINQ is a new feature in VS 2008 that broadens great  querying capabilities into the language syntax. LINQ introduces patterns for  querying and updating data. A set of new assemblies are provided that enable the  use of LINQ with collections, SQL databases, and XML documents. &lt;/p&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span editor_id="mce_editor_0" class="highlight"&gt;&lt;span class="bluetxt"&gt;Visual Studio 2008  Debugger&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;The Visual Studio 2008 debugger has been enhanced with the following  features: &lt;/p&gt;
            &lt;ul&gt;
                &lt;li&gt;Remote debugging support on Windows Vista  &lt;/li&gt;
                &lt;li&gt;Improved support for debugging multithreaded applications  &lt;/li&gt;
                &lt;li&gt;Debugging support for LINQ programming  &lt;/li&gt;
                &lt;li&gt;Debugging support for Windows Communications Foundation  &lt;/li&gt;
                &lt;li&gt;Support for script debugging, including client-side script files generated  from server-side script now appear in Solution Explorer &lt;/li&gt;
            &lt;/ul&gt;
            &lt;h3 editor_id="mce_editor_0"&gt;&lt;span editor_id="mce_editor_0" class="highlight"&gt;&lt;span class="bluetxt"&gt;Reporting&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
            &lt;p&gt;Visual Studio 2008 provides several new reporting features and improvements  such as: &lt;/p&gt;
            &lt;ul&gt;
                &lt;li&gt;New Report Projects: Visual Studio 2008 includes two new project templates  for creating reporting applications. When we create a new Reports Application  project, Visual Studio provides a report (&lt;em&gt;.rdlc&lt;/em&gt;) and a form with a  ReportViewer control bound to the report.  &lt;/li&gt;
                &lt;li&gt;Report Wizard: Visual Studio 2008 introduces a Report Wizard, which guides  us through the steps to create a basic report. After we complete the wizard, we  can enhance the report by using Report Designer.  &lt;/li&gt;
                &lt;li&gt;Expression Editor Enhancement: The Expression Editor now provides  expressions that we can use directly or customize as required.  &lt;/li&gt;
                &lt;li&gt;PDF Compression: The ReportViewer controls can now compress reports that are  rendered or exported to the PDF format. &lt;/li&gt;
            &lt;/ul&gt;
            &lt;br /&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120952"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120952" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Gaurav/aggbug/120952.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gaurav Taneja</dc:creator>
            <guid>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120952.aspx</guid>
            <pubDate>Wed, 02 Apr 2008 04:27:16 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Gaurav/comments/120952.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120952.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Gaurav/comments/commentRss/120952.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Gaurav/services/trackbacks/120952.aspx</trackback:ping>
        </item>
        <item>
            <title>Function to convert DateTime to MM/DD/YYYY format  + SQL SERVER</title>
            <link>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120949.aspx</link>
            <description>&lt;span style="font-weight: bold;"&gt;Function to convert DateTime to MM/DD/YYYY format&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;
&lt;br /&gt;
CreateFUNCTION [dbo].[tkfunConvertDateToMMDDYYYY](@dtDate varchar(10))&lt;br /&gt;
    RETURNS VARCHAR(10)&lt;br /&gt;
AS&lt;br /&gt;
BEGIN&lt;br /&gt;
    RETURN substring(@dtDate,4,2)+'/'+substring(@dtDate,1,2)+'/'+substring(@dtDate,7,4)&lt;br /&gt;
END&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120949"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120949" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Gaurav/aggbug/120949.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gaurav Taneja</dc:creator>
            <guid>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120949.aspx</guid>
            <pubDate>Wed, 02 Apr 2008 02:41:35 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Gaurav/comments/120949.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120949.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Gaurav/comments/commentRss/120949.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Gaurav/services/trackbacks/120949.aspx</trackback:ping>
        </item>
        <item>
            <title>Function to Convert DateTime to DD/MM/YYYY format + SQL SERVER</title>
            <link>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120948.aspx</link>
            <description>&lt;span style="font-weight: bold;"&gt;Function to Convert DateTime to DD/MM/YYYY format&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
CreateFUNCTION [dbo].[tkfunConvertDateToDDMMYYYY](@dtDate varchar(10))&lt;br /&gt;
    RETURNS datetime&lt;br /&gt;
AS&lt;br /&gt;
BEGIN&lt;br /&gt;
    RETURN Convert(datetime,substring(@dtDate,4,2)+'/'+substring(@dtDate,1,2)+'/'+substring(@dtDate,7,4))&lt;br /&gt;
END&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120948"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120948" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Gaurav/aggbug/120948.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gaurav Taneja</dc:creator>
            <guid>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120948.aspx</guid>
            <pubDate>Wed, 02 Apr 2008 02:40:15 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Gaurav/comments/120948.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120948.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Gaurav/comments/commentRss/120948.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Gaurav/services/trackbacks/120948.aspx</trackback:ping>
        </item>
        <item>
            <title>Remove Special Character from XML string + sql Server</title>
            <link>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120947.aspx</link>
            <description>&lt;span style="font-weight: bold;"&gt;Remove Special Character from string &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
-- =============================================&lt;br /&gt;
-- Author:        &amp;lt;Author,,Name&amp;gt;&lt;br /&gt;
-- Create date: &amp;lt;Create Date, ,&amp;gt;&lt;br /&gt;
-- Description:    &amp;lt;Description, ,&amp;gt;&lt;br /&gt;
-- =============================================&lt;br /&gt;
ALTER  FUNCTION [dbo].[RemoveSpChar]&lt;br /&gt;
(&lt;br /&gt;
    -- Add the parameters for the function here&lt;br /&gt;
    @sInput varchar(MAX)=''&lt;br /&gt;
)&lt;br /&gt;
RETURNS varchar(MAX)&lt;br /&gt;
AS&lt;br /&gt;
BEGIN&lt;br /&gt;
    -- Declare the return variable here&lt;br /&gt;
    DECLARE @sOutput Varchar(MAX),&lt;br /&gt;
            @iIndex int,&lt;br /&gt;
            @iLength int,&lt;br /&gt;
            @sChar varchar(1),&lt;br /&gt;
            @iASCII int,&lt;br /&gt;
            @iLen int,&lt;br /&gt;
            @iRem int&lt;br /&gt;
&lt;br /&gt;
    set @sInput= ltrim(rtrim(@sInput))&lt;br /&gt;
    set @iLength = len(@sInput)&lt;br /&gt;
    set @iIndex =1&lt;br /&gt;
    set @sOutput=''&lt;br /&gt;
&lt;br /&gt;
    while @iIndex &amp;lt;= @iLength&lt;br /&gt;
    begin&lt;br /&gt;
        set @sChar=substring(@sInput,@iIndex,1)&lt;br /&gt;
        set @iASCII=ascii(@sChar)&lt;br /&gt;
        &lt;br /&gt;
        if ((@iASCII&amp;gt;=48 and @iASCII&amp;lt;=57) or (@iASCII&amp;gt;=65 and @iASCII&amp;lt;=90) or (@iASCII&amp;gt;=97 and @iASCII&amp;lt;=122) )&lt;br /&gt;
            set @sOutput=@sOutput+@sChar&lt;br /&gt;
            --return @sChar + ' - ' + convert(varchar,@iASCII)&lt;br /&gt;
        set @iIndex =@iIndex +1&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if len(@sOutput)&amp;gt;17&lt;br /&gt;
        set @sOutput=substring(@sOutput,1,17)&lt;br /&gt;
    else if len(@sOutput)&amp;lt;6&lt;br /&gt;
    begin&lt;br /&gt;
        set @iLen=len(@sOutput)&lt;br /&gt;
        set @iRem=6-@iLen&lt;br /&gt;
        &lt;br /&gt;
        set @sOutput=substring(@sOutput + replicate('0',@iRem),1,6)&lt;br /&gt;
&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Return the result of the function&lt;br /&gt;
    RETURN @sOutput&lt;br /&gt;
&lt;br /&gt;
END&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120947"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120947" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Gaurav/aggbug/120947.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gaurav Taneja</dc:creator>
            <guid>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120947.aspx</guid>
            <pubDate>Wed, 02 Apr 2008 02:38:18 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Gaurav/comments/120947.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Gaurav/archive/2008/04/01/120947.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Gaurav/comments/commentRss/120947.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Gaurav/services/trackbacks/120947.aspx</trackback:ping>
        </item>
        <item>
            <title>How to change the ower of tables in Microsoft SQL Server database</title>
            <link>http://geekswithblogs.net/Gaurav/archive/2006/08/04/87074.aspx</link>
            <description>&lt;p dir="ltr"&gt;&lt;font size="-0"&gt;To do this, execute the following command on every table&lt;/font&gt;&lt;/p&gt;
&lt;blockquote style="margin-right: 0px;" dir="ltr"&gt;
&lt;p dir="ltr"&gt;&lt;font size="2" face="Courier New"&gt;&lt;strong&gt;exec sp_changeobjectowner '?????', 'DBO'&lt;/strong&gt;&lt;/font&gt; - where &lt;strong&gt;&lt;font size="2" face="Courier New"&gt;????? &lt;/font&gt;&lt;/strong&gt;is the name of your database table.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p dir="ltr"&gt;Also below is the stored procedure through which you can change the owner for every table inthe database.&lt;/p&gt;
&lt;font size="2"&gt;
&lt;p&gt;&lt;strong&gt;EXEC sp_changeobjectowner @oldownerplusobject, @new&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;create procedure J_ChangeObjectOwner (@type varchar(1),@old varchar(20),@new&lt;/p&gt;
&lt;p&gt;varchar(20))&lt;/p&gt;
&lt;p&gt;as&lt;/p&gt;
&lt;p&gt;declare @ObjectName varchar(100)&lt;/p&gt;
&lt;p&gt;declare @oldownerplusobject varchar(50) begin declare Cursor_Object cursor for select [name] from sysobjects where type=@type and xtype=@type open Cursor_Object FETCH NEXT FROM Cursor_Object INTO @ObjectName WHILE @@FETCH_STATUS = 0 begin&lt;/p&gt;
&lt;p&gt;set @oldownerplusobject=@old+'.'+@ObjectName&lt;/p&gt;
&lt;p&gt;EXEC sp_changeobjectowner @oldownerplusobject, @new&lt;/p&gt;
&lt;p&gt;print 'Permission Changed for ' + @oldownerplusobject +' to ' + @new + ' :&lt;/p&gt;
&lt;p&gt;Process Done'&lt;/p&gt;
&lt;p&gt;FETCH NEXT FROM Cursor_Object INTO @ObjectName end close Cursor_Object deallocate Cursor_Object end&lt;/p&gt;
&lt;p&gt;exec J_ChangeObjectOwner 'p','xxx','yyy'&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Also below is the procedure you can first create and then execute &lt;br /&gt;
&lt;/p&gt;
&lt;br /&gt;
if exists (select * from sysobjects where id = object_id(N'[dbo].[chObjOwner]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)&lt;br /&gt;
drop procedure [dbo].[chObjOwner]&lt;br /&gt;
GO&lt;br /&gt;
&lt;br /&gt;
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON &lt;br /&gt;
GO&lt;br /&gt;
&lt;br /&gt;
CREATE proc chObjOwner( @usrName varchar(20), @newUsrName varchar(50))&lt;br /&gt;
as&lt;br /&gt;
-- @usrName is the current user&lt;br /&gt;
-- @newUsrName is the new user&lt;br /&gt;
&lt;br /&gt;
set nocount on&lt;br /&gt;
declare @uid int                   -- UID of the user&lt;br /&gt;
declare @objName varchar(50)       -- Object name owned by user&lt;br /&gt;
declare @currObjName varchar(50)   -- Checks for existing object owned by new user &lt;br /&gt;
declare @outStr varchar(256)       -- SQL command with 'sp_changeobjectowner'&lt;br /&gt;
set @uid = user_id(@usrName)&lt;br /&gt;
&lt;br /&gt;
declare chObjOwnerCur cursor static&lt;br /&gt;
for&lt;br /&gt;
select name from sysobjects where uid = @uid&lt;br /&gt;
&lt;br /&gt;
open chObjOwnerCur&lt;br /&gt;
if @@cursor_rows = 0&lt;br /&gt;
begin&lt;br /&gt;
  print 'Error: No objects owned by ' + @usrName&lt;br /&gt;
  close chObjOwnerCur&lt;br /&gt;
  deallocate chObjOwnerCur&lt;br /&gt;
  return 1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
fetch next from chObjOwnerCur into @objName&lt;br /&gt;
&lt;br /&gt;
while @@fetch_status = 0&lt;br /&gt;
begin&lt;br /&gt;
  set @currObjName = @newUsrName + "." + @objName&lt;br /&gt;
  if (object_id(@currObjName) &amp;gt; 0)&lt;br /&gt;
    print 'WARNING *** ' + @currObjName + ' already exists ***'&lt;br /&gt;
  set @outStr = "sp_changeobjectowner '" + @usrName + "." + @objName + "','" + @newUsrName + "'"&lt;br /&gt;
  print @outStr&lt;br /&gt;
  print 'go'&lt;br /&gt;
  fetch next from chObjOwnerCur into @objName&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
close chObjOwnerCur&lt;br /&gt;
deallocate chObjOwnerCur&lt;br /&gt;
set nocount off&lt;br /&gt;
return 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GO&lt;br /&gt;
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON &lt;br /&gt;
GO&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;then execute&lt;br /&gt;
&lt;/span&gt;&lt;/font&gt;exec chObjOwner 'test','dbo'&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;the result provided can be copy pasted and then executed &lt;/span&gt;&lt;br /&gt;
&lt;font size="2"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=87074"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=87074" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Gaurav/aggbug/87074.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gaurav Taneja</dc:creator>
            <guid>http://geekswithblogs.net/Gaurav/archive/2006/08/04/87074.aspx</guid>
            <pubDate>Fri, 04 Aug 2006 09:30:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Gaurav/comments/87074.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Gaurav/archive/2006/08/04/87074.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Gaurav/comments/commentRss/87074.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Gaurav/services/trackbacks/87074.aspx</trackback:ping>
        </item>
    </channel>
</rss>