Monday, February 06, 2012 Register    Login
Instructions

In order to add new threads or reply to existing posts, you have to be logged-in. If you are not registered yet, you need to register first, and then login with your personal credentials.

   

CslaFactory Forums
HomeHomeOtherOtherWishlistWishlistSQL Generation using Sql SchemaSQL Generation using Sql Schema
Previous
 
Next
New Post
4/22/2008 2:33 AM
 

As of the CTP, sql artifacts generated follow the naming convention of NAMESPACE_BUSINESSOBJECT. What would be easier to manage would be to generate a Sql Schema for the given namespace and then just define all views, sprocs, tables, etc as being part of the Schema.

 

 
New Post
5/2/2008 10:37 AM
 

Sorry for the late response. I am not really shure if I understand you correctly. Please can you post  a short example.

 
New Post
5/6/2008 9:56 PM
 

Apologies for the late reply Josef,

The thought behind including Schema statements is 3 fold:

  1. Group the assets generated into a logical container within a database. When dealing with large numbers of tables, sprocs, views etc this can really be quite a boon.
  2. Provide another level of granularity to Sql asset permissions. With Schemas, one can assign permissions to a Schema, instead of having to assign permissions to individual assets (or at the other end spectrum to the entire database)
  3. Finally, and I think the best reason, is scripting for deployment. By placing assets within a Schema creation statement, Sql Server will automatically re-sequence the defined assets in order of dependency! VERY COOL.

In the below sample script, we can see that the table scripts are out of order. Running these outside of a Schema creation statement will produce an error as the Person table depends on the Party table (defined afterwards). Placing these DDL statements within a Schema creation statement delegates the sequencing responsibility to Sql Server itself.

 CREATE SCHEMA Party
    CREATE TABLE Person
    (
        PartyId UNIQUEIDENTIFIER NOT NULL
            REFERENCES Party (Id),
        DataOfBirth DATETIME
    )
    CREATE TABLE Party
    (
        Id UNIQUEIDENTIFIER NOT NULL PRIMARY KEY
    )
GO

 
New Post
5/7/2008 4:16 PM
 

I think this is a very good idea and added it to my TODO list for the next release. This should be optional, I think.

 
Previous
 
Next
HomeHomeOtherOtherWishlistWishlistSQL Generation using Sql SchemaSQL Generation using Sql Schema


   

UsersOnline
Membership Membership:
Latest New User Latest: empirowe
Past 24 Hours Past 24 Hours: 2
Prev. 24 Hours Prev. 24 Hours: 0
User Count Overall: 1586

People Online People Online:
Visitors Visitors: 2
Members Members: 0
Total Total: 2

Online Now Online Now: