Hi,
I have a stored procedure in SQL 2008 which does certain calculations based on business rules. In order to do the calculations, we need to supply data in
the form of file in .csv format. As of now, the stored procedure is unable to process the data, if the data file has a header.
The reason being not able to process the data is, SP is unable to insert the data into the temporary table due to confliction of the data type which is defined for the colomn. I mean to say, there is a column called Zip Code and Zip Code is defined as integer. If this column is having integer data, then it will be inserted into the temp table. otherwise it throws an error message saying, data type mismatch and insertion process become infinite.
i have two things in this context.
1. I want to first validate the first row, for the required format of the data. If the data is not in the required format, it should proceed to the next row start the portfolio valuation. It should do the same thing, even when it faces the same situation in the next set of rows in the file.
2.we have error handling in place for the records which are having invalid data IN THE OUTPUT DATA TABLE(not during insertion of the data). In the output table, where the output data will be written has extra columns where in it has to populate exception code and proceed further for valuating the valid records. The same exception is applicable for the first header row also.
Thank you very much for helping on this.
Thanks,
VIJSQL.
I have a stored procedure in SQL 2008 which does certain calculations based on business rules. In order to do the calculations, we need to supply data in
the form of file in .csv format. As of now, the stored procedure is unable to process the data, if the data file has a header.
The reason being not able to process the data is, SP is unable to insert the data into the temporary table due to confliction of the data type which is defined for the colomn. I mean to say, there is a column called Zip Code and Zip Code is defined as integer. If this column is having integer data, then it will be inserted into the temp table. otherwise it throws an error message saying, data type mismatch and insertion process become infinite.
i have two things in this context.
1. I want to first validate the first row, for the required format of the data. If the data is not in the required format, it should proceed to the next row start the portfolio valuation. It should do the same thing, even when it faces the same situation in the next set of rows in the file.
2.we have error handling in place for the records which are having invalid data IN THE OUTPUT DATA TABLE(not during insertion of the data). In the output table, where the output data will be written has extra columns where in it has to populate exception code and proceed further for valuating the valid records. The same exception is applicable for the first header row also.
Thank you very much for helping on this.
Thanks,
VIJSQL.