Babu_Moshai Posted August 16, 2017 Report Posted August 16, 2017 Vuncles need some helf with my assignment. DB course lo maaku Teradata isntall sesuko mananru. one question is that oka exisiting table with data ki identity column add cheyyali. unna records ki aa column oka default value ichi next insert row nunchi populate cheyyali Quote
Suhaas Posted August 16, 2017 Report Posted August 16, 2017 Technically, you cannot add an identity column to an existing table or add an identity attribute to an existing column bro. (For Teradata SQL) The round about way is to create a new table with same schema plus added identity column, insert the data and rename to swap both table names. Quote
RachaRaja Posted August 16, 2017 Report Posted August 16, 2017 You can add an identity column using the code below: ALTER TABLE MyTable ADD ID INT IDENTITY(1,1) NOT NULL After you do this one, every new row that you insert, the identity column will be incremented by 1. Quote
Suhaas Posted August 16, 2017 Report Posted August 16, 2017 2 minutes ago, RachaRaja said: You can add an identity column using the code below: ALTER TABLE MyTable ADD ID INT IDENTITY(1,1) NOT NULL After you do this one, every new row that you insert, the identity column will be incremented by 1. Bro, Are you sure this works for Teradata? I know it works for MS SQL Server and Other SQL based DBs/DWs but I don't think it works for Teradata Bro. Quote
Gio Posted August 16, 2017 Report Posted August 16, 2017 24 minutes ago, Babu_Moshai said: Vuncles need some helf with my assignment. DB course lo maaku Teradata isntall sesuko mananru. one question is that oka exisiting table with data ki identity column add cheyyali. unna records ki aa column oka default value ichi next insert row nunchi populate cheyyali You can not alter existence table bro create new table only option Quote
Gio Posted August 16, 2017 Report Posted August 16, 2017 1 minute ago, Suhaas said: Bro, Are you sure this works for Teradata? I know it works for MS SQL Server and Other SQL based DBs/DWs but I don't think it works for Teradata Bro. It won't work bro 1 Quote
Suhaas Posted August 16, 2017 Report Posted August 16, 2017 Just now, Gio said: It won't work bro Yep. Just making sure bro. Thank you. Quote
RachaRaja Posted August 16, 2017 Report Posted August 16, 2017 5 minutes ago, Suhaas said: Bro, Are you sure this works for Teradata? I know it works for MS SQL Server and Other SQL based DBs/DWs but I don't think it works for Teradata Bro. Yeah you are right. This is not possible in teradata. It only works for SQL. My bad. You got only one option is to create a new schema with identity column. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.