Group SQL tables in SQL Server Management Studio object explorer - sql

I have a table which has approximately sixty tables, and other tables are added constantly. Each table is a part of a schema.
A such quantity of tables makes it difficult to use Microsoft SQL Server Management Studio 2008. For example, I must scroll up in object explorer to access database related functions, or scroll down each time I need to access Views or Security features.
Is it possible to group several tables to be able to expand or collapse them in Object Explorer? Maybe a folder may be displayed for each schema, letting collapse the folders I don't need to use?

In SQL Server 2008, you can apply filters to your object explorer views.
Find the Filter button and click on it
Define your filter - filtering by object name and/or schema is possible
Filtered view of your objects:

Related

How to view and change data of a .mdf file using MS Access?

Background: I have an .mdf database containing some numeric values that I need to change (specifically, scale and offset values for sensors). The database was created by a Visual Basic program that controls some lab equipment and stores pertinent data in the .mdf file. Please excuse my rudimentary knowledge of the topic; I'm a complete novice when it comes to SQL Server and VB.
After searching through many posts, I understand that to open the .mdf file, you must "attach" it in Microsoft Server Management Studio (I'm using that with SQL Server 2005), which I have successfully done.
Problem: It seems that this only allows me to view and modify the structure of the database, ie. tables, columns, data types etc., rather than the values of the database itself.
Is there a way to do this manually, like how you can edit the field data of .mdb files in MS Access? Again, sorry for my limited knowledge on the topic. I'll gladly provide extra details where needed.
You mention you want to use access. That can be done. Your database is up and running after attaching it.
In Access you can simply create an ODBC connection in access and use Access to edit/modify your data as much as you want. you can also create queries.
It is in the menu item "external data" [I'm guessing because I use a dutch version]. You select to create a "linked table", choose your server and you are done.
Right-click on the table you want to modify in SSMS and select "Edit Top 200 Rows".
If you have more than 200 rows to edit, you can connect to the SQL Server database with either Access or Excel.
Here are the instructions for Access:
http://office.microsoft.com/en-us/access-help/connect-an-access-project-to-a-microsoft-sql-server-database-adp-HP005274586.aspx

accessing Access 2007 System Object tables and schemas

I am looking for some help on retrieving Access 2007 database schema information for system object tables. I have reviewed, read and tested this successfully for the non system tables. The database tables info I am trying to retrieve are in the tables that begin with MSys{xxxxxxxxxx} and store things like relationships, creation date, dateupdate, etc. This tables are viewable by right clicking on the Navigation Options popup menu in Access and selecting Show System Objects.
For clarification, I have added the System.mdw database to the connection string, and I have attempted multiple settings in the restrictions property of the getSchema method. I am using ado.net, vb.net, and VS2008, these are access 2007 databases not mdb files.
My issue appears to continue to be no read access to the System tables. My end goal is to manage relationships initially and eventually hopefully script these databases much like can be done EASILY (Microsoft) in SQL Server Mgmt Studio.
I am hoping someone can point me to some good web link resources or even a good book that clearly discusses this functionality.
thanks,
As it turns out the easiest way to gain access to the system table data is to execute a permissions command on the Systems database table(s). The following query did the trick....
Dim strDdl As String = "GRANT SELECT ON MSysObjects TO Admin;"
Dim command12 As New OleDbCommand(strDdl, connection)

SQL Server Analysis Services Tabular Source Schema Change

I have a model created in SSDT (Visual Studio) for SQL Server Analysis Services Tabular. I deployed the model and it works fine.
How can I change the schema of some underlying tables in the model? Some of data types changed and some new columns added in SQL Server tables.
Thanks
If you have made changes in your underlying data source, you can go to the Table Menu -> Table Properties.
This will bring up a window that shows your table and all its columns. There is a check box on each column. If you have added fields, find the fields and make sure the check box is checked. When you click OK, any change in data types should be picked up.

sql server folder questions

I thought I read somewhere that in 'denali' we would be able to place tables within management studio into logical folders. For example I have 20 tables releating to clouds, i could create a clouds folder and group the tables logical, thus i can hide/expand that folder to see the tables. Is this already done in 2008 r2? *Or did i read correctly and it will happen in denali?*
SQL Server Code-Named Denali (or likely to be officially named 2011), has released its CTP 1. Along with it is SQL Server Management Studio.
Within, as it stands today, you cannot organize tables into 'folders' for visual organization.
There are many 3rd party solutions which could implement such a feature but MS has not implemented in their tools yet.
However, here is a potential solution: Management studio does allow you to define a filter on the tables list. If you are working on one area you can right click on the table leaf and select filter. Maybe this will help to restrict your view to just the tables you are interested in working with at a given time.

Database object related to the view - sql server 2005

How to know that how many database tables, views or any other object attached to a view in sql server 2005 database.
I tried with Sp_Depends, but amazingly it is not showing the SP name in which it is getting used.
When I run the statement Sp_depends vw_MyViewName.
I am only getting the name of the tables and columns which I have used inside the vw_MyViewName. I need to know other objects related to this view.
In SQL Server 2005 this happens if you create the objects in the wrong order.
You will get a warning message that the dependency information could not be added for a missing object but the object will still be created
You can run sp_refreshsqlmodule on all objects in your database to recreate such missing dependency information (an example script to do that is here How do I find all stored procedures that insert, update, or delete records?)
Until sys.sql_expression_dependencies was introduced (SQL Server 2008), you need query sys.sql_modules
SELECT OBJECT_NAME(object_id)
FROM sys.sql_modules
WHERE definition LIKE '%MyTable%'
Personally, I'd use WITH SCHEMABINDING to ensure dependencies must exist
The only completely reliable way I know of to determine object dependencies in a SQL Server database is to load your schema into Visual Studio Database Edition (DBPro) and examine the dependencies there. I have found this to be foolproof, unlike the way SQL Server tracks dependencies.
I wouldn't necessarily fault SQL Server for this. I don't think it ever made the claim that it was able to track dependencies with 100% accuracy, mostly because of the way it binds objects.
In SQL Server Management Studio, in Object Explorer panel, right click on the object you want to inspect (stored procedure, table, view, ...) and click on "Show Dependencies".
The window that appear, will show you both dependant and "depended" objects, simply by switching between two radio button ;)
If you want to do it by hand, you need to build a query over the sys.sql_dependencies system view. Here a link to the description with some examples
Beware that stored procedures that depends on nonexistants tables, view, and other objects, will be created, but not only they obviously doesn't work, but dependency informations will not be added, until all "depended" objects are created, AND the SP is REcreated!