Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

Format File Creation

HI Experts,

Accodring to this example: http://www.databasejournal.com/features/mssql/article.php/3663631/SQL-Server-2005-Integration-Services---Part-45---Bulk-Insert-Task-and-Format-Files.htm

to get the xml  format file you use this bcp cmd:

bcp AdventureWorks.HumanResources.myTeam format nul -c -t , -f myTeam.XML -x -T

However, encountered this error:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.'.

Same goes for :

bcp AdventureWorks.HumanResources.myTeam format nul -c -t , -f myTeam.Fmt -T

Any ideas?
0
allanau20
Asked:
allanau20
  • 5
1 Solution
 
MohammedUCommented:
From where you are running the bcp command?
If you have not tried from command window then try it...
0
 
allanau20Author Commented:
oh, I tried it in Management Studio.
When I ran the script above I cannot find the file on my puter. Even tried local drive and network folder, but no see fmt file.
Do you know where the file is?

TIA!
0
 
allanau20Author Commented:
actually, i got this err:

C:\Data>bcp AdventureWorks.HumanResources.myTeam format nul -c -t , -f c:\data\m
yTeam.Fmt -T
SQLState = 08001, NativeError = 17
Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not ex
ist or access denied.
SQLState = 01000, NativeError = 2
Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Conn
ect()).

Researching ...
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
allanau20Author Commented:
Here's what I've tried:

bcp [MyWorkstation\MyLocalDB].AdventureWorks.HumanResources.myTeam format nul -c -t , -f \\MyWorkstation\c$\data\myTeam.Fmt -T

bcp [MyWorkstation\MyLocalDB].AdventureWorks.HumanResources.myTeam format nul -c -t , -f C:\data\myTeam.Fmt -T

bcp AdventureWorks.HumanResources.myTeam format nul -c -t , -f C:\data\myTeam.Fmt -T

bcp
[MyWorkstation\MyLocalDB].AdventureWorks.HumanResources.myTeam format nul -c -t , -f \\SomeServer\SomeFolder\myTeam.Fmt -T

And still get this err:

SQLState = 08001, NativeError = 17
Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not ex
ist or access denied.
SQLState = 01000, NativeError = 2
Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Conn
ect()).
0
 
allanau20Author Commented:
I think I know what the issue is and it has do with Win Authen.
Can't even run this: osql -E -SYour_target_machine\Your_instance





0
 
allanau20Author Commented:
Thanks for trying to help!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now