views:

80

answers:

1

OK I'm not sure if this is valid, however I have a bug bear with SQL Server, and that is that I cannot organise objects in to a group of objects.

Imagine I'm working on a new section of work in a large database and I perhaps have 15 objects that I will be regularly using. What I want to do is sort of "Favourite" them in to a folder so that I don't have to trawl through all objects in my databases.

I know I could organise objects by schema, however these objects aren't necessarily schema specific, they cross boundaries.

Has anyone come across a method for organising objects in to a favourites group? I know SQL Server Projects organise scripts, but I can't see that they can organises tables?

Thanks

Ed

+2  A: 

You can't do that with the native tools (SQL Server Management Studio) but there's a workaround: create a new empty database with those 15 tables - just the schema, not the data. Then when you're writing T-SQL code, you can quickly drag and drop elements out of those tables into your code.

The downside is that changes made in the real database won't be reflected in your working database, but you can automate that with a script to pull out the objects you need and recreate them in your working database. You can run that as often as you like (like every X hours, or as a SQL Agent job that runs when your local dev server starts up) without losing data, since you won't be modifying the structure in your "favorites" database.

Brent Ozar
Thanks for that, it's a solution, however is it just me that sees this as a big whole in the functionality of SSMS? I mean its a hell a lot of effort to go to in order to group objects together. Thanks
MrEdmundo
It's not just you, but SSMS isn't really designed for hard-core database development. If you develop against databases full time, you'll want to check out development environments like Visual Studio for Database Developers or Quest Toad for SQL Server, which do what you're asking plus much more.
Brent Ozar