I have an SQL table already, the format of which I just want duplicating for testing purposes. I tried the following:
DECLARE @Counter AS INT(1)
WHILE ( @Counter <= 10)
BEGIN
CREATE TABLE my_new_big_table
AS (SELECT * FROM my_table)
SET @Counter = @Counter +1
END;
However I encounter an error with 'DECLARE'
ParseException:
[PARSE_SYNTAX_ERROR] Syntax error at or near 'DECLARE'(line 1, pos 0)
Is this the best approach to duplicate an existing table?