Page 15 of 17

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Tue Nov 30, 2010 12:36 pm
by Onweerwolf
I hope i'm not too annoying as a n00b asking this most likely very simple question: what query do i use to get the artist and title of a specific songid?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Tue Nov 30, 2010 1:51 pm
by nynaevelan
SELECT Artist, SongTitle FROM Songs WHERE ID = 'replace ID here'

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Tue Jan 11, 2011 8:17 am
by GhOsT_MZ
I want change a song path. Initially root of path is ":\_Music\Andrey\", I want change this to ":\_MM_MEDIA\". I execute next query:

Code: Select all

UPDATE Songs SET SongPath = REPLACE(SongPath, '@_Music\Andrey', '@_MM@_MEDIA');
Query executed without errors, but field SongPath not changed. Why? How I can change this field?

PS: sorry for my english...

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Tue Jan 11, 2011 9:56 am
by Bex
This should do it, but please back up your database first!

Code: Select all

UPDATE Songs SET SongPath = REPLACE(SongPath, ':\_Music\Andrey\', ':\_MM_MEDIA\')
WHERE SongPath like ':\_Music\Andrey\%';

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Wed Jan 12, 2011 2:47 am
by GhOsT_MZ
Bex wrote:This should do it, but please back up your database first!

Code: Select all

UPDATE Songs SET SongPath = REPLACE(SongPath, ':\_Music\Andrey\', ':\_MM_MEDIA\')
WHERE SongPath like ':\_Music\Andrey\%';
Thanks, it's working)

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Tue May 24, 2011 10:12 am
by timelezz
Is it safe to use SQL Viewer 2.4 with MM4?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Tue May 24, 2011 10:35 am
by nynaevelan
I've used it with mm4 but I have not tested it with any of the new fields that are in mm4.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Tue May 24, 2011 11:49 am
by timelezz
Can someone help me out? I also need to change the folder name. But the folders are on a different PC, within the same network group.

It was: \\Algemeen\d\mp3\
must be: \\Algemeen\mp3\

Can you please make the query for me? I'm totally not experienced and am afraid I will screw it all up.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Tue May 24, 2011 2:14 pm
by Bex
If I understand you correctly this should do it, but please back up your database first!

Code: Select all

UPDATE Songs SET SongPath = REPLACE(SongPath, '\\Algemeen\d\mp3\', '\\Algemeen\mp3\')
WHERE SongPath like '\\Algemeen\d\mp3\%';

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Tue May 24, 2011 4:52 pm
by timelezz
Hmmm... did not do the job jet. I went to the folder in MM. Selected all those entries. Then started the Script SQL viewer. Entered the code in the big box in the middle and hit RUN Select Query. It took about 7 seconds and 0 rows.

I'm totally new to SQL viewer. Maybe I do sth wrong?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Tue May 24, 2011 5:16 pm
by Bex
SQL can only change the path in MM's database. But I guess that's what you want to do?

1. What is the incorrect path in your database?
2. What do you want to update it to in MM's database?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Sat Jun 11, 2011 6:17 am
by bonjo
Hi. I have a quite similar problem, but I can't get it SQL-Viewer to do the work:
I changed the volume character (from H: to N:) on an external drive containing my music and also the path to the music folder:
old: H:\jaBU\iMusic\
new: N:\2 Music\
Then I opened MM and found all my music, under the new drive letter, but within the old path: N:\jaBU\iMusic\
All songs are displayed black, but when trying to play, they turn grey and don't play.
I am completely new to SQL-Viewer and have no coding experience whatsoever. I entered the following into the window:

Code: Select all

UPDATE Songs SET SongPath = REPLACE(SongPath, '\\jaBU\iMusic\', '\\2 Music\')
WHERE SongPath like '\\jaBU\iMusic\%';
Then I hit 'Run Select Query' (although I am not sure what the buttons mean): 0.234 sec, nothing happens (except #____ in the bottom window).
Then I hit 'Execute DDL/DML Statement': Information window 'Statement Successfully Executed in 0,344 sec'
Nothing has changed with the songs.
Please help :-?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Sat Jun 11, 2011 6:33 am
by Bex
Actually, changing the drive letter would still make the songs playable since MM uses the driveID of a drive to locate it. The reason it doesn't work now is that you have changed the folder. To make it work again, do like this:

1. Back up your database!

2. Run this statement: (Use either button.)

Code: Select all

UPDATE Songs SET SongPath = REPLACE(SongPath, ':\jaBU\iMusic\', ':\2 Music\')
WHERE SongPath like ':\jaBU\iMusic\%';
3. Let me know it it worked.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Sat Jun 11, 2011 11:28 am
by bonjo
Hey, thanks, it worked. Took quite some time, but with 12500 songs, no wonder.
Don't forget to restart MM!

What's the difference between \\xyz\ and :\xyz\
I would have thought that the \\xyz searches anywhere in the path, whereas :\xyz searches only including the leading colon from right after the drive letter?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Posted: Sat Jun 11, 2011 11:48 am
by Bex
Great, how long time did it take? (It should be pretty fast.)
What's the difference between \\xyz\ and :\xyz\
The driveletter is not stored in the path field in the database. I.e all paths starts with :\xyz\. If you use UNC path then do the paths start with \\xyz\ (\\DEVICENAME\folder).