TOP

SQL bcp import skip first row example

“G:\Program Files\90\Tools\Binn\bcp” salesreps.dbo.zRaw_SalesGrp in “G:\Integration\Pervasive\SalesRep\batch\SalesGrp.csv” -F2 -c -t, -SDTSQLV2\INSTANCE2 -Uxxxxx -Pxxxxx

Read More
TOP

SQL Server BCP – put quotes around all fields

SELECT
quotename(ISNULL([SRIDNode],”),’”‘),quotename(ISNULL([EmpNo],”),’”‘),quotename(ISNULL([FullName],”),’”‘),
quotename(ISNULL([Level1SalesRepNo],”),’”‘),quotename(ISNULL([Level1EmpNo],”),’”‘),quotename(ISNULL([Level1FullName],”),’”‘),
quotename(ISNULL([Level2SalesRepNo],”),’”‘),quotename(ISNULL([Level2EmpNo],”),’”‘),quotename(ISNULL([Level2FullName],”),’”‘),
quotename(ISNULL([Level3SalesRepNo],”),’”‘),quotename(ISNULL([Level3EmpNo],”),’”‘),quotename(ISNULL([Level3FullName],”),’”‘),
quotename(ISNULL([Level4SalesRepNo],”),’”‘),quotename(ISNULL([Level4EmpNo],”),’”‘),quotename(ISNULL([Level4FullName],”),’”‘),
quotename(ISNULL([Level5SalesRepNo],”),’”‘),quotename(ISNULL([Level5EmpNo],”),’”‘),quotename(ISNULL([Level5FullName],”),’”‘),
quotename(ISNULL([Level6SalesRepNo],”),’”‘),quotename(ISNULL([Level6EmpNo],”),’”‘),quotename(ISNULL([Level6FullName],”),’”‘),
quotename(ISNULL([Level7SalesRepNo],”),’”‘),quotename(ISNULL([Level7EmpNo],”),’”‘),quotename(ISNULL([Level7FullName],”),’”‘),
quotename(ISNULL([Level8SalesRepNo],”),’”‘),quotename(ISNULL([Level8EmpNo],”),’”‘),quotename(ISNULL([Level8FullName],”),’”‘),
quotename(ISNULL([Level9SalesRepNo],”),’”‘),quotename(ISNULL([Level9EmpNo],”),’”‘),quotename(ISNULL([Level9FullName],”),’”‘),
quotename(ISNULL([Level10SalesRepNo],”),’”‘),quotename(ISNULL([Level10EmpNo],”),’”‘),
quotename(ISNULL([TCode],”),’”‘),quotename(ISNULL([BizTeam],”),’”‘),quotename(ISNULL([Title],”),’”‘),quotename(ISNULL([SalesGrp],”),’”‘)
FROM [salesreps].[dbo].[SalesOrgHouWithGrp]

Read More
TOP

Sql BCP example in out

C:\Program Files\Microsoft SQL Server\100\Tools\Binn>

  • bcp Web_HearstSalesForce_DEV.dbo.Accounts_RAW in c:\meWORK6\Accounts_334_fullload-SAVE.csv -c -t”|” -F”2″ -SHOUPCWS301\ENTSQLDB -Uxxxx -Pxxxxxx
  • bcp Web_HearstSalesForce.dbo.csv_315 out c:\meTest.csv -n -SHOUPCWS301\ENTSQLDB -Uxxxx -Pxxxxxx
Read More

Switch to our mobile site