Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How stupid can SQL be?
Message
From
02/04/2019 11:19:13
 
 
To
02/04/2019 08:39:09
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01667824
Message ID:
01667832
Views:
67
That we should do as they say, not as they do?


>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
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform