Allows data to be inserted using records from another table.
Namespace: DatabaseObjects.SQLAssembly: DatabaseObjects (in DatabaseObjects.dll) Version: 3.8.1.0
Syntax
C# |
---|
public class SQLInsertFromSelect : SQLStatement |
Visual Basic |
---|
Public Class SQLInsertFromSelect _ Inherits SQLStatement |
Visual C++ |
---|
public ref class SQLInsertFromSelect : public SQLStatement |
Remarks
Examples
Dim objCopy As New DatabaseObjects.SQL.SQLInsertFromSelect
objCopy.Fields.Add("DestinationField1")
objCopy.Fields.Add("DestinationField1")
objCopy.TableName = "DestinationTable"
objCopy.Source.Fields.Add("SourceField1")
objCopy.Source.Fields.Add("SourceField1")
objCopy.Source.Tables.Add("SourceTable")
objCopy.Source.Where.Add("Field1", DatabaseObjects.SQL.ComparisonOperator.EqualTo, "ABC")
INSERT INTO DestinationTable
SELECT * FROM SourceTable
WHERE SomeField = Condition
or
INSERT INTO DestinationTable (IntoField1, IntoField2)
SELECT (FromField1, FromField2) FROM SourceTable
WHERE SomeField = Condition
Inheritance Hierarchy
System..::..Object
DatabaseObjects.SQL..::..SQLStatement
DatabaseObjects.SQL..::..SQLInsertFromSelect
DatabaseObjects.SQL..::..SQLStatement
DatabaseObjects.SQL..::..SQLInsertFromSelect