Skip to main content

Posts

Showing posts with the label insert record set

SQL Tips-Bulk insert records into table ,Select into ,Insert into,delete record in chunks,Remove unused space

Bulk insert records into table in sql  This is the way to Bulk insert records into table in sql or oracle insert into  If you want to insert of table data to existing table then you need to select insert into query. E.g. INSERT   INTO   Table2 SELECT   *  FROM   Table1 insert into dTable select * from sTable It mean table2 and table1 both exists before execution of query and its simply insert data line by line. It takes more time on execution. Select into: If you want to copy of table structure with data to new table then you need to select select into query. E.g. Select * into tab1 from tab2. It means tab2 exists and tab1 does not exist in database before execution of query. After execution it will copy data of tab2 to tab1 and it will create table tab1 also. if dTable is blank and doesn't have any record. Create this as follows: definately reduce the time. CREATE TABLE dtable NOLOGGING AS SELECT * FROM stable Example of delete records from sq