在 vb.net 中插入 INTO
我有2个数据库。第一个我有 10 张桌子。第二个只有1张桌子。我想从第一个数据库的每个表中选择 1 列,然后插入另一个数据库。如何使用 VB.net 中的 INSERT INTO 语句来管理此问题?
I have 2 databases. In first one I have 10 tables. Second one is only 1 table. I would like to select 1 columns from each table from 1st database and Insert INTO another database. How can I manage this using INSERT INTO statement in VB.net?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我删除了之前的答案,说你必须手动复制数据。现在,我们假设您想使用 SELECT INTO 语句来执行此操作。
以下代码显示如何使用 ADO.NET 连接和命令对象在数据库上执行 SQL 命令:
I deleted my previous answer saying that you have to manually copy over the data. For now, let's assume you want to do this with a
SELECT INTO
statement.The following code shows you how to execute a SQL command on your database using a ADO.NET connection and command object:
我希望这会有所帮助:
从 sql 方面,您只需要编写一个存储过程来插入(十个)哈希表,然后选择/将它们插入到目标表中。
在 Vb.net 中,您需要:一个连接对象和一个命令对象来调用您的存储过程
I hope this helps:
From sql side, you'll just need to write a stored procedure to insert into (ten) hash tables and select/insert them into your target table.
In Vb.net, you'll need: a connection object and a command object to call your stored procedure