Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Query

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-06-05 : 11:03:50
Please let me know if anything needs to be modified..


@v_emsg = 'Invalid Date' + cast(@v_mnth as varchar(30)) + '/' + cast(@v_yr as varchar(30)) + '. Month should be a 2 digit number and Year should be a 4 digit number.'

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-06-05 : 11:12:20
Could you give an example of @v_mnth and @v_yr and what your expected result should be?

Jim
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-05 : 13:16:27
i hope @v_mnth & @v_yr will never contain null values
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-06-05 : 13:27:31
>>Please let me know if anything needs to be modified..

You should store dates as DATETIME or SMALLDATETIME. And use parameterized Stored Procedures with properly typed parameters to manage the data. Then you can just validate on the front end and you will guarantee that only valid dates will be stored.

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -