Viewing 15 posts - 136 through 150 (of 1,824 total)
So,
Declare @FirstMnth datetime
Select @FirstMnth = dateadd(mm,datediff(mm,0,getdate()),0)
Select Id
where DateCol >=@FirstMnth and DateCol < dateadd(mm,1,@Firstmnth)
BTW this is good reading : http://www.karaszi.com/SQLServer/info_datetime.asp
January 4, 2012 at 7:13 am
Marco V (1/4/2012)
iam using result to file so i dont have the overhead...on a side note it will not even complete if i choice any other method as it will...
January 4, 2012 at 7:01 am
the best way is
where DateCol >='20111201' and DateCol<'20120101'
Dave
January 4, 2012 at 6:47 am
Ninja's_RGR'us (1/4/2012)
Dave Ballantyne (1/4/2012)
That being the case , maybe a simple SSIS would be better for you here ?
How would this go in anything less than 6 minutes in SSIS?
How...
January 4, 2012 at 5:53 am
That being the case , maybe a simple SSIS task would work better for you here ?
January 4, 2012 at 5:44 am
What is consumming the data ?
The plan estimates then data size to be ~500mb , it has also underestimated the amount of rows by a factor of 2....
January 4, 2012 at 5:07 am
Sounds to me like an unindexed foreign key lookup, trigger activity, blocking or indexed views.
Take a look at the plan and the active processes to see if you are being...
January 4, 2012 at 3:27 am
sqldba_newbie (12/13/2011)
May be, but that portion runs perfectly fine. Issue is really not there, i am sure there is better way to write that code but the real issue what...
December 14, 2011 at 12:10 am
Im afraid your design is wrong. The EAV (Entity , attribute, value) has been demonstrated time and time again to be inefficent.
You really need to change to a 'correct' normalized...
December 12, 2011 at 12:18 am
Sounds like a homework question,
have a look at hierarchyId or a recursive cte.
December 7, 2011 at 12:13 am
the blocked process report , would be a good option here.
http://www.sqlpassion.at/blog/PermaLink,guid,0cf203a4-963f-4db0-b26f-4e4d3fb41610.aspx
December 7, 2011 at 12:11 am
Sounds like a "parameter sniffing" issue , use the search engine of your choice for that phrase
December 7, 2011 at 12:09 am
Ok , it wasnt clear from your post.
The issue is , probably , duplicate data
Create TAble #t1
(
id integer
)
go
Create TAble #t2
(
id integer
)
go
insert into #t1 values(1),(1)
go
insert into #t2 values(1),(1)
go
select * from...
November 28, 2011 at 1:38 am
Viewing 15 posts - 136 through 150 (of 1,824 total)