Creating database

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
devUser102
Posts: 1
Joined: Fri 27 May 2011 11:33

Creating database

Post by devUser102 » Fri 27 May 2011 11:41

Hi

I'd like to create database with a given initial size.

I'm using msConn: TMSConnection, and creating without SIZE works fine

msConn.ExecSQL('CREATE DATABASE')

but when I add SIZE = 10, it failes.

Any suggestions?

AndreyZ

Post by AndreyZ » Fri 27 May 2011 13:43

Hello,

You can create database with the SIZE option in the following way:

Code: Select all

MSConnection.ExecSQL('CREATE DATABASE MYTEST ON (NAME = mytest_dat, FILENAME = ''D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mytestdat.mdf'', SIZE = 10)', []);
For more information, please read this article: http://msdn.microsoft.com/en-us/library ... l.80).aspx

priya
Posts: 2
Joined: Tue 26 Jul 2011 13:19
Location: Lahore
Contact:

Post by priya » Fri 29 Jul 2011 12:16

Thanks for this, I was also struggling with the same problem and did Not get solution from anyone but finally it is all solve here

Post Reply