Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

BCP OUT tables from any database

By SanjayAttray,

This script will help DBA's who wants to BCP out required tables form any database. This script can be run through as a job. Before running you have to create a table in any given database and store the table names in it, which you want to Bulk copy. Query in this procedure will check the table for table names and will copy data in .txt files and store the out put in given path.

(You can change the paths for storing the out put and data text files. Also change the database name. By default I have given pubs..)

Total article views: 267 | Views in the last 30 days: 2
Related Articles

SQL Script to search stored procedures containing a given text

Sometimes we need to find out how many stored procedures contains a given text. Below SQL query can ...


minimum roles (server/database) should be given to a user to run jobs

minimum roles (server/database) should be given to a user to run jobs


stored procedures in a database

stored procedures in a database


Synonym-Given String

Sql Server Query -help(Synonym for Given String)


"USE DATABASE" in stored procedure workaround?

2 customer databases using the same stored procedure


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones