![](/img/trans.png)
[英]Query for fetching mismatching records from a table by cross checking with 2 other tables
[英]Fetching values from tables and adding other parameters in Insert Query
任何人都可以在下面的查询中提出建议-我需要从表中获取少量数据,并且将少量变量作为变量提供给以下语句。 我在努力写这个
SQLCommand = New SqlCommand("TableA", Conn)
SQLCommand.CommandText = "Insert into TableA(P1,P2,P3,P4,P5,P6,P7,P8) " & _
"Values (@p1, @P2, @P3, @P4, @P5, @P6, @P7, @P8)
其中@ p1,@ p2,@ p3,@ p4将来自表B,而@ p5,@ p6,@ p7,@ p8将是变量,函数将为其提供值
我正在努力更改上面的COMMANDTEXT语句-从TableB以及其他自定义变量(即p5,p6,p7,p8)中获取值
Insert into TableA (P1,P2,P3,P4,P5,P6,P7,P8)
SELECT b.column1, b.column2, b.column3, b.column4, @P5, @P6, @P7, @P8
FROM TableB b
WHERE ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.