Category Archives: Database

Managing SQL Server Disk Usage

Some uses of SQL Server can cause databases and transaction log files to grow larger than intended. There are some tools available to system administrators and DBA’s to help manage file sizes for SQL Server. Here are some quick notes. … Continue reading

Posted in Database | Tagged | Leave a comment

Microsoft Access for SQL Server Reporting

I like to use Microsoft Access for end-user SQL Server Reporting. My business users love Excel and Access is one of the easiest ways to provide SQL views in spreadsheet-compatible form. This is related to my earlier post Microsoft Access … Continue reading

Posted in Database | Tagged , , | Leave a comment

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

Export and Email SQL View as CSV Spreadsheet Using Powershell

I’ve been looking for an easy way to export and email the query results from a SQL View as a Spreadsheet (CSV). I’ve finally found a decent solution on Windows using tools provided with either the operating system or the … Continue reading

Posted in Database | Tagged , , | 1 Comment

Ubuntu Python Connection to SQL Server

Python users on Ubuntu systems may have trouble connecting to Microsoft SQL Server on recent releases including 12.04 LTS. The popular pymssql python library for SQL Server connections contains a nasty bug in the distributed package that runs queries with … Continue reading

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

SQL Server System Rename

On the surface, a SQL Server system rename may appear simple. You rename the underlying Windows box and SQL will automatically use the new name. While that is true for many features in SQL server, there are quite a few … Continue reading

Posted in Database | Tagged | Leave a comment

SQL Server Backup Script Example

Here is a small SQL Server backup script sample from some of my DBA work. These are usually run on-demand to create custom on-off backups before and after special software upgrades. The first part is a simple batch file that … Continue reading

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

TSQL View with ORDER BY Clause

Views in Microsoft SQL Server are generally not permitted to have an ORDER BY clause. This is a good default behavior because it can negatively impact the view performance and the order should be specified when the final result set … Continue reading

Posted in Database | Tagged | Leave a comment

SQL Server Max Server Memory

It is common to run an application server (like Tomcat, IIS, etc) on the same system as a SQL Server database for small deployments. In this case, the standard memory-hogging behavior of SQL Server may adversely impact the performance of … Continue reading

Posted in Database, System Administration | 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