Solved

Format File Creation

Posted on 2009-06-29
6
213 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
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql query help 15 51
SQL Job Hung 17 36
Insert msdb.dbo.sysmail_event_log Process_ID into table 4 37
Applying Roles in Common Scenarios 3 16
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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.

740 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