Thank you very much. I haven't tried this yet... I am still preparing. I was very confused since I know little about SQL and nothing about SQL utilities. You have really given a nice overview of what the bcp utility is, what it does and a good start on how to use it.
Hi im new to sql, just wondering if theres a way to use bcp to export multiple tables into a text file or do i have to do it table by table? For my case all the tables are under the same schema
i have a situation where i have a data in dataset which has to be loaded into sql server sitting on windows wich is a different machine .How to use this bcp in that case and run my datastage.
Mam, CMD universal for all, START>RUN>CMD. You can also run CMD commands embedded in T-SQL using xp_cmdshell refer my video post Execute BCP Via TSQL (SQL Server)
xp_cmdshell { 'command_string' } [ , no_output ] You can (if it is enabled on your server) execute cmd shell specifically from SSMS - just put EXECUTE xp_cmdshell , as e.g. xp_cmdshell 'bcp.... in/out...' . You can specify variable which will be holding string with BCP command and then slice it to e.g. export list of tables in a WHILE LOOP. But for basic bcp I really like to use xp_cmdshell than running cmd. Answering your question more precisely - you can either use above or start-> cmd (or win+r and type cmd).
C:\Users\Punit Setia>BCP employee.dbo.Employees OUT D:\Employees.txt -T -c SQLState = S0002, NativeError = 208 Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'employee.dbo.Employees'. SQLState = 37000, NativeError = 11529 Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The metadata could not be determined because every code path results in an error; see previous errors for some of these. How to resolve this problem???
I'm new into SQL database and see your video very touching and also knowledgeable to us. Thanks a lot for your help.
Thank you very much. I haven't tried this yet... I am still preparing. I was very confused since I know little about SQL and nothing about SQL utilities. You have really given a nice overview of what the bcp utility is, what it does and a good start on how to use it.
Awesome tutorial. After going through this video, understanding MSDN is a piece of cake.
Thanks a lot.
Hi Keshav,
Can you please tell us how to fetch data in csv file with header in different column in bcp
Many thanks in advance..
Thanks for your video. Can we have a join query to pull the data out to a file???
Hi im new to sql, just wondering if theres a way to use bcp to export multiple tables into a text file or do i have to do it table by table? For my case all the tables are under the same schema
the data include header?
Hi... To review LoaderDataPlus tool to import CSV files and then can be to import in SQLSERVER sintax and other DMBS.
this only works if in the first place the database is sitting inside your user profile. So what happens if i need to execute this from user machine ?
I get a error saying "Login Timeout Expired".Checked the SQL connection it was connected. Are we supposed to create a folder BCP in advance?
very very thanx bro. It helped me allot. make videos on performance tuning bro.
i have a situation where i have a data in dataset which has to be loaded into sql server sitting on windows wich is a different machine .How to use this bcp in that case and run my datastage.
I'm trying to use the queryout command but it gives me an error: "An error occurred while processing the command line."
How do I fix it?
Thank you, was very useful and help me out big time!
How to make it run auto in window task scheduler?
if changed to d:\abc\bcp\output.txt , can not make it work
Awesome tutorial, thank you
Hi this one will work in Sybase
Mam, CMD universal for all, START>RUN>CMD. You can also run CMD commands embedded in T-SQL using xp_cmdshell refer my video post Execute BCP Via TSQL (SQL Server)
Keshav Singh hi I want a simple query to export my query result to my local drive using dcp. Can u please provide code
ok, cmd shell is enabled, what's next step
it would be better if complete ssis tutorial is provided in serial wise
very good video, thanks!
its says cannot open database requested by login.
Nice tutorial bro!!
Keshav, how do i start cmd is through SSMS or start run cmd
xp_cmdshell { 'command_string' } [ , no_output ]
You can (if it is enabled on your server) execute cmd shell specifically from SSMS - just put EXECUTE xp_cmdshell , as e.g. xp_cmdshell 'bcp.... in/out...' . You can specify variable which will be holding string with BCP command and then slice it to e.g. export list of tables in a WHILE LOOP. But for basic bcp I really like to use xp_cmdshell than running cmd.
Answering your question more precisely - you can either use above or start-> cmd (or win+r and type cmd).
Perfect, thanks
Love yr Tut ...
nice video.. good job bro..
Thank you!!!
C:\Users\Punit Setia>BCP employee.dbo.Employees OUT D:\Employees.txt -T -c
SQLState = S0002, NativeError = 208
Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'employee.dbo.Employees'.
SQLState = 37000, NativeError = 11529
Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The metadata could not be determined because every code path results in an error; see previous errors for some of these.
How to resolve this problem???
Getting similar error
How did you resolved it
refer my video post Execute BCP Via TSQL (SQL Server)