Re: Temp Table

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Cristian Babu (cristian.babu_at_softwaresolutions.ro)
Date: 09/09/04


Date: Thu, 9 Sep 2004 11:34:19 +0200

try this:

select cast(1 as int) as col1, cast(null as char(1)) as col2 into #t

hth,
Cristian Babu

"Justin Drennan" <justin@none.com> wrote in message
news:Z8OdndnUeLvLjt3cRVn-qw@is.co.za...
> How do I specify the field type when creating a temp table?
>
> (I am doing a Select into statement)
>
> Thanks
>
>



Relevant Pages

  • Re: Temp Table
    ... The field type of the temp table when using select into statement is the ... Gabriel Anton ... > How do I specify the field type when creating a temp table? ...
    (microsoft.public.sqlserver.programming)
  • Re: Null in select list
    ... So apparently, the table #temp has two columns, and the Select List will ... to confuse the reader and potentially "lie" about the column in which ... it would be better to remove the alias here. ... bad practice to not specify the columns in the INSERT statement. ...
    (microsoft.public.sqlserver.programming)
  • Re: max and min help.
    ... and column H is my Temp. ... "Don Guillett" wrote: ... > What i want to do is specify a date and have it give me the max and min> of ... > readings. ...
    (microsoft.public.excel.misc)
  • Re: DISTINCT and ORDER BY
    ... >INSERT INTO #temp ... >ORDER BY A.ArrAprtCd ASC ... Even using order by doesn't guarantee that the rows will be ... inserted in the order you specify. ...
    (microsoft.public.sqlserver.programming)
  • Re: water tank design
    ... At what temperature is that? ... When we get down to the .0x lbs. ... we better specify the temp and the value of G. :-) ...
    (rec.crafts.metalworking)