|
Posted by --CELKO-- on 03/02/06 18:51
You have no key on Users and no way to get a key since all the columns
are NULL-able. IDENTITY cannot be a key **by definition**. Next, why
are all the columns set to a magical VARCHAR (255) data type? How much
research did you do to come up with that number? Why are there no
constraints on any column?
Why do you use such vague data element names, like "tipo" (of what?),
"email" (address? provider? what?)
Again, going back to the basics, a table has a fixed number of columns
**by definition**. Your request makes no sense in an RDBMS. You can
insert a defualt value into a column, but not just "the first 5 columns
from each the table".
If you have a proper RDBMS design, you should never need them in
99.9999% of the time. I am also trying to figure how the same data got
into 30+ tables. A table should model one and only one kind of entity.
Next, stop using cursors and dynamic SQL. It says that you have a file
system written in SQL instead of an RDBMS. Your use of IDENTITY is a
replacment for a sequentail record number. You will wind up locating
your columns by ordinal positions, instead in by names. That is a
sequential file!! Why use SQL, if you are goiing to program like this?
[Back to original message]
|