Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How stupid can SQL be?
Message
De
02/04/2019 08:39:09
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
How stupid can SQL be?
Divers
Thread ID:
01667824
Message ID:
01667824
Vues:
80
Trying to restore a database backup I got from a client. Nothing new, no surprises. But SQL server (this time SQL2012) just flatly refused to restore to the location where the database should go (q:\rad\db\data\) because the path "c:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\" didn't exist. I actually had to create the bloody location just for this. Then again it wouldn't restore, because of "SQL Server Database Error: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\blabla.mdf'." I had to add the "NT Service\MSSQL$SQEX12" user to that folder and give it full rights.

Now I understand why the script has to say
WITH replace, FILE = 1,
move N'blabla' to N'q:\rad\db\DATA\blabla.mdf',
move N'blabla_log' to N'q:\rad\db\DATA\blabla_log.ldf',...
- because it actually doesn't know how to restore to a different location, so it restores to where it originally was and then MOVES the files to where they go.

What was it that you were teaching us all those years about hardcoded paths, Microsoft?

Set Rant Half

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform