When I want to copy and create a table with no data, but stats, I run the following
SEL 'CT newdb'||'.'||TRIM(TableName)||' AS '||trim(databasename)||'.'||TRIM(TableName)||' WITH NO DATA AND STATS'||';' from DBC.TablesV where databasename='olddb'
I select the result>delete the database> then run the output of that first select statement
When I want to copy and create view, I am receiving error on SQLA
Create view Failed:3707; Syntax error, expected something like a 'SELECT' keyword or a 'lock' keyword or '(' or a 'TRANSACTIONTIME' keyword between the 'AS' keyword and the word ' olddb'
How can I fix the first script above? I replaced CV/Create View from CT, but that doesn't help
Not sure about your SQL to pull the View, but the one used with tables won't work.
You should do 'SHOW VIEW' statements instead and redirect them to a file.