Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to create tables(using stored procedures) while creating a job for archiving or backup

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-30 : 09:45:59
ashok writes "How to create new tables or database using stored procedure when I schedule a job for backup. I need to create 4 tables for each quarter in each year (run time tables)."

nr
SQLTeam MVY

12543 Posts

Posted - 2002-05-30 : 10:46:40
Wouldn't advise this - if you change a schema I would want to run it manually after taking a backup and restart the server afterwards.

If you must you can include a create table statement in a stored procedure or use osql to run a script stored in a text file.

If the tables are based on existing ones you can

select * into newtbl from oldtbl where 1 = 0
to create the table with the same structure but no data.

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -