Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Dynamic db create

Author  Topic 

GhantaBro
Posting Yak Master

215 Posts

Posted - 2010-09-15 : 15:36:10
Checking if anyone has experience doing this...

I have a datawarehouse (star schema)... one of the dimension is companies... based on the company I have to create database dynamically... basically need a Proc that will be parmaterized which creates database with data related to only that particular company....

Any suggestion is appreciated. Thanks!

X002548
Not Just a Number

15586 Posts

Posted - 2010-09-15 : 16:07:50
would company be a fact table?

In any case...wouldn't you have a predefined idea of what you are going to build?

Why would it be dynamic?

and aren't dimensions the derived data?

EDIT: I hate the buzz words for sheet I've been doing for decades


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

GhantaBro
Posting Yak Master

215 Posts

Posted - 2010-09-15 : 16:27:40
Thanks for responding!

Company will be a dimension and we will create fct table for only records relevant to that company... other dimensions mostly will be copied as they are lookups mostly.

Is there a way through sql proc to script the table and db from original database and use that dynamically to create a database for the company using the new name? Once created, I can insert relevant records in the tables... or what you suggest?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-09-15 : 16:30:39
do you use Managment Studio? Is this for SQL Server?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

GhantaBro
Posting Yak Master

215 Posts

Posted - 2010-09-15 : 16:35:40
Yes it is a sql server... I think you are saying get the script task using mangement studio and use that in dynamic sql correct? that is a good idea...
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-09-15 : 16:45:37
but why does it have to be dynamic?

are you create a table for each company?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

GhantaBro
Posting Yak Master

215 Posts

Posted - 2010-09-15 : 16:57:35
No it will not create for all companies... I will create based on the parameter passed in the Proc... It will be created whenver someone requires it. let me know if I dont make sense and thank you.
Go to Top of Page

GhantaBro
Posting Yak Master

215 Posts

Posted - 2010-09-16 : 16:59:28
anyone with other suggestion please :)
Go to Top of Page
   

- Advertisement -