20 Database Design Practices

When designing database, you have choices to make. To work in the right direction and preventing regretting design decisions, I am using these best practices : Use consistent names. Well defined and consistent names for tables and columns (e.g. School, StudentCourse, CourseID ...). Use sing... [More]

ExpressProfiler for SQL server

When I installed the free SQL Server Express edition one of the tooling I missed was SQL Server Profiler which comes with the paid version of SQL Server. Today I found a nice replacement: Express Profiler. It’s simple but good enough for seeing what queries get fired to the database. And it’s sma... [More]

Generate random testdata with T-SQL

Writing software is step one, testing it thoroughly is also very important. Sometimes you need to have some more test data in your database to see how well it performs when the dataset gets larger. Or you want to test how well your search solution is doing or paging is done within your application. ... [More]

SQL Server database table sizes

To get a good overview of the amount of data that resides in your database tables, you can use this handy T-SQL scripts. CREATE PROCEDURE [dbo].[GetDBTableSize] AS BEGIN SET NOCOUNT ON; DECLARE @cmdstr varchar(100) --Create Temporary Table CREATE TABLE #TempTable ( [Table_Name] varchar(50... [More]

Find stored procedures, tables and functions in T-SQL

When developing a lot in database, it can be useful to search for database objects that contain (partly) a specific name. The stored procedure script below allows you to perform such a search. /* Find stored procedures / tables / functions */ CREATE procedure dbo.pr_FindIt ( @find varch... [More]