All Forums UDA
Bohica 10 posts Joined 07/08
08 Jan 2009
Looking for dynamic SQL for cloning stats from a table.

Does anyone have a sql that will clone stats for a table?

joedsilva 505 posts Joined 07/05
09 Jan 2009

depends ...if you want to duplicate an entire table with its stats,create table a as b with data and stats;but if you already have the table structure in place and copy over the stats definitions and values, you can do it using tset. (The .col file that tset generates has the collect stats sqls which inserts the stats)

JvR 5 posts Joined 09/06
14 Jan 2009

There is also a macro by Dieter Noeth called GEN_DB_COLLSTATS which can be used for this purpose. It generates the collect statistics-statements for tables in a database. I think I got that one from the "other" Teradata_forums...Good luck,Jos van RaamsdonkSNS-bankNetherlands.

You must sign in to leave a comment.