Skip to content

Tag: sql-server-2008

Building an Employee Date Matrix

I have a list of employees, along with list of cities they’ve worked in. I need to build a matrix (in SQL Server) of start/end dates by city to determine where they were at any given period in time. The “end date” would be exactly the date before they appeared at a new location. I’ve i…

Finding double bookings

I have two tables which when linked by a booking ID from table 1 and ID from table 2 Therefore Im trying to flag double bookings where the same member id has booked twice within a time frame (StartDateTime and EndDateTime). Then remove the booking that has the latest BookedDate. Can someone help me with a sql…

How to reduce SQL log file size

SQL log file size is very big in our production database and hard disk space left only 2G. Is it safe to delete .ldf file? Answer Check out this post In the interim, this should at least allow you to kill the log file: Perform a full backup of your database. Don’t skip this. Really. Change the backup me…