I want to create a empty new table (if it doesn't exist)
when the the page/program starts. Maybe with copying field names from other table.
It would be nice to have its name personal for each user. But I don't know if it possible.
Also, what event is best place for this.
Perhaps like this:
dim username as string = Page.User.Identity.Name
Dim tablename as string
tablename= shopping_basket+username
create from t_product new
@.tablename
What you are thinking of doing is not a very good idea. You will have to give the user higher permissions to create tables on the fly and if they are not cleaned up properly you will end up with tons of tables that you dont know if they are being used or not. On the otherhand, think of using temp tables or table variables in the proc.
|||Aha good to know, and yes I should thought about that myself.
What about a table with a constant name. But then, have you good code using or making a temp table or table variable.
What is a table variable?
Regards
Leif
|||
LISM:
What about a table with a constant name.
You can do that too. If you can identify a batch from a different batch via some unique key. If you have multiple users inserting into that table you should have a way of identifying one set from the other.
LISM:
But then, have you good code using or making a temp table or table variable.
What is a table variable?
Please read up books online on these topics. They have a much better explanation than what I can type.
No comments:
Post a Comment