adapted sample to actually work with SQL Server ;)