• CELKO (4/21/2015)


    I am getting error when I am trying to create table on runtime

    Please, please read any book on data modeling. A schema is supposed to be a model of a "universe of discourse" (remember that from your first course in Logic?). Each table is either a set of entities or relationships among entities. Each table has to have a key by definition.

    But you live in a magical Universe where you can create things from nothing! Elephants drop out of the sky for you! What you are doing is re-inventing magnetic tape files in SQL. In the 1960's, we used hang a fresh new tape on a drive and give it a label based on the current date! WOW! Just what you are doing now!

    Then to make things worse, you used IDENTITY. This is a physical count of the physical insertions to this one table on this one machine. It is how you can fake a 1960's tape file record number.

    Oh, “getdate()” is an old Sybase/UNIX construct that was replaced a few years ago with the ANSI/ISO Standard CURRENT_TIMESTAMP today. You did the wrong and did it badly. You need to stop programming until you know the most basic RDBMS concepts; you are dangerous to any employer.

    I am going to paraphrase this statement you made:

    You need to stop programming until you know the most basic RDBMS concepts; you are dangerous to any employer.

    Here it is:

    You need to stop trying to help less experienced individuals until you learn to be a real mentor; you are dangerous to any newbie.