Viewing 15 posts - 16 through 30 (of 51 total)
Does this stored proc really give the occurence of a value in the database or the occurence of a attribute/field name in the database ?
I have a value and I...
February 17, 2009 at 11:45 pm
declare @time int
set @time = 70
select cast((@time / 60) as varchar(2)) + ':' + cast((@time % 60) as varchar(2))
February 13, 2009 at 12:13 pm
Here's a way..
create table names1(id int not null identity(1,1),empname varchar(10))
create table names2(id int not null identity(1,1),empname varchar(10))
create table names3(id int not null identity(1,1),empname varchar(10))
--Insert values...
select coalesce((select empname from names1 where...
February 13, 2009 at 9:19 am
andrewd.smith (2/12/2009)
SELECT FirstOfMonth = DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0),
LastOfMonth = DATEADD(month, DATEDIFF(month, 0, GETDATE()) + 1, -1)
A nice and simple way 🙂
Here's another way I used to use:
select dateadd(day,-1,dateadd(month,1,str(year(getdate()),4)+'-'+str(month(getdate()),2)+'-01'))
February 12, 2009 at 10:56 pm
gyessql (2/10/2009)
I figured probably since I dropped and recreated the procedure the plan might have been changed. Am I correct?
However, I created another proc for this particular query and am...
February 12, 2009 at 10:44 pm
Is MERGE supported in Sql Server 2005?
February 10, 2009 at 11:02 am
Can I use dynamic sqls. Will there be a performance difference if I have more dynamic sqls in my stored proc?
February 10, 2009 at 10:17 am
Gail, Noel - Thanks for all the suggestions.
Today morning I dropped the procedure with this query and recreated it without making any change. It ran very fast. I ran it...
February 10, 2009 at 10:15 am
Another option would be to use:
last_update > cast(convert(char(10),getdate()-1,101) as datetime)
and
last_update < cast(convert(char(10),getdate(),101) as datetime)
I'm not sure about the performance difference in these 2 methods
February 9, 2009 at 10:42 am
GilaMonster (2/9/2009)
February 9, 2009 at 10:31 am
Thanks Lynn. I won't be able to post the execution plan, I am not allowed to post official work in public forums. Hope u understand.
Could u hint something for...
February 9, 2009 at 9:48 am
Thanks. I wanted to confirm if CASE can be used for such a thing. It would make things easier 🙂
February 9, 2009 at 9:43 am
GilaMonster (1/22/2009)
Yes. One of them will run and one of them will give you a syntax error.
:D:D Good one!!
Thanks for all the clarifications..
January 22, 2009 at 9:28 am
Thanks Gail..
GilaMonster (1/22/2009)
Yup, that's a join based on two columns. ...
Is there any difference between joining in these 2 ways?
select ...
from table t1
...
January 22, 2009 at 9:13 am
Viewing 15 posts - 16 through 30 (of 51 total)