Check If Tables are being used in Stored Procedures & How many times !!

Dear All,
I want to make a script which can give me an answer, that If there is any table , then Whether It's using in any stored procedure or not ? If yes, then what the occurrence in procedures - means if table is "ABC" & Its being used in stored procedure
"XYZ" then i want to know that its using 1 time, 2 time or more in particular procedure ..
Pls Help

just in-case if you want to get the Cross DB dependency
i have extent Visakh16 code
please use sql_modules to get the full definition of the DB Objects
you can replace stg_table with your decided table, also use dbname.schemaname.tablename if you want to get  Cross DB dependency
just came up with this from
link
create table #temp (
dbname sysname,
name sysname,
Occurance int
exec sp_MSforeachdb '
use ?
DECLARE @TableName varchar(100)
SET @TableName = ''stg_table''
insert into #temp
SELECT db_name() ,name,(LEN(definition) - LEN(REPLACE(definition,'' '' + @TableName + '' '','''')))/LEN('' '' + @TableName + '' '') AS Occurance
FROM sys.sql_modules m
INNER JOIN sys.objects o
ON o.object_id = m.object_id
AND o.type = ''p''
WHERE m.definition LIKE ''% '' + @TableName + '' %'''
select *
from #temp
where dbname not in ('master','model','msdb','tempdb')
order by 1,2
Thanks
Saravana Kumar C

Similar Messages

  • How to see what Tables are being used in all reports

    Post Author: tmashley
    CA Forum: Crystal Reports
    Hello,
    How can I see what database tables are used in all my online reports? I have around 1000 reports posted to Enterprise over 6 different datasources. If possible I would like to see the fields within those tables that are being used to.
    I am using Crystal Reports XI Release 2
    Any help is appreciated
    Thanks,
    Tom

    I don't think you can see the databases of the reports unless you download the report onto your pc as a Crystal Report format and then open it under Crystal Reports.
    This way it will open the report within Crystal Reports and will show you the datasource it is coming from.
    I doubt if you can see them online.
    Kind Regards
    Jehanzeb

  • How to find which tables are being used by a workbook.

    I was asked by the client to generate a report which will show the Workbook name and it's corresponding tables/views.
    Any idea on how to use the EUL tables for this purpose. I know the SQL query to find the tables in case the workbook was run at least once. But I want to show the Workbook and it's table details even the report was never run.
    Advanced thanks,
    Lokesh.

    Hi Jay
    While we're on the subject of scripts, here's a couple more you might like:
    Script 1:
    =========
    This one shows you how many times an item has been used. It is useful for determining how often users make use of items in a folder. It could be used as research for a materialized view, for dropping items which are not used, or for understanding usage.
    SELECT
    OBJ.OBJ_NAME FOLDER,
    EXP.EXP_NAME ITEM,
    COUNT(QPP.QS_ID) USAGE
    FROM
    EUL5_OBJS OBJ,
    EUL5_QPP_STATS QPP,
    EUL5_EXPRESSIONS EXP
    WHERE
    OBJ.OBJ_NAME = <Folder Name>
    AND OBJ.OBJ_ID = EXP.IT_OBJ_ID
    AND INSTR(QPP.QS_OBJECT_USE_KEY,OBJ.OBJ_ID) > 0
    AND INSTR(EUL5_GET_ITEM_NAME(QPP.QS_ID),EXP.EXP_ID) > 0
    GROUP BY
    OBJ.OBJ_NAME,
    EXP.EXP_NAME;
    Script 2:
    =========
    This one examines the whole EUL and displays a count of the number of times a worksheet has been run by folder. It also shows the date and time of the last run. This one is useful to determine the most and / or least popular worksheets. Adjusting the ORDER BY clause can throw up some interesting results.
    SELECT
    OBJ.OBJ_NAME FOLDER,
    MAX(QPP.QS_CREATED_DATE) LAST_DATE,
    QPP.QS_DOC_OWNER OWNER,
    QPP.QS_DOC_NAME WORKBOOK_NAME,
    QPP.QS_DOC_DETAILS SHEET_NAME,
    COUNT(QPP.QS_ID) USAGE
    FROM
    DRAKE.EUL5_OBJS OBJ,
    DRAKE.EUL5_QPP_STATS QPP
    WHERE
    INSTR(QPP.QS_OBJECT_USE_KEY,OBJ.OBJ_ID) > 0
    GROUP BY
    OBJ.OBJ_NAME,
    QPP.QS_DOC_OWNER,
    QPP.QS_DOC_DETAILS,
    QPP.QS_DOC_NAME
    ORDER BY
    OBJ.OBJ_NAME,
    COUNT(QPP.QS_ID) DESC;
    I'm considering a blog entry of useful EUL scripts. Anyone interested? Yes - either reply here or drop me a line.
    Best wishes
    Michael

  • My macbook pro says that 500 gb are being used by other storage. how do i fix this?

    In my system info it says that 500 GB's are being used up by "other" Information and I have not found out where this information is. Ive looked all over my mac and I haven't been able to find out where this memory went. I desperately need help. Where is my memory! Ive looked this up and tried seeing if it was my Mail app but it wasn't. I really need some help here!

    Hello Masterklaus69,
    Thanks for the question. After reviewing your post, it sounds like there is a lot of data in the Other catagory. I would recommend that you read this article, it may be able to help you resolve or isolate the issue.
    OS X: What is "other" space in About This Mac?
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Which tables are being used to extract the data for the materi Extractors

    Hi
    please advise which tables are used to extract the data for the extarctors
    0MAT_SALES_ATTR,
    0MATERIAL_ATTR,
    0MAT_PLANT_ATTR
    0PLANT_ATTR
    ,Many thanks.

    Hi,
    Activate a database trace using ST01. Then perform the MM03 operation and goto the SD Texts tab. Now stop the trace and see if you can locate either a table or program which you can utilize in the log.
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/55f993545a11d1a7020000e829fd11/frameset.htm
    Hope this helps..
    Rgs,
    Ravikanth.

  • Unwanted signals going through RS-232 port when Analog I/O channels are being used. Why and how to solve the problem?

    My application involves operating a pH meter via RS-232 protocol. Other hardware are operated using an E-series DAQ board whereby waveforms are software-generated and sent to the relevant hardware using an Analog Output channel. Data acquisition is performed utilising Analog Input channels of the DAQ card that have been configured in a Referenced Single-Ended mode. When the Analog I/O channels are active erroneous readings are observed on the pH meter if the RS-232 cable is connected between the pH meter and the control PC. No problem is observed if the RS-232 cable is disconnected. What could be the problem and any suggestions on how to solve this.

    Comments to your questions:
    Built-in = Originally supplied on the PC's motherboard
    1)I use built-in RS-232 interface
    2)I use built-in Bus type
    3)The RS-232 cable is shield connected
    4) I'm not sure on how to check if the RS-232's digital ground signal is connected. I simply connected the RS-232 cable from the pH meter to the serial port. The serial communication works fine, with no disturbance to the pH meter if i don't initiate data acquisition.

  • Using SQL stored procedures How to get the list of .rar files from e:\Tempbackup directories from the different remote desktop windows server and delete the .rar files which contains the current month and date

    Concept:
    Every month i need to find the list of .rar files from the
    E:/TempBackup directory from the different environments (remote desktop servers) and i need to delete the current month
    .rar files alone from the respective (E:/TempBackup) directory. below is example files structure inside the
    E:/TempBackup.
    example:
    zDROP_2014_08_31_Backups.rar
    zDROP_2014_09_31_Backups.rar
    zDROP_2014_10_31_Backups.rar
    from the above list i need to delete the zDROP_2014_08_31_Backups.rar(current month) file alone and also logs should be capture for this deletion.
    key words for this are zDROP and Current month and date.
    i need a stored procedure for this concept. could you please help on this.

    Hello,
    You can schedule an operating system task (Control Panel -> Schedule task) to either call a batch file or a PowerShell script.
    Please read the following resources for examples:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/61373719-fffb-4d94-bdbe-7d8ed8620b44/delete-filesfolders-on-remote-servers-using-powershell?forum=winserverpowershell
    http://www.networknet.nl/apps/wp/archives/943
    http://jeffwouters.nl/index.php/2011/10/powershell-script-to-delete-files-older-that-a-week/
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How to know a transaction code is used for how many times?

    Hello,
    I have a requirement that is somewhat unusual for me. We have some Z reports and we want to know the worthiness of these reports if they are being used or not, if they are being used, by whom and how many times are being used.
    Your help is greatly appreciated.
    Hakan

    Hi
    As said you can have an discussion with your BASIS they can help just try in
    tode =STAD    or   program name= RSSTAT26
    SM20 you can get all the details like
    user name
    termial number
    tcode
    programme etc
    regards

  • Which Enteprise Edition features are being used ?

    Hello,
    Due to licensing requirements I have been asked to check if a database is using any enterprise edition features so that we can downgrade our binaries to Standard Edition.
    I know that I can query
    DBA_FEATURE_USAGE_STATISTICS
    to find out what features are being used , my question is how would I know if a feature that is being used in part of Enterprise Edition ?*
    Thanks,
    C.

    my question is how would I know if a feature that is being used in part of Enterprise Edition ?As far as I knows, there is no such view/sql/dbms which specifically differentiate the uses of features based upon as a part of that specific edition. If you are using X edition, then the query output of DBA_FEATURE_USAGE_STATISTICS and DBA_HIGH_WATER_MARK_STATISTICS will be based upon the edition. Suppose ABC feature exists in enterprise edition and DBA_FEATURE_USAGE_STATISTICS is saying that ABC feature has been used, so it means that ABC feature has been used as a part of enterprise edition. If there is no ABC feature in installed edition, you will never find the uses of ABC feature in that edition. So very simple is any feature has been reported by DBA_FEATURE_USAGE_STATISTICS view; it means that feature has been used in part of said edition.
    Couple of Good scripts at : http://kerryosborne.oracle-guy.com/2008/10/oracle-management-packs/
    Regards
    Girish Sharma

  • How do I check how many licenses are being used on my order?

    How do I check how many licenses are being used on my order?  I have a Volume License, and I need to know how many licenses are left so I can install on more workstations.

    Adobe Licensing Website | Serial numbers | Orders | Accounts

  • Find out particular printers that are being used by background jobs.

    Find out particular printers that are being used by background jobs..
    Hi Gurus,
    I have to remove some printers from SPAD, but before removing those printers I have to make sure that those are not being used by any background jobs.   The table TBTCP can be used to identify which jobs are still using those printers, but this is a tedious process. 
    Any input would be highly appreciated.
    Thank you
    Adil

    Hi Adil,
    I'm lazy so I'd just run this SQL
    select distinct(jobname), pdest from SAPSR3.TBTCP where PDEST in ('LP01', 'LOCL') ;
    Just put the printers you want as shown above and just perform a little manual cross check by checking the job in SM37.
    And that's it .....
    Cheers,
    Amerjit

  • Can you see which timeline clips are being used in Media Browser?

    I'm a relatively new user and may not be familiar enough with cs5.5 but
    is there a way to see what clips are being used on the editing timeline in the media browser.
    I open premiere pro - Project is loaded. I edit the scene until it is finished.
    When I look over at the media browser, all my raw clips (some of which I'm
    using on the editing timeline) look the same - I can't tell which ones I using on the timeline.
    The reason I ask - when I fiinish editing a scene it would be nice to glance over at the
    media brower folder where my raw clips are located - easily see which ones I'm using because they
    are highlighted or checked and then delete the ones I no longer need.
    Is there a way to do this now?
    Thanks
    Jeff

    I dont think so  but a better way is to look in the top of the Project Window and there is a drop down that will show you all the useage instances of the clip.  You can click on them to go to them in the timeline.

  • How to find out which queries are being used ?

    We have a number of InfoSet Queries which the users are calling from SQ00. Some of them are very old.
    I would like to find out which queries are being used, so we can have the idle queries decommissioned.
    How can this be done ?
    Best regards,
    Peter

    Hi,
    It's been a while since I've done this but one method is to use ST03N & look for the execution of programs with an AQ* prefix.  The general structure is AQZZ/<query user group><query name>.
    You could probably get the same info from the audit log but I've not checked that.
    Cheers,

  • Is there a way to find out which CSS rules are being used by the different html files?

    Is there a way in Dreamweaver CS3 to find out which CSS rules are being used by the different html files, sitewide?
    Thanks - Dave

    Firefox add-on "Web Developer Toolbar" is a must have.  Information > Display Div & Class details.
    https://addons.mozilla.org/en-US/firefox/addon/60
    Another  handy Firefox Add-on  to add to your tool chest is called "Dust-Me Selectors."
    http://www.sitepoint.com/dustmeselectors/
    "It extracts all the selectors from all the stylesheets on the page you're viewing, then analyzes that page to see which of those selectors are not used. The data is then stored so that when testing subsequent pages, selectors can be crossed off the list as they're encountered.
    You can test pages individually, or spider an entire site, and you'll end up with a profile of which selectors are not used anywhere."
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How do I find what jars are being used...?

    Hi all,
    I'm wondering if any of you could help me. I am looking for a method or tool that helps to find what library jars are being used within an application to try and help me erradicate unneccesary files since I find myself in a scenario similar to below. . .
    Obviously over time an application grows and you may being in a lot of libraries to provide functionality as you go. You may then find a better way of doing something or that part of code may be redundant, so the referencing class is removed, BUT the jar isn't removed from the application at the same time.
    Several years down the line your lib directory looks like it contains nearly every jar created sits in there, and you application is now being shipped out on DVD to cope with all the libraries!
    So, is there a tool or way (except removing them to see it anything breaks!) to check what jars are actually being referenced within an application?
    Any help would be appreciated,
    Cheers,

    Start java with the -verbose option and grep the output for lines starting with "[Opened". This will give you a list of all opened jar files.
    Bear in mind, that classes are loaded lazy, that is: only when they are referenced for the first time.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Database upgrade in a Dataguard Configuration - Help !

    Hello Everyone, I am upgrading our test Oracle 11G RAC/Dataguard Configuration from 11.1.0.6 to patchset 11.1.0.7 and have run into an issue when trying to apply the patchset to one of our standby databases. I have upgraded our primary database to 11

  • Upgrading From The Free Trial The Cheaper Way!!

    Hi, I've currently have Aperture 3 running well within the 30 day trial period. I've imported 9000 plus photo's from my iPhoto library and busy moving them into nice folders, and organising them in a better way that iPhoto could do. I like Aperture a

  • Is there a solution for the limited time of videorecording?

    Is there a solution for the limited time of videorecording? By recording on my iPad2 there is a maximum time of 49 minutes and 51 seconds.

  • Pxe boot sun x4170-m2 LSI raid 5 disks issues 2.10_u9 rel

    Hi Gurus, I am trying to image sun fire x4170-m2 series servers with Latest solaris 10.u9 patch set using Raid-5 disks setup with one hot-spare. Pxe boot works but i minboot not able to find raid-5 disks which is about 1.2 TB disks size. Where as if

  • How do I copy a layer but have the blending mode reset to normal?

    I'm going to try and word this as best as I possibly can lol. I edited a layer with a blending mode and want to copy the layer but have the layer's blending mode go back to normal so that I can edit it again with a different blending mode. Does anyon