Viewing 15 posts - 211 through 225 (of 247 total)
-- This is not elegant.
declare @HireDate as datetime
set @HireDate = '1/1/1990'
-- Pre-calculation
declare @Now as datetime
declare @NowPlus30Days as datetime
declare @dy1 as int, @dy2 as int -- for the day...
October 15, 2003 at 11:16 am
quote:
SELECT FName, LName, Hire_Date
FROM Employee
WHERE DATEDIFF(dd,GETDATE(),DATEADD(yy,DATEDIFF(yy,Hire_Date,GETDATE()),Hire_Date)) BETWEEN 0 AND 30--Jonathan
I do...
October 15, 2003 at 11:00 am
quote:
The two MAIN reasons I like identity columns is that you can put a clustered index on them and your inserts will...
October 14, 2003 at 10:20 am
Thanks for the links. DevHood seems the most similar; however, it's odd that this site rates me as a level 1 peasant. I resent that - as a...
October 14, 2003 at 8:29 am
You can also use EM Import/Export or the DTS copy sql server objects task. There is a point at which you can select the objects to copy - rather...
October 13, 2003 at 10:08 am
More fun...
create table #TableData (
Manufacturer varchar(12) NOT NULL,
Color varchar (15) NOT NULL
) ON [PRIMARY]
insert into #TableData (Manufacturer, Color)
select 'Toyota','Blue'
union all
select 'Toyota','Blue'
union all
select 'Honda','Red'
union all
select 'Honda','Red'
union all
select 'Honda','Green'
union all
select 'Ford','White'
union...
October 9, 2003 at 11:23 am
It would be nice to have an aggregate "SUM" that worked on strings. I've needed it before. Perhaps a pivot table like approach? I use the trim...
October 9, 2003 at 11:16 am
In general, if you need more data from the one record in the group, use a derived table to get the key and join. For example,
SELECT A.Id, A.Name,...
October 9, 2003 at 9:47 am
The MDACs are different.
sp3 - MDAC 2.7 sp1
sp3a - MDAC 2.7 sp1 refresh
Its not MDAC sp1, sp2, or sp1a - it's "refresh". Perhaps MDAC 2.7 sp1...
October 9, 2003 at 9:37 am
I like to put the drop in myself. Sometimes to debug a procedure, I copy it into QA and comment out the stored procedure specific stuff (changing the params...
October 9, 2003 at 9:02 am
One more thing. If your developers give you scripts to move procedures, make sure any permission grants are outside the procedure, not part of the procedure. Also, do...
October 9, 2003 at 8:45 am
We have about 20 dev, stage, and prod SQL Servers and many developers - about a dozen dbs per server. We found the best way to handle permissions on...
October 9, 2003 at 8:38 am
I noticed that the reads are 4x on the "slower" machine. How do the cluster sizes compare?
October 7, 2003 at 9:46 am
Viewing 15 posts - 211 through 225 (of 247 total)