Find Jobs
Hire Freelancers

Write a stored procedure SQL 2012

$10-30 USD

Terminado
Publicado hace más de 8 años

$10-30 USD

Pagado a la entrega
I have a stored procedure that BULK INSERTs some data from a csv file to a table. There are many different tables so the sproc picks up the tablename and csv file format and filename as input parameters to upload the data. Pertinent part of the code SET @sql = 'BULK INSERT '+@DestTableName+' FROM ''' + @LoadDataFileName + ''' WITH (FORMATFILE='''+@LoadFormatFileName+''')'; EXEC(@sql); I now want to add an intermediate audit table to this, so I have an audit of which rows were inserted and which rows 'failed' the insert. The audit tables will have the same structure as the original tables plus a few extra fields like, UploadID, Auditdtae datetime default getdate(), Loginname default suser_sname, UploadSuccess Yes/No. The sproc should check first if the audit table exist or not as the Audit table name will be +@DestTableName + '_Audit'. If it does not exist the sproc will create it. Process 1. BULKINSERT all the data to the Audit table (generating the next UploadID value (INTEGER)). 2. Cursor your way through all the rows of this UploadID and TRY/CATCH INSERT into the actual table. 3. If successfully inserted, then Mark the audit table row as UploadSuccess as Yes 4. If row fails to insert, then Mark the audit table row as UploadSuccess as No I hope this is clear. Thanks Aasim
ID del proyecto: 8915642

Información sobre el proyecto

7 propuestas
Proyecto remoto
Activo hace 9 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
A proposal has not yet been provided
$25 USD en 1 día
5,0 (12 comentarios)
4,3
4,3
7 freelancers están ofertando un promedio de $35 USD por este trabajo
Avatar del usuario
Hi there, I have written VERY similar MS SQL scripts. I can help you edit it to include the intermediate (audit) table. It will be coded with utmost clarity in mind. Thank you, Goran
$55 USD en 1 día
5,0 (1 comentario)
2,5
2,5
Avatar del usuario
A proposal has not yet been provided
$50 USD en 2 días
5,0 (1 comentario)
2,0
2,0
Avatar del usuario
This is something I have done before and feel very comfortable in doing. I have 8 years of experience in doing SQL Server writing queries and Stored Procedures.
$25 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Hi Sir! I'm Eliot,, and I can help you creating the process on your stored procedure for handling audit tables. Please let me know if Interested, Best regards. Eliot
$30 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
A proposal has not yet been provided
$35 USD en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED KINGDOM
London, United Kingdom
5,0
29
Forma de pago verificada
Miembro desde jul 15, 2005

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.