Page 1 of 1

Creating database

Posted: Fri 27 May 2011 11:41
by devUser102
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?

Posted: Fri 27 May 2011 13:43
by AndreyZ
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

Posted: Fri 29 Jul 2011 12:16
by priya
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