Viewing 15 posts - 1,186 through 1,200 (of 3,011 total)
Tom.Thomson (10/15/2010)
Michael Valentine Jones (10/14/2010)
Always use Surrogate keys for the primary key. Add unique constraints on all natural keys (alternate keys).Any other approach will eventually get you in trouble.
Do you...
October 15, 2010 at 12:24 pm
selectDaysTillChristmas =
datediff(dd,getdate(),dateadd(yy,datediff(yy,-1,getdate()),-7))
Results:
DaysTillChristmas
-----------------
71
Note: This will always give you Dec 25 for the...
October 15, 2010 at 9:33 am
Time in job does not mean knowledgble. I interviewed a DBA with nine years of experience who did not know anything about user defined database roles or even that...
October 15, 2010 at 8:09 am
Always use Surrogate keys for the primary key. Add unique constraints on all natural keys (alternate keys).
Any other approach will eventually get you in trouble.
October 14, 2010 at 3:06 pm
Are the databases published for replication?
What is the result of this:
DBCC OPENTRAN
October 14, 2010 at 10:00 am
nirmal jain (10/13/2010)
October 13, 2010 at 2:20 pm
You are making it too complex.
select
*,
FirstDayRollingYear=
dateadd(yy,datediff(yy,0,dateadd(mm,-1,a.DT)),0),
LastDayRollingYear=
dateadd(yy,datediff(yy,-1,dateadd(mm,-1,a.DT)),-1)
from
( -- Test Data
select DT = convert(datetime,'2010-01-01')union all
select DT...
October 13, 2010 at 1:33 pm
DucatiRider (10/13/2010)
October 13, 2010 at 12:45 pm
select
LastDayCurrentMonth= dateadd(mm,datediff(mm,-1,getdate()),-1),
LastDayPriorMonth= dateadd(mm,datediff(mm,-1,getdate())-1,-1)
Results:
LastDayCurrentMonth LastDayPriorMonth
----------------------- -----------------------
2010-10-31 00:00:00.000 2010-09-30 00:00:00.000
(1 row(s) affected)
October 13, 2010 at 12:13 pm
GilaMonster (10/12/2010)
Michael Valentine Jones (10/12/2010)
You go through this whole series of explanations every day with new people, even debunking the inevitable “truncate the log and shrink the database” suggestion.
Yeah, I...
October 12, 2010 at 12:26 pm
GilaMonster (10/12/2010)
pietlinden (10/11/2010)
...but never any really good explanation of WHEN or WHY. I would find a little bit on the when and why really helpful...
There's a running joke...
October 12, 2010 at 10:25 am
Get rid of the "th" after "24".
select convert(datetime2,'May 24 2010') AS MyDate
Results:
MyDate ...
October 12, 2010 at 9:36 am
Since the source of data is a TXT file created with BCP, why don't you just order the TXT file in the order you want by using a query with...
October 12, 2010 at 8:24 am
Full text search would probably be the best option.
October 11, 2010 at 3:30 pm
Viewing 15 posts - 1,186 through 1,200 (of 3,011 total)