Spool is used to take script and its output in a file
Example of spool
SET sqlformat csv
spool c:\spoolfile.csv SELECT * FROM workorder;
spool off Example 2 SET SQLFORMAT SQL SPOOL 'C:\users\mysql.sql'; select * from asset; spool off You can use it also to create a insert script like select 'insert into Table values(Id=' + Id + ', name=' + name + ')' from Maxusers SET sqlformat csv
spool c:\spoolfile.csv select 'insert into Table values(Id=' + Id + ', name=' + name + ')' from Maxusers;
spool off
Note : For running this you need to press F5 only because it runs as a batch file..
spool c:\spoolfile.csv SELECT * FROM workorder;
spool off Example 2 SET SQLFORMAT SQL SPOOL 'C:\users\mysql.sql'; select * from asset; spool off You can use it also to create a insert script like select 'insert into Table values(Id=' + Id + ', name=' + name + ')' from Maxusers SET sqlformat csv
spool c:\spoolfile.csv select 'insert into Table values(Id=' + Id + ', name=' + name + ')' from Maxusers;
spool off
Comments
Post a Comment