Showing posts with label SSMS. Show all posts
Showing posts with label SSMS. Show all posts

Thursday, July 9, 2015

View dependencies

in ssms is not always correct because it depends on sysdepends



this is more accurate

select t.name as TableWithForeignKey, fk.constraint_column_id as FK_PartNo , c.name as ForeignKeyColumn
from sys.foreign_key_columns as fk
inner join sys.tables as t on fk.parent_object_id = t.object_id
inner join sys.columns as c on fk.parent_object_id = c.object_id and fk.parent_column_id = c.column_id
where fk.referenced_object_id = (select object_id from sys.tables where name = 'BLAH')
order by TableWithForeignKey, FK_PartNo

Monday, December 23, 2013

Thursday, October 24, 2013

export registered servers in ssms

do not include user names and pswds - otherwise the file is encrypted and the export file wont work on another machine

Monday, May 13, 2013

how to have updatable data from any query in SSMS


edit top 200-> right click on grid -> pane- > sql-> change the sql