Does BULK insert (SQL server) work only with external file? - sql-server

I want to bulk insert records from the SELECT query result but I think in SQL server we can only bulk insert from a file.
Is there a way where I can perform the bulk insert from SELECT query and which should also be faster as compared to bulk insert
Many thanks in advance

Related

What is the TSQL for Bulk Insert?

Azure Synapse has the Bulk Insert option in its GUI for inserting tables.
But what is the underlying code that it is running? I would like to run it as TSQL rather than as a pipeline.
The documentation is unclear that is even supported while variations of this the below all fail
Running the following yields errors:
INSERT INTO [schema].[table][
SELECT * FROM OPENROWSET(
BULK 'filename.parquet',
FORMAT = 'PARQUET'
)

How to write a Snowflake Stored Procedure to get a SQL query output in a table

Can anyone please help me to write a Snowflake Stored procedure to get a SQL query output in a table.
I want to write a snowflake stored Proc which will insert the data into a existing table from a SELECT SQL query output.
You could just execute the statement:
INSERT INTO <target_table> SELECT * FROM <source_table>;
as a single query inside your SP's JS code.

OPENQUERY option to bulk insert data into a table on remote server

I have SQL Server 2014 and was trying to find out if there's a way to bulk insert data into a table on a remote server like below.
SELECT * FROM OPENQUERY([REMOTESERVER],
'BULK INSERT [DBNAME].[dbo].[demo] FROM ''\\Share\data\demo.dat''
WITH (DATAFILETYPE = ''widenative'')');

insert statement show 1 row created but data is not insert (script)

I am using Run SQL Command Line to insert my data, the script ask below.
INSERT INTO USERMASTER (USERID,USERPWD,USERNAME,USERPOSITION,USERACCESSRIGHTS,USERSTATUS,CREATEUSERID) VALUES ('admin','nVzfJ0sOjj/EFU700exL6A==','Admin','Administrator','Non-Administrator','1', 'admin');
but when I open my database by using toad and log in the user and see, the data is not insert into the table. May I know where is the place goes wrong?
image below is the output in sql command.
what about commit.
Is autocommit on?
or add 'commit' after your insert statement

DBLink Optimized Insertions

I want to insert 10 million rows into my Oracle Database via Database Link.
What will be an optimized way to do that?
Doing INSERT by SELECT * FROM [dblink_table_name] would be an optimized way of doing it?

Resources