Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am executing below bcp query but receiving error..please help me out ..

SQL
EXEC master..xp_cmdshell 'bcp "select f.C_EmpNo as EmpCode,f.C_Name as FSName,ua.N_Type as NType,ua.c_sh_name as Desg, ui.C_UserID as UserID,dwr.dcrcount as DCR_Count from  VESTASLIFE..Tbl_FS_Mst f  join VESTASLIFE..Tbl_User_Access ua on f.N_Type=ua.N_Type  join VESTASLIFE..Tbl_User_Info ui on f.C_EmpNo=ui.C_Code left join (select c_fs_code,COUNT(distinct n_srno) as dcrcount   from VESTASLIFE..tbl_dwr d  where  MONTH(d.D_Date_Report)=7 and YEAR(d.D_Date_Report)=2015      group by c_fs_code )dwr on dwr.C_FS_Code=f.C_Code where f.C_EmpNo<>''000000'' or dwr.dcrcount is not null --and  dwr.dcrcount=null order by f.C_EmpNo,f.N_Type,f.C_Name " queryout D:\VESTASLIFE\usercountdetails.txt -S GGSFADATA -T -t -c '


error in below..

Error = [Microsoft][SQL Server Native Client 10.0]Function sequence error
Posted
Updated 27-Jul-15 19:16pm
v2
Comments
Wendelius 28-Jul-15 1:44am    
Have you tried with a simple SQL statement, such as

SELECT 1
ZurdoDev 28-Jul-15 7:27am    
A quick google search of error indicates you have something wrong (yes, I know that's obvious.) You'll have to start narrowing it down and really look at closely each parameter. You may have misspelled a table or db or something.
[no name] 8-Sep-16 10:32am    
try that exec with a simple sql like select 1
if it work's test your query
if not have a look at those params
-S mising computer name
-t replace \t with ?
https://msdn.microsoft.com/en-us/library/ms162802.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900