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)
 Date in table name

Author  Topic 

memarcie
Yak Posting Veteran

91 Posts

Posted - 2008-01-04 : 09:50:52
Can I append a date into a table name ?

Such as:

select field1
into feeschedule_mmddyyyy
from feeschedules

where mmddyyyy is the current date.

Is this possible and how?

Thanks,
Marcie

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-01-04 : 09:54:18
You mean while creating table?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

memarcie
Yak Posting Veteran

91 Posts

Posted - 2008-01-04 : 09:56:07
yes while creating the temporary table
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-01-04 : 10:06:24
Yes but only using dynamic sql like this:

declare @a varchar(2000)

set @a = 'select * into dbo.tbl' + convert(varchar(10), getdate(), 112) + ' from sometable'

exec(@a)


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -