Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mn757
Starting Member
15 Posts |
Posted - 2009-03-18 : 08:10:11
|
Hi all,I have a view, the contents of which are exported to a csv file using BCP. I now need to amend the csv file to include double quotes around each value, as well as the comma delimiter (which I already have). I am struggling to find a way to do this. Can anyone help.I have tried something along the lines of ;SELECT TOP 100 PERCENT dbo.Consultees.Consultee = ' " ' + dbo.Consultees.Consultee + ' " ',FROM dbo.Planning_Applications............but i'm going nowhere fast. fairly new to sql so any help greatly appreciated.many thanksmn757 |
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-03-18 : 08:20:21
|
u want this declare @t table(names varchar(12), value int)insert into @t select 'defde', '1'insert into @t select 'abc', '2'select '"'+ names +'",' from @t |
|
|
mn757
Starting Member
15 Posts |
Posted - 2009-03-18 : 08:37:19
|
Many thanks for your help, much appreciated |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2009-03-18 : 08:38:04
|
yes you can do it that way but you don't need toYou can use a custom format file for mcp. I've posted on a very similar thread recently. Have a look at : http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=121924Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-03-18 : 08:40:31
|
quote: Originally posted by mn757 Many thanks for your help, much appreciated
welcome |
|
|
|
|
|
|
|