CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Darrell Norton's Blog [MVP]

Fill in description here...

SQL Server

  • Richmond Code Camp 3

    I have to blog more often. Smile

    Richmond Code Camp 3

    When:  Saturday, April 28  8:30 AM to 6:00 PM
    Where: ECPI Innsbrook Campus (map)
    Cost:    FREE!  Lunch provided!

    What:   Code Camp is by developers, and for developers...it's an idea that started in the Eastern U.S. and has taken hold throughout various development communities in the U.S., and around the world. For more information on Code Camp and its origins, please visit the Code Camp Manifesto.

    The general goal of Code Camps is to provide an intensive developer-to-developer learning experience that is fun and technically stimulating. Code Camp is created and run by and for the local community. This is your event. The primary focus is on delivering programming information and sample code that can be used immediately. The event and all slides, CD’s and demo code are provided free to all attendees.

    Visit the web site for more info:  RichmondCodeCamp.org
     

    RCC3 Logo
     

  • Webcasts from TechEd 2005

  • red-gate releases Best of SQL Server Central vol 2

    red-gate has just made The Best of SQL Server Central Vol 2 available for download on their website.

    Posted Apr 29 2005, 01:31 PM by darrell with no comments
    Filed under:
  • Change all database object owners to DBO - now runs changeOwner for you

    This SQL Server script comes to you courtesy of Geoff Appleby!

    Change All Object Owners to a given account (usually dbo) if not already owned by the SA (change the @NewOwner variable to another username string if you don't want DBO to own everything):

     1 declare @ObjectName varchar(256)
     2 -- we are only interested in USER Objects
     3 -- not already owned by 'sa'
     4 -- we don't want keys and constrainst
     5 set @ObjectName = (
     6   select top 1 [name] from sysobjects
     7   where uid <> SUSER_SID('sa')
     8   and [type] in ('FN','IF','P','TF','U','V')
     9   )
    10 declare @ObjectOwner varchar(256)
    11 declare @ObjectFullName varchar(512)
    12 declare @NewOwner varchar(256)
    13   set @NewOwner = 'dbo'
    14  
    15   -- default to 'dbo' if null
    16   set @NewOwner = isnull(@NewOwner, 'dbo')
    17  
    18 while @ObjectName is not null
    19 begin
    20   select @ObjectOwner = USER_NAME(uid) 
    21     from sysobjects where [name] = @ObjectName
    22   set @ObjectFullName = @ObjectOwner + '.' + @Objectname
    23   PRINT 'Changing ownership of ''' + @Objectname + 
    24     ''' from ''' + @ObjectOwner + ''' to ''' + 
    25     @NewOwner + ''''
    26   execute sp_changeobjectowner @ObjectFullName, @NewOwner
    27   set @ObjectName = (select top 1 [name] from sysobjects
    28     where uid <> SUSER_SID('sa') 
    29     and [type] in ('FN','IF','P','TF','U','V'))
    30 end
    
    Update: Fixed formatting.
  • Preventing connection timeouts in SQL Server Enterprise Manager

    Sometimes in SQL Server Enterprise Manager, when I right-click on a SQL Server to “start” it, I get this error message:

    A connection could not be established to (local).

    Reason: Timeout expired.

    Please verify SQL Server is running and check your SQL Server registration properties (by right-clicking on the (local) node) and try again.

    But after I click “Ok”, the SQL Server actually is started even though the error message says it’s not.

    The solution is simple.  In SQL Server Enterprise Manager, click the Tools menu and select Options..  In the “SQL Server Enterprise Manager Properties” window that shows up, click the Advanced tab.  Change the “Login time-out (seconds):” default from 4 to 8.  Then click OK.

    SQL Server Enterprise Manager Properties window with timeout set

More Posts

Our Sponsors