生成临时表的问题

itzhiren 2005-09-23 05:12:23
select c_f1 into #temp from table1 group by c_f1
提示:
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]数据库中已存在名为 '#temp' 的对象。

请问怎么解决?
...全文
261 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
itzhiren 2005-10-10
  • 打赏
  • 举报
回复
不明白
itzhiren 2005-09-23
  • 打赏
  • 举报
回复
osql="select c_f1 into #temp from table group by c_f1"
oconn.execute(osql)
sql="select c_f2 from table2 group by c_f2 union (select c_f1 from #temp)"
set ors=server.CreateObject("adodb.recordset")
ors.open sql,oconn,3,1
提示错误:
对象"#temp"不存在
错误行就是:
ors.open sql,oconn,3,1
这一行。
郁闷,大家帮我看看呀,第一次使用临时表,问题多多呀,明天再来。早点到。
多谢!
itzhiren 2005-09-23
  • 打赏
  • 举报
回复
还是不明白,怎么用这个临时表?
osql="select c_f1 into #temp from table group by c_f1"
Response.Write(osql&"<br>")
set ors=server.CreateObject("adodb.recordset")
ors.open osql,oconn,3,1
response.write ors.state

怎么会输出0呢?我已经打开记录集了呀
kevin_gao 2005-09-23
  • 打赏
  • 举报
回复
用select c_f1 into ##temp from table1 group by c_f1

或者你用drop table #temp先
legend1970 2005-09-23
  • 打赏
  • 举报
回复
不能生成临时表!

28,404

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