传递值SELECT语句

时间:2012-12-14 13:46:20

标签: mysql vb.net

假设字符串格式为sDatabase = "mytable"

cmd.CommandText = "INSERT INTO test.target SELECT * FROM '" & sDatabase & "'.source"

此查询给我一个错误。

1 个答案:

答案 0 :(得分:0)

您不应该使用''作为表名:

cmd.CommandText = "INSERT INTO test.target SELECT * FROM " & sDatabase & ".source"