Finding SQL Scripts that populate table

Anna 40 Reputation points
2023-04-28T18:52:31.8566667+00:00

I've inherited tables and am being asked what parameters are being used in populating the tables. I've found the script that creates the table, but where do I look to find the procedure(s) that are run when the tables are "automatically" updated?

Example: Table contains aggregated data. I need to know if the table includes all instances of a unique identifier with different issue dates or if it just includes data with the most recent issue date.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,827 questions
{count} votes

Accepted answer
  1. Erland Sommarskog 111.6K Reputation points MVP
    2023-04-28T20:16:03.5466667+00:00

    That is not an entirely simple question to answer, since there are so many possibilities. It could be stored procedures, it could be ad-hoc statements from the client.

    I have an article on my web site Where Is that Table Used? which discusses various approaches. You may to apply more than one of them.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. PercyTang-MSFT 12,501 Reputation points Microsoft Vendor
    2023-05-01T02:22:41.61+00:00

    Hi @Anna Adams

    Although you gave an example, that is only a general description. You can refer to Erland's article to see if it solves your problem.

    If you need us to help you design the script, you need to provide more detailed information.

    Best regards,

    Percy Tang

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.