Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BCP problem
Message
De
23/05/2011 10:29:44
 
 
À
23/05/2011 10:09:05
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
01511476
Message ID:
01511477
Vues:
41
I needed an extra quote.
  set @sql='bcp "SELECT * FROM integra_test.dbo.new_member_list where GrName = '''+@AreaGroupRef+'''" queryout "'+@filename+'" -c -q -t , -T'
>Hi
>
>I have a problem with a BCP command
>
>I'm using to to export data to a csv file.
>
>When it runs 0 rows are copied.
>
>
>If I run the select command that the bcp package is using it does select data so I think that parameter is being passed correctly..
>
>Any ideas why that selected data is not being copied to the output file.
>
>below is the code.
>
>Thanks
>
>
>OPEN group_list
>
>FETCH NEXT FROM group_list into @AreaGroupRef
>WHILE (@@FETCH_STATUS <> -1)
>BEGIN
>
>set @filename = 'c:\AG_Export\'+@AreaGroupRef+'.csv'
>
>  set @sql='bcp "SELECT * FROM integra_test.dbo.new_member_list where GrName = ''+@AreaGroupRef+''" queryout "'+@filename+'" -c -q -t , -T'
>
>   	EXEC master..xp_cmdshell  @sql
>	FETCH NEXT FROM group_list into @AreaGroupRef
>
>END
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform