How to find out which store procedure making a table?

  • How to find out which store procedure making a table?

    For example, there is a table tOrder which was created by one store procedure.

    I do not remember which sp created it.

    How to code to find it out?

  • you would have to search the definition of the procedures to search for the CREATE TABLE statemenet;

    SQL does not save information about who or what created any objects...just the create or modified date.

    if it's being created by dynamic sql, it's going to be more difficult to trac down, but not impossible.

    select definition from sys.sql_modules

    where definition like '%CREATE%'

    AND definition like '%TABLE%'

    AND definition like '%tOrders%'

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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