I followed the steps of this MS Guide and I managed to run a localdb and create a Testdb with this script:
CREATE DATABASE Test
ON
(NAME='Test_DAT',
FILENAME='/home/dlag/Documentos/Proyectos/BDtest/Test.mdf',
SIZE=10,
MAXSIZE=50,
FILEGROWTH=5)
LOG ON
(NAME='Test_Log',
FILENAME='/home/dlag/Documentos/Proyectos/BDtest/Test.ldf',
SIZE=5,
MAXSIZE=25,
FILEGROWTH=5);
GO
use Test;
GO
Time after, I try to create another db with the following script:
CREATE DATABASE BconDatos2
ON
(NAME='BconDatos2_DAT',
FILENAME='/home/dlag/Documentos/Proyectos/BDs/BiblioConDatos2/BconDatos2.mdf',
SIZE=10,
MAXSIZE=50,
FILEGROWTH=5)
LOG ON
(NAME='BconDatos2_Log',
FILENAME='/home/dlag/Documentos/Proyectos/BDs/BiblioConDatos2/BconDatos2.ldf',
SIZE=5,
MAXSIZE=25,
FILEGROWTH=5);
GO
use BconDatos2;
and I get this errors:
Msg 5123, Level 16, State 1, Line 4
AND SAYS(translated from Spanish):
The instruction CREATE FILE found OS error: 2(The system cannot find the file specified.) when trying to open or create the physical file.
'/home/dlag/Documentos/Proyectos/BDs/BiblioConDatos2/BconDatos2.mdf'.
Msg 1802, Level 16, State 4, Line 4
(translated from Spanish):
CREATE DATABASE error. Can not create some of the files in the list. See related errors
Total execution time: 00:00:00.081
On both DB I'm in master and the path for mdf and ldf files are previously created.
It's strange because in the script of 'Test' DB I can make SELECTS for Tables, but when I run:
SELECT Name from sys.Databases
This database doesn't appear, but another empty DB created later appears.
Anyway on 'BconDatos2' DB script I can't create DataBases…
Problems with permissions on scripts?
Best Answer
The problem isn't solved, but I just donwloaded the software 'Azure Data Studio' developed for linux and I have been able to see that the tables were being created in master. It's seems this app works and is more convenient to me for learn msslq by now. So maybe we can close the post.