Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

Friday, July 1, 2011

Dependency information on my table

To find out what depends on the table you are about to alter or drop.

SELECT
referencing_schema_name, referencing_entity_name
FROM sys.dm_sql_referencing_entities(' schema_name.referenced_entity_name ' , ' <referenced_class> ' )

additional information<
{
referenced_class> ::=OBJECT| TYPE
| XML_SCHEMA_COLLECTION| PARTITION_FUNCTION}

Friday, June 10, 2011

STOP A SQL SERVER DATABASE THAT IS IN RECOVERY MODE

Sometimes you do not care if you loose data and/or do not have time to wait for recovery to finish.


USE MASTER
GO
RESTORE DATABASE [database_name] WITH NORECOVERY
GO