I remember that MS SQL allow the XML passed to your SP to have a schema associate with it. I think this would be easier to validate the data types.
Additionally, since sql2005 you may add a SP which is implemented in CS. Using regex in this SP, you may implement a very powerful data type validate SP. But the performance becomes a big problem too. On Wed, Apr 1, 2009 at 3:55 PM, Aman Sharma <[email protected]> wrote: > It's there implecitly if we pass general parameters . > But say if I send XML in db and where Id is coming as string rather integer. > For eg:- "E1001" rather 1001 then we could return customised error message. > This may be done if we convert string to integer in SP. If convirsion fails > then return custom message. > But is there any inbuilt function or any other way in sql server which could > check it??? > > > > On Wed, Apr 1, 2009 at 11:59 AM, Cerebrus <[email protected]> wrote: >> >> Isn't that already done implicitly by all major database systems? >> >> On Apr 1, 7:20 am, Aman Sharma <[email protected]> wrote: >> > Thanx Cerebrus. >> > Actually I need to check them in DB ... I mean in Stored Procedure not >> > in >> > C#. >> > I think, checking of parametr's data type in db is wrong approach and I >> > never did it but I need to do now as it is our client's requirement. >> > Client >> > wants every check in DB. >> > >> > >> > >> > On Wed, Apr 1, 2009 at 12:29 AM, Cerebrus <[email protected]> wrote: >> > >> > > Use SqlParameters with the DbType set either via constructor or by >> > > setting the property. >> > >> > > On Mar 31, 10:53 pm, Aman Sharma <[email protected]> wrote: >> > > > Hi, >> > >> > > > *MS SqlServer2005 - Stored Procedure* >> > >> > > > Is it possible to check for Invalid Data Type in SP? For eg:- String >> > > > is >> > > > passed into SP rather Integer.- Hide quoted text - >> > >> > - Show quoted text - > -- Best Regards, David Shen
