I have limited knowledge of SQL so can someone let me know if my thoughts are correct. I have a table that slowly fills up over time. I need to delete records from the first record to a given point in the table. As the primary key is based on GUIDs I am aware that I can’t do a delete easily because I can’t sort based on GUIDs (this was discussed in a previous thread). Would it be possible to use a cursor to look at the first record in the table and progress through the table deleting records until I get to a certain GUID ? The problem I have is that I need to delete all the records that were put in the table before the one defined by the GUID but I can only delete them if the data of the record is older that a predefined date. I know this is all a bit messy but I’m having to retro fit a solution so a bodgy solution will do for now.
I'm using MS SQL Server 2008