Welcome, Guest
General discussion about ComicRack

TOPIC: Duplication Issue with MS SQL

Duplication Issue with MS SQL 4 years 6 months ago #38130

Hey all!

I've been having some issues with the library duplicating, especially after a crash. This had led me to remove my library and re-add it all, then that buggers up things like my sync-ing to the Nexus. Real pain.

So I came up with some quick scripts to try and sort out the issue. They are currently in development process and only work for Microsoft SQL versions of the database, but it shouldn't be too hard for some bright spark out there to convert over.

Basically, the first script sets up some basic stuff. A table to hold the results in, which can then be used to review which files are duplicated and a function that allows you to rip data out of the metadata in the DB.

Second script runs for the whole of your library, getting some basic information to work from. Then it counts up the amount of times it appears in the list. Then it deletes the duplications from the main DB.

Okay, a few warnings. I've tested it (a few times) and it works for me. But I'm not saying it'll work for everyone so...

1) Back up your database the first couple of times you try it. Better to be safe than sorry.
2) If it does bugger up your database, then you should have paid attention to point (1)
3) I'm not saying it'll work when there's a big update to the program. We can only hope.
4) Feel free to mess about with the script but at your own risk. I'm not bug fixing others!
5) You use these scripts at your own risk! See point (1),(2),(3) and (4)!

Hope it helps those that have screamed before me!

How to use:

Run the setup.sql script to set up the table and the function. Yes, I know theres a drop table in the script and it recreates it (and would probably be faster if I took it out), but I can guarantee someone will complain it doesn't work without running the setup script first. This script only needs to be run once.

Then when you have duplication issues, run the comic_cleanup.sql script.

Both scripts need to be run using the Management Studio (or SQL script editor of your choice) and against the COMICS DB.

Any issues, please see the points above.
Last Edit: 4 years 6 months ago by Ravenscross. Reason: Scripts added
The administrator has disabled public write access.

Duplication Issue with MS SQL 4 years 6 months ago #38131

How the heck do I add the script?
The administrator has disabled public write access.

Duplication Issue with MS SQL 4 years 6 months ago #38149

  • laxarus
  • laxarus's Avatar
  • Offline
  • Senior Boarder
  • Posts: 66
  • Thank you received: 3
  • Karma: 0
Using mysql database and occasionally getting duplicates for files. The only solution is deleting from the library and re-adding those two files. Furthermore, they point the same location in the hard drive so i am guessing sometimes cr writes duplicate entries to sql database. (Especially if you played with the same file over and over again in a short time)
The administrator has disabled public write access.
Time to create page: 0.167 seconds

Who's Online

We have 205 guests and one member online