Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BCP problem
Message
De
23/05/2011 10:09:05
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
BCP problem
Divers
Thread ID:
01511476
Message ID:
01511476
Vues:
94
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform