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
 Transact-SQL (2000)
 how can i select from temp table

Author  Topic 

bonbon
Starting Member

3 Posts

Posted - 2005-07-21 : 04:13:18
how cam i select from temp table ? i seached for that topic but i wrote that script but unfortunatly, it doesn't work. i don't know why

CREATE TABLE #TEMP (DOMAIN_NAME NVARCHAR(1024) , SITE_ID BIGINT)

INSERT INTO #TEMP(DOMAIN_NAME ,SITE_ID)
SELECT DOMAINS.DOMAIN_NAME ,CP_HOSTING.Site_id FROM CP_HOSTING, DOMAINS
WHERE CP_HOSTING.DOMAIN_ID = DOMAINS.DOMAIN_ID AND CP_HOSTING.LRN2B_ID=@LRN2B_ID AND DOMAINS.domain_type <>2

SELECT DOMAIN_NAME FROM #TEMP

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-21 : 04:19:23
Did you get any error?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-07-21 : 06:22:14
does your select even return any rows??
you can also do this:
SELECT DOMAINS.DOMAIN_NAME ,CP_HOSTING.Site_id
INTO #temp
FROM CP_HOSTING, DOMAINS
WHERE CP_HOSTING.DOMAIN_ID = DOMAINS.DOMAIN_ID AND CP_HOSTING.LRN2B_ID=@LRN2B_ID AND DOMAINS.domain_type <>2

SELECT DOMAIN_NAME FROM #temp

Go with the flow & have fun! Else fight the flow
Go to Top of Page

kapilarya
Yak Posting Veteran

86 Posts

Posted - 2005-07-21 : 07:32:50
Please Check your select query, is select query returing you any value.
Go to Top of Page
   

- Advertisement -