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
# 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..
# 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?
# 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 ),
# 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
# 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.
# 9 Re: Hi,a sql language question
Thanke you ,everybody ,the question is over