<?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/'><id>tag:blogger.com,1999:blog-11467244.post8036482499069017932..comments</id><updated>2011-09-06T09:20:06.494-04:00</updated><category term='Compiler'/><category term='Visual Studio'/><category term='Performance'/><category term='DNS'/><category term='SQL'/><category term='icons'/><category term='TVUG'/><category term='Amazon'/><category term='Annoyances'/><category term='Windows Server 2008'/><category term='Wix'/><category term='ASP.NET'/><category term='Testing'/><category term='Logitech'/><category term='Delphi'/><category term='Beta'/><category term='family'/><category term='Networking'/><category term='Debugging'/><category term='Foxmarks'/><category term='mcafee'/><category term='workplace'/><category term='FinalBuilder'/><category term='MS Office'/><category term='64 bit'/><category term='Biuld Box'/><category term='IPv6'/><category term='Windows Home Server'/><category term='Plugin'/><category term='VMWare'/><category term='jQuery'/><category term='Toys'/><category term='Web Services'/><category term='Photography'/><category term='FreeNAS'/><category term='Microsoft Security Essentials'/><category term='Windows Server'/><category term='Firefox'/><category term='FiOS'/><category term='Coding Standards'/><category term='Ad Blocking'/><category term='Windows Installer'/><category term='Digital Rights'/><category term='GPS'/><category term='Bluetooth'/><category term='Internet Explorer'/><category term='Windows Server 2003'/><category term='ESX Server'/><category term='virtualization'/><category term='Printing'/><category term='Vista'/><category term='Twitter'/><category term='Backups'/><category term='support'/><category term='OAuth'/><category term='Time Warner Cable'/><category term='XP'/><category term='SQL Server'/><category term='Windows Update'/><category term='Windows Live Writer'/><category term='Remote Desktop'/><category term='Security'/><category term='IDE'/><category term='Stochos'/><category term='Joss Whedon'/><category term='TiVo'/><category term='PowerShell'/><category term='Chrome'/><category term='SmugMug'/><category term='GAC'/><category term='Tablet PC'/><category term='IPv4'/><category term='Neil Patrick Harris'/><category term='Dr. Horrible'/><category term='InstallAware'/><category term='TiVo advertising subtitles'/><category term='DD-WRT'/><category term='Daryl Hall'/><category term='Windows 7'/><category term='ListView'/><category term='wcf'/><category term='Music'/><category term='SharePoint'/><category term='multithreading'/><category term='Gadgets'/><category term='RegEx'/><category term='YouTube'/><category term='Google'/><category term='Blogging'/><category term='C#'/><category term='WinPatrol'/><category term='XAuth'/><category term='TweeVo'/><category term='Install'/><category term='Active Directory'/><category term='virus'/><category term='Hardware'/><category term='IE'/><category term='WPF'/><category term='Silverlight'/><title type='text'>Comments on Christopher Miller's random thoughts: How to rename database objects to comply with nami...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://anotherlab.rajapet.net/feeds/8036482499069017932/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default'/><link rel='alternate' type='text/html' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html'/><author><name>Chris Miller</name><uri>http://www.blogger.com/profile/07265018778273203357</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp1.blogger.com/_natoSxTaPFU/R847xr53Q1I/AAAAAAAAADk/b2Yc20nEwOA/S220/ChrisBeach.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-11467244.post-2740618368649185086</id><published>2011-07-15T18:43:12.743-04:00</published><updated>2011-07-15T18:43:12.743-04:00</updated><title type='text'>Those two while loops are different, though.  @@FE...</title><content type='html'>Those two while loops are different, though.  @@FETCH_STATUS is undefined if you haven&amp;#39;t called fetch yet, so SQL Server could rightfully return any value and your loop wouldn&amp;#39;t execute.  Also, if you wrote two consecutive loops the second wouldn&amp;#39;t execute because @@FETCH_STATUS &amp;lt;&amp;gt; 0 after the first finishes executing.&lt;br /&gt;&lt;br /&gt;&amp;quot;while 1 = 1&amp;quot; is uglier than a &amp;quot;while (true)&amp;quot; in other languages, but this little bit of boilerplate simplifies maintenance if you ever need to change the fetch statement.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/2740618368649185086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/2740618368649185086'/><link rel='alternate' type='text/html' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html?showComment=1310769792743#c2740618368649185086' title=''/><author><name>Cody Jones</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html' ref='tag:blogger.com,1999:blog-11467244.post-8036482499069017932' source='http://www.blogger.com/feeds/11467244/posts/default/8036482499069017932' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-326946677'/></entry><entry><id>tag:blogger.com,1999:blog-11467244.post-1677097400773389109</id><published>2008-07-08T10:33:00.000-04:00</published><updated>2008-07-08T10:33:00.000-04:00</updated><title type='text'>I concur with the last "anonymous".  Writing a whi...</title><content type='html'>I concur with the last "anonymous".  Writing a while/end loop using the syntax "while (1=1)" gains nothing in performance and makes the code harder to read.&lt;BR/&gt;&lt;BR/&gt;You have gone from a single possible test to exit the loop to two, which increases the complexity of the code without any measurable benefit.  The fetch next statement is still being performed for the same number of rows either way.&lt;BR/&gt;&lt;BR/&gt;At the end of the day, you go with the code that you and your team can read 6 months from now and still understand.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/1677097400773389109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/1677097400773389109'/><link rel='alternate' type='text/html' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html?showComment=1215527580000#c1677097400773389109' title=''/><author><name>Chris Miller</name><uri>http://www.blogger.com/profile/07265018778273203357</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp1.blogger.com/_natoSxTaPFU/R847xr53Q1I/AAAAAAAAADk/b2Yc20nEwOA/S220/ChrisBeach.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html' ref='tag:blogger.com,1999:blog-11467244.post-8036482499069017932' source='http://www.blogger.com/feeds/11467244/posts/default/8036482499069017932' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-664488260'/></entry><entry><id>tag:blogger.com,1999:blog-11467244.post-3017337884662989589</id><published>2008-07-08T09:59:00.000-04:00</published><updated>2008-07-08T09:59:00.000-04:00</updated><title type='text'>When did SQL developers suddenly begin to think th...</title><content type='html'>When did SQL developers suddenly begin to think that this WHILE loop:&lt;BR/&gt;WHILE (1=1)&lt;BR/&gt;BEGIN&lt;BR/&gt;FETCH NEXT FROM FixCursor&lt;BR/&gt;INTO @OldName, @NewName&lt;BR/&gt;IF (@@FETCH_STATUS &lt;&gt; 0) BREAK&lt;BR/&gt;&lt;BR/&gt;is any different than this one:&lt;BR/&gt;WHILE @@FETCH_STATUS = 0&lt;BR/&gt;BEGIN&lt;BR/&gt;FETCH NEXT FROM FixCursor&lt;BR/&gt;INTO @OldName, @NewName&lt;BR/&gt;...&lt;BR/&gt;END&lt;BR/&gt;&lt;BR/&gt;Someone somewhere along the line thought that it performed better and wasn't a real cursor.  Hogwash, it's still a cursor and still loops each record.  It's also harder to follow.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/3017337884662989589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/3017337884662989589'/><link rel='alternate' type='text/html' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html?showComment=1215525540000#c3017337884662989589' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html' ref='tag:blogger.com,1999:blog-11467244.post-8036482499069017932' source='http://www.blogger.com/feeds/11467244/posts/default/8036482499069017932' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-574317462'/></entry><entry><id>tag:blogger.com,1999:blog-11467244.post-1686611513561366855</id><published>2008-07-08T08:04:00.000-04:00</published><updated>2008-07-08T08:04:00.000-04:00</updated><title type='text'>If you use the following code, you can also select...</title><content type='html'>If you use the following code, you can also select tablenames, indexnames and so on to be renamed into @FixTable.&lt;BR/&gt;&lt;BR/&gt;DECLARE @FixTable TABLE&lt;BR/&gt;(&lt;BR/&gt;    sys_OldName [sysname] NOT NULL,     &lt;BR/&gt;    sys_NewName [sysname] NOT NULL &lt;BR/&gt;)&lt;BR/&gt;INSERT INTO @FixTable (sys_OldName, sys_NewName)&lt;BR/&gt;SELECT o.name AS OldName, (N'DF_' + Object_Name(o.parent_obj) + N'_' + c.Name) AS NewName&lt;BR/&gt;FROM sysobjects o&lt;BR/&gt;JOIN syscolumns c ON o.parent_obj = c.id AND c.cdefault = o.id&lt;BR/&gt;WHERE o.type = 'D' AND &lt;BR/&gt;      o.name &lt;&gt; (N'DF_' + Object_Name(o.parent_obj) + N'_' + c.Name)&lt;BR/&gt;&lt;BR/&gt;DECLARE @OldName NVARCHAR (1024)&lt;BR/&gt;DECLARE @NewName NVARCHAR (1024)&lt;BR/&gt;DECLARE FixCursor CURSOR LOCAL FOR&lt;BR/&gt;SELECT sys_OldName, sys_NewName&lt;BR/&gt;FROM @FixTable&lt;BR/&gt;&lt;BR/&gt;OPEN FixCursor&lt;BR/&gt;WHILE (1=1)&lt;BR/&gt;BEGIN&lt;BR/&gt;    FETCH NEXT FROM FixCursor&lt;BR/&gt;    INTO @OldName, @NewName&lt;BR/&gt;    IF (@@FETCH_STATUS &lt;&gt; 0) BREAK&lt;BR/&gt;&lt;BR/&gt;    SET @OldName = N'[' + @OldName + N']'&lt;BR/&gt;    EXECUTE sp_rename @objname = @OldName, &lt;BR/&gt;                      @newname = @NewName, &lt;BR/&gt;                      @objtype = N'OBJECT'&lt;BR/&gt;END&lt;BR/&gt;CLOSE FixCursor&lt;BR/&gt;DEALLOCATE FixCursor</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/1686611513561366855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/1686611513561366855'/><link rel='alternate' type='text/html' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html?showComment=1215518640000#c1686611513561366855' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html' ref='tag:blogger.com,1999:blog-11467244.post-8036482499069017932' source='http://www.blogger.com/feeds/11467244/posts/default/8036482499069017932' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2034389121'/></entry><entry><id>tag:blogger.com,1999:blog-11467244.post-2035827621978920084</id><published>2008-07-08T07:08:00.000-04:00</published><updated>2008-07-08T07:08:00.000-04:00</updated><title type='text'>You use two FETCH NEXT statements wich are exactly...</title><content type='html'>You use two FETCH NEXT statements wich are exactly the same. By writing the loop a little different, only one FETCH NEXT is necessary:&lt;BR/&gt;&lt;BR/&gt;WHILE (1=1)&lt;BR/&gt;BEGIN&lt;BR/&gt;    FETCH NEXT&lt;BR/&gt;    FROM AddDrop&lt;BR/&gt;    INTO @OldName, @NewName&lt;BR/&gt;    IF (@@FETCH_STATUS &lt;&gt; 0) BREAK&lt;BR/&gt;&lt;BR/&gt;    ...&lt;BR/&gt;END</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/2035827621978920084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/2035827621978920084'/><link rel='alternate' type='text/html' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html?showComment=1215515280000#c2035827621978920084' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html' ref='tag:blogger.com,1999:blog-11467244.post-8036482499069017932' source='http://www.blogger.com/feeds/11467244/posts/default/8036482499069017932' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-327385166'/></entry><entry><id>tag:blogger.com,1999:blog-11467244.post-7975086056364900520</id><published>2008-06-24T18:10:00.000-04:00</published><updated>2008-06-24T18:10:00.000-04:00</updated><title type='text'>Excellent script!!!&lt;br&gt;&lt;br&gt;Thanks mate - you've sa...</title><content type='html'>Excellent script!!!&lt;BR/&gt;&lt;BR/&gt;Thanks mate - you've saved me the hassle of reinventing the wheel</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/7975086056364900520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/7975086056364900520'/><link rel='alternate' type='text/html' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html?showComment=1214345400000#c7975086056364900520' title=''/><author><name>Bushy</name><uri>http://www.blogger.com/profile/08147473791322752304</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html' ref='tag:blogger.com,1999:blog-11467244.post-8036482499069017932' source='http://www.blogger.com/feeds/11467244/posts/default/8036482499069017932' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1815847356'/></entry><entry><id>tag:blogger.com,1999:blog-11467244.post-6133453140475416267</id><published>2008-06-11T13:06:00.000-04:00</published><updated>2008-06-11T13:06:00.000-04:00</updated><title type='text'>By the way, I personally have trouble reading code...</title><content type='html'>By the way, I personally have trouble reading code that has gratuitous table aliases. &lt;BR/&gt;&lt;BR/&gt;Isn't the following much easier for a human to read and understand, than the original?&lt;BR/&gt;&lt;BR/&gt;INSERT INTO  @FixSchema(sys_OldName, sys_NewName)&lt;BR/&gt;select sysobjects.name AS OldName, 'DF_' + Object_Name(sysobjects.parent_obj) + '_' + syscolumns.Name AS NewName,&lt;BR/&gt;sysobjects.type&lt;BR/&gt;FROM sysobjects &lt;BR/&gt;JOIN syscolumns ON sysobjects.parent_obj = syscolumns.id AND syscolumns.cdefault = sysobjects.id&lt;BR/&gt;WHERE sysobjects.type = 'D'</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/6133453140475416267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/6133453140475416267'/><link rel='alternate' type='text/html' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html?showComment=1213203960000#c6133453140475416267' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html' ref='tag:blogger.com,1999:blog-11467244.post-8036482499069017932' source='http://www.blogger.com/feeds/11467244/posts/default/8036482499069017932' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1085364782'/></entry><entry><id>tag:blogger.com,1999:blog-11467244.post-7569247929866817760</id><published>2008-05-08T15:44:00.000-04:00</published><updated>2008-05-08T15:44:00.000-04:00</updated><title type='text'>Great tool!  I had to update it slightly to includ...</title><content type='html'>Great tool!  I had to update it slightly to include the schema name since MY default schema is not the same as the default schema for the part of the database that I wanted to run this on.&lt;BR/&gt;&lt;BR/&gt;But it was great otherwise.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/7569247929866817760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11467244/8036482499069017932/comments/default/7569247929866817760'/><link rel='alternate' type='text/html' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html?showComment=1210275840000#c7569247929866817760' title=''/><author><name>DWalker</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://anotherlab.rajapet.net/2008/05/how-to-rename-database-objects-to.html' ref='tag:blogger.com,1999:blog-11467244.post-8036482499069017932' source='http://www.blogger.com/feeds/11467244/posts/default/8036482499069017932' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1180707662'/></entry></feed>
