Can I create a second filestream container on an existing SQL Server 2008 database without going offline?

Where is a script to list all tables/columns in a SQL Server 2008 R2 database that are not referenced in any stored procedure?

  • We have hundreds of report stored procedures that we are wanting to create a reporting only database and drop all columns that are not used by any of the stored procedures.

  • Answer:

    There is no easy way to do this that I'm aware of for columns. You can pretty easily determine the tables that are needed as dependencies. Microsoft has scripts that do this: http://msdn.microsoft.com/en-us/library/ms345404.aspx

Grant Fritchey at Quora Visit the source

Was this solution helpful to you?

Other answers

By identifying the tables/columns used you can then get an unmatched result. For tables: SELECT Name FROM sys.procedures WHERE OBJECT_DEFINITION(OBJECT_ID) = [YourTableName] For columns it looks like Pinal Dave has a solution: http://blog.sqlauthority.com/2012/07/15/sql-server-find-column-used-in-stored-procedure-search-stored-procedure-for-column-name/

Preston Mesarvey

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.