4 part naming convention - making it portable

  • Hello

    Anyone got any experience of moving objects from dev pc's to test, on to acceptance testing and through to live that uses 4 part naming syntax?

    That is, the developers write stored procs that reference

    server.database.owner.tableName, but the server changes in each environment.

    Will I have to do a multiple search & replace? Or is there a better way?

    Dave


    http://glossopian.co.uk/
    "I don't know what I don't know."

  • If the name changes then it is a search and replace. You might go thru on your first build and create template tags for variable replacement to make this simpler.

  • I always add the linked server using an alias e.g "HEADOFFICE". Your 4 part query can use HEADOFFICE.databasename.dbo.tablename.

    You can then map the alias to the real server using sp_setnetname, which can obviously be different in development and production.

  • That sounds ideal.  Thanks for the suggestion.  I'll try it out as soon as I can

    thanks again

    Dave


    http://glossopian.co.uk/
    "I don't know what I don't know."

  • FYI -

    We use DNS CNAMEs in order to avoid hardcoding server names.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply