Skip to content
Advertisement

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 included an example of the

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 script for this?

Assign default values in SQL Server dynamic pivot

Below is pivot query for my requirement. Below is my script for table creation scripts with data. Table_TraineeInfo is candidate registration details table, Table_Batch_Lookup is batch detail when batch start date and end date base on filling in pivot, Table_Attendance_Log is candidate attendance log. My current output I want below output if date is less than or equal to today

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 method of

Advertisement