Viewing 15 posts - 451 through 465 (of 660 total)
I am sure table valued function will allow parameters but why cant we pass dbname as parameter and execute it from any where in same server
December 20, 2007 at 3:38 pm
Can I make a view as table valued function so that I can run the view in any db by passing the database name as parameter. something like this....
SET ANSI_NULLS...
December 20, 2007 at 3:05 pm
want to know best way to convert a varchar field like 01/07/2006 into datetime
so that i can compare dates.
I tried many ways and got the result set with an error...
December 19, 2007 at 8:01 am
when i tried doing this
select startDate from tblemp where startDate between '1/1/2006' and '12/31/2006'
i dont get that date range, why?
startdate is varchar(100), I Cant change that in the table, its...
December 18, 2007 at 2:06 pm
hey i didnt follow tht..
i am declaring my paramter as datetime and passing the parameter value as '07/01/2005'
December 18, 2007 at 12:25 pm
still working on this with some errors...
syntax error converting datetime from character string
when i pass '07/01/2005' for the parameter @begindate i get the value 'Jul 1 2005 12:00AM'
am cheking...
December 18, 2007 at 11:12 am
tim ..if i had sql 2005, then it wud work for max length but am using sql 2000.
jeff ...there is no other go, i want ot use only dynamic sql
Vasc...
December 18, 2007 at 9:34 am
yeah my length is more than 4k and so iwant to do some type break and concatinate.
December 18, 2007 at 9:08 am
If I break my dynamic sql and then concatinate it, like
@sqldcmd1 + @sqlcmd2, how am i going to use
exec sp_executesql @SQLCmd1,N'@Col datetime',@Col
December 18, 2007 at 8:31 am
Ray M (12/13/2007)
if you want to pass parameters into dynamic sql, then you MUST use sp_executesql. the EXEC function does not except parameters.
If...
December 18, 2007 at 7:31 am
yeah my Fromdate is a varchar as i told you and now i tried doing cast(fromdate as datetime) i get hte result set ok but with an error message
Msg 241,...
December 17, 2007 at 12:01 pm
As I made this proc dynamic by passing dbname as parameter so that i can run this proc in any db, can i also do the same for views.
I want...
December 17, 2007 at 8:01 am
THank yuou very much Ray
I cud do that but am getting another error
Msg 241, Level 16, State 1, Line 6
Syntax error converting datetime from character string.
December 13, 2007 at 10:32 am
Could you explain this for me in detail, why do you use parameters double time there. I tried this it gives syntax error
exec sp_executesql(@SQLCmd ,
'@beginDate datetime,
@EndDate datetime,
@emp...
December 13, 2007 at 10:22 am
Viewing 15 posts - 451 through 465 (of 660 total)