May 13, 2009 at 4:13 pm
Hi guys,
I am looking to create a smaller database for portability from a large database.
The method I am using is SELECT * INTO statements, with where clauses to restrict the amount of data going in.
The problem I've had is that the database created is soooo sloooowww with the application. And I can't work out why.
I have even tried to do the whole database without where clauses, and it is still slow. Is there something not being brought across in the SELECT * INTO statements ?
Is there a better way to do it ? Or am I looking in the wrong place for a solution.
Many thanks.
Matthew
May 13, 2009 at 4:21 pm
The select * into method will only create the table structure not any indexes or primary keys. Tables without indexes are going to slow. That is the first place I'd suggest looking or reading up on.
David
May 14, 2009 at 7:06 am
You should probably try generating the database as a script, recreate it, empty, and then migrate the data over. You could continue using SELECT statements or you might want to explore batch export/import through sqlcmd or SSIS, either of which could be much more efficient.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
May 15, 2009 at 4:42 am
Thanks for all your help, I shall be reading up in this then.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply