Blog

15 things you should do at an interview

Arrive on time or early but not too early.Dress formally, this would give you a self-confident.Be polite to everyone in the office.Act confident, but not overconfident.Give the appearance of energy as you walk.Do not forget to smile.Shake hands firmly and stand until offered a chair.Look to the interviewer in the eye while speaking.If the...

How to apply or execute a T-SQL command to every database in your server

We talked before on How to  apply or execute a T-SQL command to every tables in your database. Now we are going to have a quick look on the same but for databases not tables … There is a handy undocumented stored procedure that allows you to do this without needing to set up a cursor...

How to execute a T-SQL command to every table in SQL Server database

sp_MSforeachtable is a stored procedure that is mostly used to apply a T-SQL command to every table, iteratively, that exists in the current database. Examples on how to use it: 1-Perform an unconditional reindex over all tables in the database: EXEC sp_MSforeachtable 'DBCC DBREINDEX(''?'')' 2-Truncate all tables in the database: EXEC sp_MSforeachtable 'TRUNCATE TABLE ?' 3-Get the information about the...