Hi,a sql language question

hi,everyone
How can I Create a temporary table:have a row (the row's evaluation have a value automatically .for example 。the first one is 1,the second is 2,the third is 3,and so on ),How can I do,please help
[224 byte] By [yhw19850401] at [2007-11-20 8:19:07]
# 1 Re: Hi,a sql language question
1) Better Asked in the Database Forum (I have asked moderator to move)
2) Answers depend on which Sql implementation you are using..
TheCPUWizard at 2007-11-9 13:45:15 >
# 2 Re: Hi,a sql language question
[ Moved Thread ]
Ejaz at 2007-11-9 13:46:16 >
# 3 Re: Hi,a sql language question
hi,everyone
How can I Create a temporary table:have a row (the row's evaluation have a value automatically .for example 。the first one is 1,the second is 2,the third is 3,and so on ),How can I do,please help
Which Database are you talking about?
Shuja Ali at 2007-11-9 13:47:14 >
# 4 Re: Hi,a sql language question
a original database ,have a table,the column of the table are name,age and so on.I shoud select the name from the table ,and add a column ,the evaluation have a value automatically .for example 。the first one is 1,the second is 2,the third is 3,and so on ),
yhw19850401 at 2007-11-9 13:48:20 >
# 5 Re: Hi,a sql language question
Shuja Ali & TheCPUWizard Means is what database are you using? MS Access, SQL Server, Oracle, MySQL or any other.
Ejaz at 2007-11-9 13:49:19 >
# 6 Re: Hi,a sql language question
oh,is the MS SQL Server2000
yhw19850401 at 2007-11-9 13:50:19 >
# 7 Re: Hi,a sql language question
Here is how you would create a temporary table Create Table #myTempTable (
[IDENTITYCOLUMN] [bigint] IDENTITY (1, 1) NOT NULL ,
[NAME] varchar(50),
[AGE] int
)

And to Insert records into the temporary table you can use Insert Into #myTempTable ([NAME], [AGE]) Select [NAME], [AGE] From ORIGINAL Table

This will insert all the records from ORIGINALTABLE into the temporary table and the IDENTITYCOLUMN field of the temporary table will contain autoincremented numbers.
Shuja Ali at 2007-11-9 13:51:23 >
# 8 Re: Hi,a sql language question
yhw19850401
is the issue solved?
pranay at 2007-11-9 13:52:26 >
# 9 Re: Hi,a sql language question
Thanke you ,everybody ,the question is over
yhw19850401 at 2007-11-9 13:53:24 >