Solved

Format File Creation

Posted on 2009-06-29
6
223 Views
Last Modified: 2013-11-10
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
Comment
Question by:allanau20
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
6 Comments
 
LVL 15

Accepted Solution

by:
MohammedU earned 500 total points
ID: 24740590
From where you are running the bcp command?
If you have not tried from command window then try it...
0
 
LVL 5

Author Comment

by:allanau20
ID: 24741174
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
 
LVL 5

Author Comment

by:allanau20
ID: 24741185
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 5

Author Comment

by:allanau20
ID: 24741522
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
 
LVL 5

Author Comment

by:allanau20
ID: 24748612
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
 
LVL 5

Author Closing Comment

by:allanau20
ID: 31598125
Thanks for trying to help!
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question