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)
 Stored Procedure question

Author  Topic 

Swede
Yak Posting Veteran

74 Posts

Posted - 2002-01-09 : 10:23:52
CREATE TABLE #TempItems
(
news_id int IDENTITY,
news_date datetime,
news_title text
)

Within a stored procedure, I am creating a temporary table as shown above. What I am wondering, because I get such a cryptic errormessage when using this SP in ASP later is if the word #TempItems is an internal SQL name for a temporary table or if I should enter my own name for it?

=====================================
Why not try and do the impossible?

Nazim
A custom title

1408 Posts

Posted - 2002-01-09 : 10:32:29
Name of the Table isnt a problem. you can have reserve words names in temp tables

so, this will also perfectly work.
CREATE TABLE #select
(
news_id int IDENTITY,
news_date datetime,
news_title text
)
but i strongly recommend dont you such names. what is the error message you are getting.What are you trying to do. y dont u use a varchar column for news_title?.



----------------------------
Anything that Doesn't Kills you Makes you Stronger


Edited by - Nazim on 01/09/2002 10:35:39
Go to Top of Page

Swede
Yak Posting Veteran

74 Posts

Posted - 2002-01-09 : 10:42:26
I will use a varchar later

The message I got was that it tried to find a field called ID, and it couldnt...

Well, seems I just got it working... Very odd indeed... Thanks anyway though...

=====================================
Why not try and do the impossible?
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-01-09 : 13:08:16
Swede,

Just a heads-up, on what Nazim was mentioning... Text fields in SQL are large binary fields, storing up to 2 GB of info. They have their own set of special handling (read, special headaches) that come along with them, so if your field will be smaller than 8000 characters (the limit for varchar) then varchar will be a lot easier to work with.

In Access, a Text field corresponds to a varchar in SQL. In Access, a Memo field corresponds to (or is converted to) a Text field in SQL.

(Have I mentioned how much I love Microsoft? Nah, didn't think so.)

Edited by - AjarnMark on 01/09/2002 13:10:22
Go to Top of Page

Swede
Yak Posting Veteran

74 Posts

Posted - 2002-01-10 : 07:51:55
It's all converted to varchar now...

=====================================
Why not try and do the impossible?

Edited by - Swede on 01/10/2002 08:11:28
Go to Top of Page
   

- Advertisement -