如何从记录集值创建表

时间:2009-06-22 14:00:34

标签: sql sql-server vb.net sql-server-2000

如何从记录集值

创建表
sqlCardEvent1 = "select * from tmp_CARDEVENT"
    If rsCardEvent1.State = 1 Then rsCardEvent1.Close
    rsCardEvent1.Open sqlCardEvent1, Cn, adOpenStatic, adLockOptimistic
    cmdCardEvent1.CommandText = sqlCardEvent1
    Set rsCardEvent1 = cmdCardEvent1.Execute

    sql33 = "create table tmp_date1 from"  & rsCardEvent1 
    rstmpDATE1.Open sql33, Cn, adOpenStatic, adLockOptimistic

需要SQL查询帮助吗?

1 个答案:

答案 0 :(得分:1)

您可以在SQL中使用SqlCommand的ExecuteNonQuery方法:

sqlCardEvent = "select * " & _
    "into tmp_date1 " & _
    "from tmp_CARDEVENT"
cmdCardEvent1.CommandText = sqlCardEvent
cmdCardEvent.ExecuteNonQuery