0

I am trying to generate rules form of output from user data.that output i have to store in sql database.so when each time , user is giving different data for processing, i have to create a new database for storing the rules from their data.
how can i do this dynamic creation of database when needed.

4
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by adam_k
0

how i can give every time a new name to the database created so that those databases created can be saved for long time.the name of database how it can be passed

0

You have to figure out how your dbs should be named and pass that name to Create Database.

For some strange reason I'm guessing you are following a wrong path here.
Can you explain again why each users output rules have to go to a different db? Wouldn't a table with different records per user do? Can you elaborate on what type of data you have to store in each db?

0

Hi,
I'm with adam_k; why isn't a new table per user being used instead of an entire new database per user - that seems excessive. If you do need different tables you will need to figure out a naming strategy that will create unique names (but still following some set rules as you'll obviously need to access these databases again at some point).
A better understanding of what you're trying to store would help us out.

0

yes sir,i was mistaken.It is good to create table instead of database every time.
How can i check in asp.net c# application that whether a sql table exists or not.if it exists,drop it and create new one.
else if it doesn't exists,simply create it.

how can i do it sir?

0
IF EXISTS(SELECT name FROM sys.tables
  WHERE name = 'T')
BEGIN
DROP TABLE T
END
CREATE TABLE T (
c1 nvarchar(max),
c2 nvarchar(max)
)

Edited by adam_k: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.