473,395 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Creating a new database with limits using SMO

Hi,

Using SMO (VB.NET), I'm creating a new database as shown below. I would
like to change the growth size of the database (to 10%, it's defaulting to
1mb at the moment) and also to set the maximum size I will allow it to grow
to, to 10mb (for testing purposes). How can I do this on the SMO interface?

Thanks for any tips,
Robin


theServer = New Server(Source.Server)

Dim theDatabase As New Database(theServer , newCatalog)

theDatabase.Collation = "SQL_Latin1_General_CP1_CI_AS"
theDatabase.CompatibilityLevel = CompatibilityLevel.Version90
theDatabase.IsFullTextEnabled = False

theDatabase.DatabaseOptions.AnsiNullDefault = False
theDatabase.DatabaseOptions.AnsiNullsEnabled = False
theDatabase.DatabaseOptions.AnsiPaddingEnabled = False
theDatabase.DatabaseOptions.AnsiWarningsEnabled = False
theDatabase.DatabaseOptions.ArithmeticAbortEnabled = False
theDatabase.DatabaseOptions.AutoClose = True
theDatabase.DatabaseOptions.AutoCreateStatistics = True
theDatabase.DatabaseOptions.AutoShrink = True
theDatabase.DatabaseOptions.AutoUpdateStatistics = True
theDatabase.DatabaseOptions.CloseCursorsOnCommitEn abled = False
theDatabase.DatabaseOptions.LocalCursorsDefault = False
theDatabase.DatabaseOptions.ConcatenateNullYieldsN ull = False
theDatabase.DatabaseOptions.NumericRoundAbortEnabl ed = False
theDatabase.DatabaseOptions.QuotedIdentifiersEnabl ed = False
theDatabase.DatabaseOptions.RecursiveTriggersEnabl ed = False
theDatabase.DatabaseOptions.BrokerEnabled = True
theDatabase.DatabaseOptions.AutoUpdateStatisticsAs ync = False
theDatabase.DatabaseOptions.DateCorrelationOptimiz ation = False
theDatabase.DatabaseOptions.Trustworthy = False
theDatabase.DatabaseOptions.IsParameterizationForc ed = False
theDatabase.DatabaseOptions.ReadOnly = False
theDatabase.DatabaseOptions.RecoveryModel = RecoveryModel.Simple
theDatabase.DatabaseOptions.UserAccess = DatabaseUserAccess.Multiple
theDatabase.DatabaseOptions.PageVerify = PageVerify.TornPageDetection
theDatabase.DatabaseOptions.DatabaseOwnershipChain ing = False

theDatabase.Create(False)
Oct 27 '06 #1
3 2240
You manage file growth by using the DataFile objects:

http://msdn2.microsoft.com/de-de/library/ms162176.aspx

Set the Growth property:

http://msdn2.microsoft.com/zh-tw/lib...le.growth.aspx

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
..
"Robinson" <to******************@myinboxtoomuchtoooften.comwr ote in
message news:eh*******************@news.demon.co.uk...
Hi,

Using SMO (VB.NET), I'm creating a new database as shown below. I would
like to change the growth size of the database (to 10%, it's defaulting to
1mb at the moment) and also to set the maximum size I will allow it to grow
to, to 10mb (for testing purposes). How can I do this on the SMO interface?

Thanks for any tips,
Robin


theServer = New Server(Source.Server)

Dim theDatabase As New Database(theServer , newCatalog)

theDatabase.Collation = "SQL_Latin1_General_CP1_CI_AS"
theDatabase.CompatibilityLevel = CompatibilityLevel.Version90
theDatabase.IsFullTextEnabled = False

theDatabase.DatabaseOptions.AnsiNullDefault = False
theDatabase.DatabaseOptions.AnsiNullsEnabled = False
theDatabase.DatabaseOptions.AnsiPaddingEnabled = False
theDatabase.DatabaseOptions.AnsiWarningsEnabled = False
theDatabase.DatabaseOptions.ArithmeticAbortEnabled = False
theDatabase.DatabaseOptions.AutoClose = True
theDatabase.DatabaseOptions.AutoCreateStatistics = True
theDatabase.DatabaseOptions.AutoShrink = True
theDatabase.DatabaseOptions.AutoUpdateStatistics = True
theDatabase.DatabaseOptions.CloseCursorsOnCommitEn abled = False
theDatabase.DatabaseOptions.LocalCursorsDefault = False
theDatabase.DatabaseOptions.ConcatenateNullYieldsN ull = False
theDatabase.DatabaseOptions.NumericRoundAbortEnabl ed = False
theDatabase.DatabaseOptions.QuotedIdentifiersEnabl ed = False
theDatabase.DatabaseOptions.RecursiveTriggersEnabl ed = False
theDatabase.DatabaseOptions.BrokerEnabled = True
theDatabase.DatabaseOptions.AutoUpdateStatisticsAs ync = False
theDatabase.DatabaseOptions.DateCorrelationOptimiz ation = False
theDatabase.DatabaseOptions.Trustworthy = False
theDatabase.DatabaseOptions.IsParameterizationForc ed = False
theDatabase.DatabaseOptions.ReadOnly = False
theDatabase.DatabaseOptions.RecoveryModel = RecoveryModel.Simple
theDatabase.DatabaseOptions.UserAccess = DatabaseUserAccess.Multiple
theDatabase.DatabaseOptions.PageVerify = PageVerify.TornPageDetection
theDatabase.DatabaseOptions.DatabaseOwnershipChain ing = False

