Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/11/2010, 09:50
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 9 meses
Puntos: 774
Respuesta: consulta sql server ( bulk insert)

Código:
INSERT INTO tabla
  (campos)
    SELECT *
      FROM  OPENROWSET(BULK  'Tu archivo',--File that are procesed
      FORMATFILE='Archivo de formato',--Format file, that file contains the info of the columns that are used in the fill of the table	  	
	  FIRSTROW = 2 --Row where the info start
       ) as t1
Asi es como harias un bulk insert con un archivo de datos y un archivo de formato, el archivo de formato contiene cosas como el tipo de separador a utilizar y el terminador de tu archivo ya si no tienes archivo de formato con esto puedes hacer el bulk insert:

Código:
bulk insert tabla from 'path file' --path of the file in the server
WITH 
      (
		--Character that delimites the field in the file
         FIELDTERMINATOR =',',
		--character that delimites the row in the file
         ROWTERMINATOR ='\n'
      )
Saludos!