Create a "Global" function

  • Hi folks!

    Can I create a global function where is possible I call it by any database? Like the system functions?

    Since now,

    Thanks

    Rafael Melo - Br

  • What I do for that kind of thing is create a database called "Common", and then call the function with "Common.dbo.MyFunction()" from anywhere on the server.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared,

    I was thinking about creating this function into the master database... What's your opion about it? Is that a good practice or I can run into some troubles??

    Anyway, thanks for your your reply...

    Regards,

    Rafael Melo -Br

  • I don't like to mess with the master database if I can avoid it.

    Creating user objects in there creates a liability with regards to backup and recovery planning.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared,

    I thanks you a lot for your advise... You solve my doubt.

    Rafael Melo - Brazil

  • You're welcome.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

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

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