theDatabase.Create(False)
Oct 27 '06 #2

"Tom Moreau" <to*@dont.spam.me.cips.cawrote in message
news:eT****************@TK2MSFTNGP03.phx.gbl...
You manage file growth by using the DataFile objects:

http://msdn2.microsoft.com/de-de/library/ms162176.aspx

Set the Growth property:

http://msdn2.microsoft.com/zh-tw/lib...le.growth.aspx
Ok I see that Tom. I'm going to stick with the defaults and then modify
after database creation. That way I don't have to get my hands dirty adding
filegroups and playing about with stuff I don't understand ;).

Another thing about SQL Express if I may ask, if I specify the filegroup to
grow, say, 10%, will it grow to the 4Gb limit or fail because 10% of 3.9Gb
would take it over the 4Gb limit? Is the limit only for file space actually
committed in tables?

Thanks
Robin
Oct 27 '06 #3
I'm not sure what would happen in the case of SQL Express. The limit is not
for space actually used within the file. It is the limit for the file
itself. Thus, you can have a 4GB file and be using only 10MB of it.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada

"Robinson" <to******************@myinboxtoomuchtoooften.comwr ote in
message news:eh*******************@news.demon.co.uk...

"Tom Moreau" <to*@dont.spam.me.cips.cawrote in message
news:eT****************@TK2MSFTNGP03.phx.gbl...
You manage file growth by using the DataFile objects:

http://msdn2.microsoft.com/de-de/library/ms162176.aspx

Set the Growth property:

http://msdn2.microsoft.com/zh-tw/lib...le.growth.aspx
Ok I see that Tom. I'm going to stick with the defaults and then modify
after database creation. That way I don't have to get my hands dirty adding
filegroups and playing about with stuff I don't understand ;).

Another thing about SQL Express if I may ask, if I specify the filegroup to
grow, say, 10%, will it grow to the 4Gb limit or fail because 10% of 3.9Gb
would take it over the 4Gb limit? Is the limit only for file space actually
committed in tables?

Thanks
Robin

Oct 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Janne Timmerbacka | last post by:
Hello, where can I find limits of how many TABLES can exists in one DATABASE? Also, is there any performance penalty (or other) for having alot of TABLES in one DATABASE? Regards Janne...
4
by: Altramagnus | last post by:
I have 30 - 40 type of different window. For each type I need about 20 instances of the window. When I try to create them, I get "Error creating window handle" My guess is there is a maximum...
9
by: monomaniac21 | last post by:
Hi everyone i'm trying to setup my website to create new webpages dynamically using php but I am have a major problem in that whenever i create a file it is always created locked so that it can...
2
by: Kums | last post by:
What is the maximum permissible size of a database? Is there any limitation. What is the maximum # of tablespace's allowed in a database? Thanks for your response.
6
by: Noozer | last post by:
I'm developing a database using MS Access and have come across a problem. The majority of my database is pretty straightforward "many to one" relationships. I have one relationship that is...
5
by: Claudio Grondi | last post by:
I have just started to play around with the bsddb3 module interfacing the Berkeley Database. Beside the intended database file databaseFile.bdb I see in same directory also the __db.001...
47
by: Ivan Weiss | last post by:
Hi all, I am just getting started on a new app and am a rusty VB6 guy who is looking to create something on the side to serve as a corporate workbench for my company. ADO.net is new to me so...
2
by: Seven | last post by:
Hi, When I right-click the View Node of a database connection (in server explorer), I only get the 2 choices: "Refresh" and "Properties". Therefore I was wondering how can I set up Visual...
5
by: Johnny Jörgensen | last post by:
Hi all I just saw an ad in the latest ComponentSource newsletter for a database engine called VistaDB 3.0. http://www.vistadb.net/default.asp It looks very interesting as a database engine...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.