String Manipulation

  • In our database we have more than 2500 StoredProcedures. Name of the SP is having some conventions like versions appending to it.

    (e.g) pcarlist_260000

    pbuslist_221000

    p_vehiclelist_280000. n etc(Without versions too)

    Now i want to see all the versions available in my database....

    (i.e) How to separate the versions from each name?

  • To select all SP's with a specific versionnumber:

    select * from sys.objects where type = 'P' AND name LIKE '%_268000'

    To see all used versions (including how many SP's are available in that version):

    select

    count (object_ID) as NumberOfSP

    , right(name, 7) as VersionNumber

    from sys.objects

    where type = 'P'

    group by right(name, 7)

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **

Viewing 2 posts - 1 through 1 (of 1 total)

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