sql server 2008

Change in SQLServer the key column of a table to a new one of type integer that is identity using OVER


Relational scheme master detailAt some point it may be necessary to change the key column type for our table / s because of a poor design or a subsequent change that forces us to do so.

If we do and the new has to be a column of the integer type, maybe identity, we can do it with some criterion so that it is sorted ..


SQL08: Update table statistics dynamically throughout a database


As in Oracle there is a table which lists all tables in the database (dba_tables) and we can use it to do maintenance dynamically in SQL Server can do the same querying the table [dataBase].dbo.sysobjects.

In the example below (as in others that I hung up) update the statistics for all tables in a database, SQL Server dynamically querying the data dictionary. This could be encapsulated in a stored procedure or in a job directly execute SQL Server Agent to keep updated statistics on all tables in a database automatically.

Syndicate content