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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-10-17 : 07:54:37
|
| Dan writes "SQLSERVER 2000I'm not sure if I am missing somthing here but I am having problems with passing in values for datetime parameters. I am getting the following error:Error converting data type nvarchar to datetime. I have stripped the SP down to the following but I still get the same error.CREATE PROCEDURE date_test( @p_test_datetime datetime )ASPRINT('Hello')GOIf I call the SP in query analyzer as follows:DECLARE @RC intDECLARE @p_test_datetime datetime-- Set parameter valuesEXEC @RC = [GRFL].[dbo].[date_test] GETDATEI get the error:Error converting data type nvarchar to datetime.Any ideas?" |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2005-10-17 : 08:05:13
|
| Try this.. DECLARE @RC intDECLARE @p_test_datetime datetimeSelect @p_test_datetime = GetDAte()EXEC @RC = [GRFL].[dbo].[date_test] @p_test_datetimeComplicated things can be done by simple thinking |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-17 : 08:44:03
|
| You cannt directly use GetDate() as the parameter of spYou need to use datetime variable as suggestedMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|