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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Parallellism?

Author  Topic 

sql_server_dba
Posting Yak Master

167 Posts

Posted - 2011-02-04 : 11:24:59
Maybe this is some stupid question..but just want to know if there is any luck for me...

I am using bcp out to extract the data from a view. The query in the view is horrible(takes 3 hours) :(. So is there a way to use MAXDOP option for a specific bcp? The bcp script which i am using is show below...

bcp databaseName..tableName out "c:\tableName.txt" -c -T -S SERVERNAME

any help would be really appreciated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-02-04 : 12:11:10
Has changing MAXDOP for this query been proven to help with the performance of it?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sql_server_dba
Posting Yak Master

167 Posts

Posted - 2011-02-04 : 13:46:54
YES...a lottt
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-02-04 : 13:48:25
Is MAXDOP not allowed in a view?

What's your server's maxdop setting? Is your system OLTP or a warehouse?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sql_server_dba
Posting Yak Master

167 Posts

Posted - 2011-02-04 : 14:08:58
no...MAXDOP is not allowed in a view :(.

Our system is a data warehouse and i cannot make any changes for MAXDOP at server level.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-02-04 : 14:18:12
I can't think of a way to fix this with bcp. You could alternatively use SSIS which would allow you to put your query directly in there with MAXDOP and not need a view.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sql_server_dba
Posting Yak Master

167 Posts

Posted - 2011-02-04 : 16:14:50
OK..thanks for your reply though.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-02-04 : 16:40:54
How about:

bcp "select * from databaseName..tableName OPTION (MAXDOP 1)" queryout "c:\tableName.txt" -c -T -S SERVERNAME
Go to Top of Page

sql_server_dba
Posting Yak Master

167 Posts

Posted - 2011-02-04 : 19:30:14
wow..i guess it should work....i will give it a shot. Thanks!!
Go to Top of Page
   

- Advertisement -