-
Can We?
Can we enter two records together in the INSERT TABLE option using " INSERT INTO TABLE_NAME " command?
-
Depens on where the data come from. Possible with 'insert into table select ... from ...'.
-
Originally Posted by rmiao
Depens on where the data come from. Possible with 'insert into table select ... from ...'.
NOW DEAR FRIEND,
my difficulty was in this perticular example i'm noting below,
insert into TABLE
(colmn1, colmn2, colmn3,..........) values ('1', '2', '3', ........)
In simillar way can we post another RECORD in this same command?
-
You need separate insert statement to insert the row in this case.
-
If you can get the rows to insert using SELECT statement then you can insert multiple rows as
INSERT into TABLE
(colmn1, colmn2, colmn3,..........)
SELECT (col1val,....)
FROM sourcetable
You can also build SELECT rowset with hard coded values using UNION, but there is no gain compared to individual INSERTs
-
create table abc (id int, name varchar(100))
insert into abc
select 1,'A'
union
select 2,'B'
union
select 3,'c'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|