12/10/2019 10:11:00 a. m.
Share:
Blog Informático sobre Análisis y Desarrollo de Software.
create table ALUMNO ( DocumentoIdentidad varchar(11), Nombres varchar(50), Apellidos varchar(50), Edad int ) BULK INSERT ALUMNO from 'E:\_ASESORIAS\SQL Importar CSV EXCEL\listado alumnos.csv' WITH ( FIRSTROW = 1, MAXERRORS = 0, FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) select * from ALUMNO
create table RESUMEN_VENTAS (year int, JAN decimal(12, 2), FEB decimal(12, 2), MAR decimal(12, 2), APR decimal(12, 2), MAY decimal(12, 2), JUN decimal(12, 2), JUL decimal(12, 2), AUG decimal(12, 2), SEP decimal(12, 2), OCT decimal(12, 2), NOV decimal(12, 2), DEC decimal(12, 2) ) BULK insert RESUMEN_VENTAS from 'E:\_ASESORIAS\SQL Importar CSV EXCEL\resumen_ventas_con_null.csv' WITH ( FIRSTROW = 2, MAXERRORS = 0, FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' --DataFileType ='char' --DataFileType='widechar' , KEEPNULLS ) truncate table RESUMEN_VENTAS select * from RESUMEN_VENTAS
-- -- use master go sp_configure 'show advanced options', 1 reconfigure go sp_configure 'Ad Hoc Distributed Queries', 1 reconfigure go exec sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1 go exec sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1 go SELECT U.USERID, U.BadgeNumber, U.Name FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'E:\_InfoTacticas_Blog\Importacion ACCESS\att2000.mdb'; 'admin'; '', USERINFO) AS U
0 comentarios: