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 2005 Forums
 Transact-SQL (2005)
 Create a Table with Date And Time

Author  Topic 

Steve2106
Posting Yak Master

183 Posts

Posted - 2011-03-09 : 06:09:45
Hi There,

I need to create a table with the current date and time in the table name.

Is there a way to do that. I.E.
CREATE TABLE dbo.SearchedData090320111110(
...
...
)

Thanks for any help you can give.

Best Regards,


Steve

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2011-03-09 : 07:05:47
Yes it can be done using dynamic SQL but dynamic sql have its own pros and cons.

What is your actual requirement ? May be we can suggest better solution.
Go to Top of Page

ZZartin
Starting Member

30 Posts

Posted - 2011-03-09 : 11:27:25
Just out of curiousity, how often are you creating tables that wouldn't just do this manually?
Go to Top of Page

Steve2106
Posting Yak Master

183 Posts

Posted - 2011-03-10 : 04:46:36
Hi,

Thanks for your input.
I have decided to do this a different way.

With a view I think.

Thanks for taking the time to help, I appreciate it.

Best Regards,

Steve.


Steve
Go to Top of Page
   

- Advertisement -