English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

ex : a user will enter a name , this name will be that of the table
using C# and sql server

2006-06-05 13:59:30 · 3 answers · asked by raflawy 3 in Computers & Internet Programming & Design

3 answers

Hi,

For that situation it would be really absurd to do this. Remember Todays relational databases have no limitation on size, so unless your records are billions in length, you don't need to worry about the size of your table.

It is better to have a User table and all users will be within it. Don't worry people are running tables with the proper optimization that have billions of rows ~terabytes of data!

But back to your question:
ALTER SCHEMA dbo TRANSFER Schema.TableName

I think that is your query...

sp_changeobjectowner doesn't work actually in SqlServer 2005. You have to use ALTER SCHEMA.

from BOL:
ALTER SCHEMA schema_name TRANSFER securable_name

2006-06-05 14:19:16 · answer #1 · answered by ? 6 · 0 0

if you want a user to have only permission for a table

have a user_perm table with 2 columns:
userid ----table_name
--------------------------
112244----table_112244
3334487--table_3334487

and create a trigger to not allow any other user to add, modify or edit the table data.

You don't want table names such as:
"Mary_Jane"
"John_Doe"

what happens with common names???

"John Smith".


futher more, how many users ? over 1000 Do you want to maintain 1000 tables???

before adding tables- always design your database- even if it is just on paper:
http://databases.about.com/od/specificproducts/a/normalization.htm

2006-06-06 21:07:04 · answer #2 · answered by rmpbklyn 4 · 0 0

in SQL Server the renaming of tables is done by

"EXEC sp_rename 'Old_TableName', 'New_TableName'"

2006-06-06 02:38:31 · answer #3 · answered by programmer 4 · 0 0

fedest.com, questions and answers