2013-04-13 59 views
0

我只是想知道如何創建一個基於現有的表列的新表:如何使用SQL-Server基於現有表中的字段創建新表?

Current Table name : EmployeeDetails 
Columns: empName, Address, pincode, state, city 
Primary key is : pincode 

我想從EmployeeDetails創建新表:

New Table name : Information 
column :pincode, state, city ---> from EmployeeDetails table 
+0

有效的問題,但之前已經詢問過很多類似的問題 – whytheq

回答

3

您可以使用select ... into

select pincode 
,  state 
,  city 
into Information 
from EmployeeDetails 
+1

已將'1個新答案發布到此問題'中當我移動鼠標提交我的*完全相同的答案*。唯一的區別是SQL的格式。 :-) +1。 –

相關問題