| Author |
Topic |
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-02-10 : 07:45:30
|
| HI...I want to EXPORT SqlTable in to XML Format.ANy Idea On This.. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-10 : 07:46:46
|
SELECT * FROM Table1 FOR XML AUTOAnd use bcp to export? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
heavymind
Posting Yak Master
115 Posts |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-02-10 : 08:24:28
|
| Thanks Peso ......For Ur Needful Help.....well thats query works fine with me,,,i get that table in XML format,,,cna i please tell me the way in which i can xport that xml file in particular destination using BCP...with store procedure,,,,Thanks For your help....M new in Sql Server So help me out in this.Thnaks..... |
 |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-02-10 : 09:26:33
|
| i Use that query for export the XML file,,,,bcp "select * from ashish.dbo.test13 FOR XML RAW" queryout d:\myfile.xml -creative8\sqlexpress -sa -1 -c -r -tBut it gives me the error....Msg 102, Level 15, State 1, Line 2Incorrect syntax near 'queryout'.Any Suggestions. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-10 : 09:27:06
|
| http://msdn.microsoft.com/en-us/library/ms191184.aspx |
 |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-02-10 : 10:12:59
|
| means i dont know can u knw wats the problem wid dis?i dunn have any idea about this so guide me? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-10 : 10:26:48
|
| something like:-bcp "select * from ashish.dbo.test13 FOR XML RAW" queryout d:\myfile.xml -S creative8\sqlexpress -U sa -1 -c -r <row terminator here> -t <field terminator here> |
 |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-02-12 : 00:11:58
|
| ohkk Thanks Vishak Sir,,I also found a solution,,,,,mean it works for me...so,,,it is like....EXEC master..xp_cmdshell 'bcp "select * from Ashish.dbo.webmba2 for XML AUTO" queryout D:\myfile2.xml -Screative8\sqlexpress -Uusername -Ppassword -c -r -t'Thanks For Reply... |
 |
|
|
|