Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8977345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:20:57+00:00 2026-06-15T19:20:57+00:00

I am writing a .NET utility that automatically backs up data from a source

  • 0

I am writing a .NET utility that automatically backs up data from a source table to a history table on an hourly basis. If the archive table doesn’t exist, it has to be programatically created. Usually, the SQL of create db.historytable as db.sourcetable with no data does the trick. However, create table as does not work on tables that use identity columns. This means that you have to get the source table’s DDL, change the table’s name, and then change the identity column into an integer (because we don’t want the history table to use an identity column) before running the new DDL.

If I could get a column-level DDL for the definitions of each column in a table then I could iterate through that using a DataReader and rebuild the DDL. If the COLUMNTYPE is 2 (2 is identity column) then I will know to modify that column’s definition from:

ID INTEGER GENERATED BY DEFAULT AS IDENTITY
   (START WITH 1 
    INCREMENT BY 1 
    MINVALUE 0 
    MAXVALUE 100000000 
    NO CYCLE)

..to just:

ID INTEGER

The other options which I am only interested in tryout out as a last resort are 1) using a complex regex to replace the identity column definition with a regular INTEGER or 2) query dbc.columns and dbc.tables and use the metadata there to build the entire table’s DDL from scratch.

Essentially, I am hoping that I there is something conceptually like dbc.columnddl that I can join to dbc.columns, but I am taking a long shot at that, I know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:20:58+00:00Added an answer on June 15, 2026 at 7:20 pm

    AFAIK, there’s no ‘column DDL’ in the format you’re looking for in Teradata data dictionary. You’ll have to reconstruct types etc from DBC.Columns, as you suggested.

    Also, you might find this useful: here’s how to get a list of all tables with identity columns in the system:

    locking row for access select  trim (d.databasename) || '.' || trim(v.TVMName)
    FROM DBC.IdCol id, DBC.TVM v, dbc.dbase d
    where 1=1
    and id.tableid = v.TVMId
    and v.TableKind='T'
    and id.databaseid = d.databaseid
    and d.databasename <> 'DBC'
    ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a .NET command-line application that will migrate users from an existing database
I am writing a .NET application that writes data to SQL Server 2008r2. I
I'm writing an FTP client plugin for a open source ETL utility (Pentaho Data
I am writing .NET 4 application, witch synchronize data. I want to use Firebird
I am writing a .NET WinForms application that needs to display a list of
I'm writing in .NET a windows service that, at windows startup, executes some network
I am writing a .NET 2.0 based desktop client that will send large files
When writing programs (C#.NET) I'll commonly use external libraries I've downloaded from various websites
I'm writing a custom web app (an administrative utility) that queries a SQL Server
I'm writing a .NET application that will make an RPC call to a Java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.