Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kt
Yak Posting Veteran
88 Posts |
Posted - 2013-09-17 : 11:26:50
|
Hi,i am try to insert the results from the query into new temp table but keep geeting an error for Incorrect syntax near ')'. Would you please tell me what did i have wrong from this query?Thanksselect * into tempCostingfrom ( select top 10* from itemCode itm where itm.type= 1 ) |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2013-09-17 : 11:32:56
|
Name the table expression with an alias.select * into tempCostingfrom (select top 10* from itemCode itmwhere itm.type= 1) AS x Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
kt
Yak Posting Veteran
88 Posts |
Posted - 2013-09-17 : 11:39:05
|
didn't think about this, thank you. |
|
|
sigmas
Posting Yak Master
172 Posts |
Posted - 2013-09-17 : 11:41:36
|
just simplify.select top 10 * into tempCostingfrom itemCodewhere type= 1; |
|
|
|
|
|