Quantcast
Channel: SCN : All Content - SAP on SQL Server
Viewing all articles
Browse latest Browse all 837

SQLCMD Question

$
0
0

Hello,

 

I want to run a SQLCMD...

 

I have the following query I run in SAP B1:

SELECT T0.[CardCode], T0.[Address], T0.[LineNum]

FROM CRD1 T0

JOIN OCRD T1 ON T1.CardCode=T0.CardCode

WHERE T0.[AdresType] ='S' and T0.Address != T1.ShipToDef AND T1.CardCode LIKE '[%0]%'

 

Here is what I have:

SQLCMD -S <servername> -d <db_name> -U <username> -P <password> -Q "set nocount on;SELECT T0.CardCode, T0.LineNum, T0.Address, T0.Block, T0.Street, T0.City, T0.County, T0.State, T0.ZipCode FROM CRD1 T0 JOIN OCRD T1 ON T1.CardCode=T0.CardCode and T0.[AdresType] ='S' and T0.Address != T1.ShipToDef" -s "," -o "\\network\testing.txt" -h-1 -s"~" -W -w 999

 

This appears to work - but I just wanted to make sure, can someone please comment on whether this is giving me a export file with all ship-to addresses which aren't the default address?

 

Regards

Rick


Viewing all articles
Browse latest Browse all 837

Trending Articles