Find Jobs
Hire Freelancers

Write a stored procedure SQL 2012

$10-30 USD

Đã hoàn thành
Đã đăng vào hơn 8 năm trước

$10-30 USD

Thanh toán khi bàn giao
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
Mã dự án: 8915642

Về dự án

7 đề xuất
Dự án từ xa
Hoạt động 9 năm trước

Bạn muốn kiếm tiền?

Lợi ích khi chào giá trên Freelancer

Thiết lập ngân sách và thời gian
Nhận thanh toán cho công việc
Phác thảo đề xuất của bạn
Miễn phí đăng ký và cháo giá cho công việc
Đã trao cho:
Avatar người dùng
A proposal has not yet been provided
$25 USD trong 1 ngày
5,0 (12 nhận xét)
4,3
4,3
7 freelancer chào giá trung bình $35 USD cho công việc này
Avatar người dùng
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 trong 1 ngày
5,0 (1 nhận xét)
2,5
2,5
Avatar người dùng
A proposal has not yet been provided
$50 USD trong 2 ngày
5,0 (1 nhận xét)
2,0
2,0
Avatar người dùng
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 trong 1 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
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 trong 1 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
A proposal has not yet been provided
$35 USD trong 1 ngày
0,0 (0 nhận xét)
0,0
0,0

Về khách hàng

Cờ của UNITED KINGDOM
London, United Kingdom
5,0
29
Phương thức thanh toán đã xác thực
Thành viên từ thg 7 15, 2005

Xác thực khách hàng

Cảm ơn bạn! Chúng tôi đã gửi email chứa đường link để bạn lấy tín dụng miễn phí.
Đã xảy ra lỗi trong khi gửi email của bạn. Hãy thử lại.
Người Dùng Đã Đăng Ký Tổng Số Việc Đã Đăng
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Đang tải xem trước
Đã cấp quyền truy cập vị trí.
Phiên đăng nhập của bạn đã hết hạn và bạn đã bị đăng xuất. Hãy đăng nhập lại.