Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to check the given value is BigInt in Sql Query before Inserting to Table

For Example:
My input is: 999999999999999999999999999999999999
Output: 0


O/p Values : Valid - 1, Not Valid -0
Posted

Do your data validation before you insert in your database.

SQL will automatically fit the value given in the column (bigint in your case) and give an error if it is not possible.
 
Share this answer
 
Comments
senthil sennu 8-Sep-11 10:02am    
I am importing data throught SSIS, In order to validate, we need to write sp or Query.
Mehdi Gholam 8-Sep-11 10:12am    
Just run SSIS and see if you need it. (i.e. if you get errors)
Reiss 8-Sep-11 10:28am    
I think you need to look at your whole design - what are you going to do with the import if one record fails due to data typing issue
Since you're using SSIS, have a look at the Script Component[^]. It's actually a very powerful tool where you can do validations, conversions, transformations etc.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900