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 |
|
stonebreaker
Yak Posting Veteran
92 Posts |
Posted - 2010-01-19 : 10:25:31
|
| I am running the following:declare @XML as XMLset @XML = <xml data>select x.item.query(<data>) as FormName, x.item.query(<data>) as FormDescription,...... x.item.query(<data>) as FieldStatusCodeINTO #TempSmartFormDefinitionFROM @xml.nodes('SmartFormDefinitions/SmartFormDefinition/Section/Field') as X(Item)There are 91 rows of xml data. It takes about 2 min 30 sec to run this insert statement. When I run the select without the insert, it takes 6 seconds. I'm not sure where to start looking for the bottleneck - any suggestions?thanks, |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2010-01-19 : 12:27:30
|
| have you tried creating the temp table first and doing an INSERT INTO and see if there is a difference?<><><><><><><><><><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
stonebreaker
Yak Posting Veteran
92 Posts |
Posted - 2010-01-19 : 13:27:26
|
| When I ran the query on a different server, it ran in 5 seconds.StonebreakerThe greatest obstacle to discovery is not ignorance - it is the illusion of knowledge. -Daniel Boorstin |
 |
|
|
stonebreaker
Yak Posting Veteran
92 Posts |
Posted - 2010-01-19 : 14:22:36
|
| Also, the query runs fine on the original server if I do not insert the select into a temp table.StonebreakerThe greatest obstacle to discovery is not ignorance - it is the illusion of knowledge. -Daniel Boorstin |
 |
|
|
|
|
|