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 2000 Forums
 SQL Server Development (2000)
 BCP Question

Author  Topic 

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-05-07 : 15:22:49
Lets say I have a BCP command to dump a bunch of rows to a text file located on the SQL server.]

Would this BCP command run faster if I were to run it through QA or a client app on the SQL Server VS running it on a machine OTHER than the SQL server?

I think that it doesn't matter where I run it, the SQL server is doing all the Disk and CPU operations to make that file.

Am I right? I really would hate to run something on my clustered SQL server becuase I've never written cluster-aware applications.

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-07 : 15:25:03
It would be faster to run it on the database server, but only because you wouldn't have to return the result set over the network. I would bet that the difference between running it on the database server or from another machine is very minimal. It would just depend on the number of rows.

Tara
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-05-07 : 15:31:50
Now that I think about it, the file does get written at the client and not the server. Hmmmm, that's a problem methinks.

We are talking about 100,000 rows a day exporting to a file. I think I might run into problems with UNC paths and permissions. This just became more difficult than I thought.

Thanks for the info Tara!

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-07 : 15:35:05
Your application could kick off a job so that the file is created on the database server. The application would wait until the job is done then pull the file. I'm not sure that this approach would be any faster though, but at least the application wouldn't have to run on the database server.

Tara
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-05-07 : 15:36:15
Gotcha, thanks Tara!

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-07 : 20:06:28
Using a format file for exports complictes matters - I've never used one.
I usually create the output in a single column table and bcp that out. Makes dev easier as you can just look at the table rather than having to open the file.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -