If you take a bunch of code from sp_help and kinda move it around and rearrange it, you can produce a pretty good little object dependency report. Just take this code, plop it right into query analyzer, select the database and hit F5. Viola, dependency report. Looks better if you hit CTRL-T first so you get it in text format and not columns. Some portions, such as line the ‘query’ column manipulation in the first select statement, should be a UDF, but then I’d have to provide code for both and this is just easier. Sorry about not coloring it in HTML. Also, this is not optimized for speed so don’t expect it to run to quickly. You would have to replace the temp tables with normal tables, run the query to build the tables (against a small database), then hit CTRL-L to get the execution plan and look at where you will want to create your stats and build your indexes. Guage it against the master database, which running this against the master database takes 31 seconds on the machine I have Sql installed on. I tested it against a single proc P4 1.8 with 256 RAM.
Nice rearrenging of code. Really help when we modify a particular object in sql server, now we can know what will require changes , instead of getting bugs after we have made changes. Wonderful work done. Thanks Buddy…
I’m not having that problem, it comes out fine in query analyzer to me. If anybody wants the file, just let me know by posting a comment here with your email address and I’ll send you the .sql file with this code.
When I copy and paste the code, it all comes out on one line. This happens whether I go straight into QueryAnalyzer or Notepad. This is a nice piece of code, I’m going through it to get it running… Just thought I’d let you know.
I have not inspected the output yet, but so far it seems very impresive!
Awesome!!!!! Great, fantastic !!!!!!!
Hi Raymond,
Fantastic piece of work man. Saves me a lot of money compared to buying a third party tool (being a small freelance developer).
Would you mind if I use this code for private and non-commercial use with my own little modifications?
Cheers,
Nirav
Nice rearrenging of code. Really help when we modify a particular object in sql server, now we can know what will require changes , instead of getting bugs after we have made changes. Wonderful work done. Thanks Buddy…
test
test
Copy to Word first, then to your SQL editor. Preserves line-breaks.
That is odd. That is something that w.bloggar does automatically I think, even though I put <pre> around the code.
I’m not certain why this is happening, but I changed your code’s html <br> tags to <p> tags and now it copies fine.
I’m not having that problem, it comes out fine in query analyzer to me. If anybody wants the file, just let me know by posting a comment here with your email address and I’ll send you the .sql file with this code.
When I copy and paste the code, it all comes out on one line. This happens whether I go straight into QueryAnalyzer or Notepad. This is a nice piece of code, I’m going through it to get it running… Just thought I’d let you know.
-Steve