Database Development

Rebuild All Database Indexes

You can rebuild all indexes present in your database with the following query: EXEC sp_MSforeachtable @command1=”print ‘?’ DBCC DBREINDEX (‘?’, ‘ ‘, 80)” GO EXEC sp_updatestats GO

Know if LIKE Results are True or False

MySQL is capable of returning the result of a LIKE directly in the result set itself. For example, if you use a wildcard character in a query such as below,

Find Tables Referenced by Foreign Keys

You can easily find tables referenced by foreign keys with a script similar to the following: SELECT = + N’.’ + FROM sys.tables AS t INNER JOIN sys.schemas