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)
 Dynamic SQL ?

Author  Topic 

nemohm
Yak Posting Veteran

69 Posts

Posted - 2003-05-01 : 16:32:38
Hi,

I have a new table that is generated every day, and these tables always have the same definition.

How can I specify the name of the table at runtime?
Dynamic SQL is the tool?
How to implement it when the name of the table is in sysobjects, and need everything from a table created yesterday?

Select *
From (SELECT name
FROM sysobjects
WHERE crdate>DATEADD(day, -1,GETDATE())


The subquery returns the right table name.

(I’m not familiar with dynamic SQL, neither with advanced SQL)

Thx,

Dobby

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-05-01 : 16:45:04
Please do not post in multiple forums:

[url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=25869[/url]

Tara
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-05-01 : 16:46:33
Go Tara Go

Go Tara Go



Brett

8-)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-05-01 : 16:48:23
quote:

Go Tara Go

Go Tara Go



Brett

8-)





Tara
Go to Top of Page
   

- Advertisement -