SQL: maintenance plan delete after server rename
In a previous post I spoke about changing your database server name. If you created a maintenance plan, you might notice that the plan will fail. This is because the connection of your maintenance plan...
View ArticleSQL: getting column information
To retrieve a list of column information for a table using T-SQL, use the following method: SELECT ORDINAL_POSITION ,COLUMN_NAME ,DATA_TYPE ,CHARACTER_MAXIMUM_LENGTH ,IS_NULLABLE ,COLUMN_DEFAULT FROM...
View ArticleSee backup chain SQL Server
See the backup chain in SQL Server SELECT TOP 100 s.database_name, CASE s.type WHEN 'D' THEN 'Full' WHEN 'I' THEN 'Differential' WHEN 'L' THEN 'Transaction Log' END AS BackupType, CAST(DATEDIFF(second,...
View ArticleSQL: backup / restore DB status
A nice script I found to use when you are backing up / restoring a SQL database and you want to see the progress.SELECT r.session_id,r.command,CONVERT(NUMERIC(6,2),r.percent_complete) AS [Percent...
View Article