September 7, 2012 at 1:56 pm
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?
September 7, 2012 at 2:00 pm
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
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply