November 14, 2018 at 9:59 am
Roy, I would suggest you look at some of the Stairway articles on this site (see link at top left). You can pick out the topics you need and try things out as you go.
November 18, 2018 at 10:49 am
I think you really need to step back and get a decent book on data modeling before you try writing SQL. Did you know that a table has to have a key? But none of your DDL does nor can it ever have a key, because everything's nullable. Sizing strings out the to the proprietary NVARCHAR(MAX) is a waste of resources and you've lost one of the best constraints you have in protecting the integrity of your data. In fact you have no constraints at all.
Your conceptual problem is probably from an 00 or magnetic tape file background. In RDBMS we postulate a universe of discourse (remember that from formal logic?) In which we know the entities and the relationships. We then put data into the schemas and work with them. The idea of spontaneously creating new tables (entities or relationships) on the fly is like a magical world in which elephants can be dropped out of the sky.
What you want your procedure to do is basically hang a new magnetic tape on a 1950's Tape Drive, so you can write data to it. SQL is based on sets, and sets are persistent. We also don't put metadata in table names. In fact using "tb_" or "tbl_" is a design error called a Tibble. Phil factor has written some columns and humor pieces about people who do this. .
What are you actually trying to do
Please post DDL and follow ANSI/ISO standards when asking for help.
Viewing 2 posts - 16 through 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply