请帮忙看看这条SQL语句有什么错???数据库SQL 2000
通过BCP将查询结果过导入到EXCEL表格中!报错EXECmaster..xp_cmdshell'bcp"selectproclass.[name],pro.p_name...
通过BCP将查询结果过导入到EXCEL表格中!报错
EXEC master..xp_cmdshell 'bcp "select proclass.[name],pro.p_name,pro.p_content,pro.p_MemberPrice from web_product pro join web_proclass proclass on convert(datetime,pro.p_addtime)>=convert(datetime,''2007-12-31 00:00:00'') and convert(datetime,pro.p_addtime)<=convert(datetime,''2008-12-31 00:00:00'') and pro.p_marketPrice > 0 and proclass.id=pro.p_classidand proclass.[name] like ''%笔记本%''and pro.p_name not like ''%线%''and pro.p_name not like ''%套装%''" queryout E:\pro.xls -c -q -S"KMXYT" -U"" -P""'
SQLState = 37000, NativeError = 170
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: 'proclass' 附近有语法错误。
SQLState = 37000, NativeError = 8180
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]未能准备语句。
NULL
邪魔剑圣 二级
按照你的修改还是错,并且貌似SQL没有你这种的拼写方法吧? 展开
EXEC master..xp_cmdshell 'bcp "select proclass.[name],pro.p_name,pro.p_content,pro.p_MemberPrice from web_product pro join web_proclass proclass on convert(datetime,pro.p_addtime)>=convert(datetime,''2007-12-31 00:00:00'') and convert(datetime,pro.p_addtime)<=convert(datetime,''2008-12-31 00:00:00'') and pro.p_marketPrice > 0 and proclass.id=pro.p_classidand proclass.[name] like ''%笔记本%''and pro.p_name not like ''%线%''and pro.p_name not like ''%套装%''" queryout E:\pro.xls -c -q -S"KMXYT" -U"" -P""'
SQLState = 37000, NativeError = 170
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: 'proclass' 附近有语法错误。
SQLState = 37000, NativeError = 8180
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]未能准备语句。
NULL
邪魔剑圣 二级
按照你的修改还是错,并且貌似SQL没有你这种的拼写方法吧? 展开
展开全部
proclass.[name] like "%"+笔记本+"%" and pro.p_name not like "%"+线+"%" and pro.p_name not like "%"+套装+"%""
你改成这样试试
你改成这样试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询