Tag Archives: SQL

Safely Remove Old SQL User and Schema

In older versions of Microsoft SQL Server (and Sybase?), a separate database schema was created for each database user. This caused confusion and resulted in non-standard fully qualified object names like jsmith.tabname rather than dbo.tabname. To correct this, you can … Continue reading

Posted in Database | Tagged , | Leave a comment

SQLite Date and Time

SQLite is a wonderful open source file-based database system useful for similar tasks as Access file-based databases on Microsoft Windows systems. The popularity of SQLite is partially due to the widely available libraries and tools which ship with most Linux … Continue reading

Posted in Database | Tagged , , | Leave a comment

Transact-SQL Cursor Example

Microsoft SQL Server comes with scripting capabilities as part of their Structured Query Language (SQL) implementation. The Microsoft and Sybase query languages are both referred to as “Transact-SQL” or T-SQL since MS SQL was originally a licensed fork of the … Continue reading

Posted in Database | Tagged , , , , | Leave a comment

SQL Server Default Trace

Microsoft SQL Server database administrators have many excellent logging and debugging tools available to them. Among these is the “default trace.” The SQL Server database engine ships with a special trace enabled and logging *.trc or “trace” files to the … Continue reading

Posted in Database | Tagged , , , , | Leave a comment

SQL Script Output

If you use SQL scripts with Microsoft SQL Server, you may want to clean up the output to make your script log messages more readable. Here are some recommendations to beautify the output: SET NOCOUNT ON — suppress output of … Continue reading

Posted in Database | Tagged , , | Leave a comment

SQL Server Emergency Mode Repair

SQL Server databases can become badly damaged if a storage system crashes or write operations are not delivered to the disk. In order to recover from database corruption, the best remedy is a good backup and recovery solution. Popular systems … Continue reading

Posted in Database | Tagged , , , , | Leave a comment

SharePoint 2010 PowerShell Backup-SPFarm Error

SharePoint 2010 has a PowerShell backup feature called “Backup-SPFarm“. This will fail if the user running the command does not have full privileges on the underlying SharePoint SQL database. The standard error is not very helpful: “The local farm is … Continue reading

Posted in System Administration | Tagged , , , , | Leave a comment

SQL Server Maintenance Plan Change Owner

If your SQL Server 2005 Maintenance Plan (backup, etc) jobs start failing for no apparent reason, check the following. Is the original creator / owner of the Maintenance Plan still a valid Windows or Active Directory user? Does the original … Continue reading

Posted in Database | Tagged , , , , | Leave a comment