I create a temporary table like this:
select legalname into #tempname from company
How do I know what's the data type of legalname in #tempname?"wdwedw" <wdwedw@.discussions.microsoft.com> wrote in message
news:1C3A4B56-72D0-4172-A1E6-D5C357286095@.microsoft.com...
>I create a temporary table like this:
> select legalname into #tempname from company
> How do I know what's the data type of legalname in #tempname?
It should be the same as what is in company.
Rick Sawtell
MCT, MCSD , MCDBA|||Select tempdb database from query analyzer
and do
sp_help #tempname
Prad
"wdwedw" <wdwedw@.discussions.microsoft.com> wrote in message
news:1C3A4B56-72D0-4172-A1E6-D5C357286095@.microsoft.com...
>I create a temporary table like this:
> select legalname into #tempname from company
> How do I know what's the data type of legalname in #tempname?|||exec tempdb..sp_help #tempname
Why do you not know the data type of legalname in company, since company is
a fixed object in your schema?
"wdwedw" <wdwedw@.discussions.microsoft.com> wrote in message
news:1C3A4B56-72D0-4172-A1E6-D5C357286095@.microsoft.com...
>I create a temporary table like this:
> select legalname into #tempname from company
> How do I know what's the data type of legalname in #tempname?|||Try,
create table #t1 (
c1 int
)
select
column_name,
data_type
from
tempdb.information_schema.columns
where
object_id(table_catalog + '.' + table_schema + '.' + quotename(table_name))
= object_id('tempdb..#t1')
and column_name = 'c1'
drop table #t1
go
AMB
"wdwedw" wrote:
> I create a temporary table like this:
> select legalname into #tempname from company
> How do I know what's the data type of legalname in #tempname?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment