PDA

View Full Version : Localdb & df



Edgar H. Peña C.
17-Apr-2017, 07:08 AM
hi all

I want to try using dF and localDB (sql) for the purpose of Express installations to streamline installations for single-user applications.
to. But how to attach the database?
B. Does vd19 have an instruction to attach the database?

Does anyone have the same concerns and business needs?

Edgar

wila
17-Apr-2017, 09:11 AM
Not sure on DAWs driver, but for mertech it is a simple:



SQLSERVER_ATTACH_DB {database} on {filePath}


For DAWs driver you most likely will have to do so using embedded SQL.
--
Wil

Edgar H. Peña C.
17-Apr-2017, 09:20 AM
hi Wil

I'm using DAW driver, I do not even know how. I have asked and suggested in the chat that the attachment instruction seems to be a priority for df19.

Edgar

ivansc
17-Apr-2017, 02:47 PM
hi Wil

I'm using DAW driver, I do not even know how. I have asked and suggested in the chat that the attachment instruction seems to be a priority for df19.

Edgar

hi edgar,

if you need to create your database (from here (https://docs.microsoft.com/en-us/sql/tools/sqllocaldb-utility)):


A. Creating an Instance of LocalDB

The following example creates an instance of SQL Server ExpressLocalDB named DEPARTMENT using the SQL Server 2016 binaries and starts the instance.

SqlLocalDB.exe create "DEPARTMENT" -s
B. Working with a Shared Instance of LocalDB

Open a command prompt using Administrator privileges.

SqlLocalDB.exe create "DeptLocalDB"
SqlLocalDB.exe share "DeptLocalDB" "DeptSharedLocalDB"
SqlLocalDB.exe start "DeptLocalDB"
SqlLocalDB.exe info "DeptLocalDB"
REM The previous statement outputs the Instance pipe name for the next step

sqlcmd –S np:\\.\pipe\LOCALDB#<use your pipe name>\tsql\query
CREATE LOGIN NewLogin WITH PASSWORD = 'Passw0rd!!@52';
GO
CREATE USER NewLogin;
GO
GRANT CREATE DATABASE TO NewLogin;
GO
GRANT CREATE TABLE TO NewLogin;
GO
EXIT

Execute the following code to connect to the shared instance of LocalDB using the NewLogin login.

sqlcmd –S (localdb)\.\DeptSharedLocalDB -U NewLogin -P Passw0rd!!@52
USE master;
GO
CREATE DATABASE mydatabase
ON
( NAME = mydatabase_dat,
FILENAME = 'C:\sqllocaldb\mydatabasedat.mdf',
SIZE = 100,
MAXSIZE = 1000,
FILEGROWTH = 10 )
LOG ON
( NAME = mydatabase_log,
FILENAME = 'C:\sqllocaldb\mydatabaselog.ldf',
SIZE = 50,
MAXSIZE = 500,
FILEGROWTH = 5 ) ;
GO


then in DF you can create a new MSSQLDRV connection ID pointing to the server:
(localdb)\.\DeptSharedLocalDB
with the same credentials as above
also you can connect to the same server with M.SSMS
hth
regards
Ivan

Edgar H. Peña C.
17-Apr-2017, 03:24 PM
thanks Ivan

Edgar