Showing posts with label regards. Show all posts
Showing posts with label regards. Show all posts

Friday, March 9, 2012

inside user define function can not use getdate() function?

Hi,
I can not use getdate() inside user define function? What can i
replace with that?
--
Thank you very much!
Best regards,
FlorenceThe best option is to pass it in...
CREATE FUNCTION YourFunction(@.param1, @.param2, ..., @.TheDate DATETIME)
...
SELECT ColA, ColB, ColC,
dbo.YourFunction(ColA, ColB, ColC, ..., GETDATE())
...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Florence Lee" <florencelee@.visualsolutions.com.my> wrote in message
news:OlK%23p%23V6EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I can not use getdate() inside user define function? What can i
> replace with that?
> --
> Thank you very much!
> Best regards,
> Florence
>

Sunday, February 19, 2012

Inserting of Duplicate Records Error Message

I would like to know what options I have with regards to trapping a duplicate record
before it tries to post to a SQL database. I have set the column to unique in SQL. But
when I try to use ASP and post a duplicate record I get a system error. I would like to
just create a referential error to notify the user that they cannot post a duplicate record
please try again. Any help would be greatly appreciated.

RTRefer toTry... Catch... Block in the code

Does this helps?