Viewing 15 posts - 226 through 240 (of 1,182 total)
There are a few ways to skin this cat, but here are two ....
DECLARE @a TABLE
(CriteriaKoppelID INT, fkObjectID INT, fkCriteriaID INT)
INSERT @a SELECT 1,1,17
INSERT
November 22, 2011 at 1:35 pm
Alias' and Synonyms are similar, but not the same.
An alias only lives as long as your query. Synonyms live as long as the database lives OR they are dropped.
There are...
November 22, 2011 at 12:44 pm
GSquared (11/21/2011)
CREATE PROC dbo.DeleteMe
(@WeekDay INT,
@FromDate DATE,
@ToDate DATE)
AS
...
November 21, 2011 at 12:25 pm
Jason Selburg (11/21/2011)
Provided Sunday is your DATEFIRST
SELECT
sum(CASE WHEN datepart(dw,getdate()) BETWEEN 2 AND 6 THEN 1 ELSE 0 END)
WHERE TheDate between @fromdate AND @ToDate
OOPS, change the...
November 21, 2011 at 12:10 pm
Provided Sunday is your DATEFIRST
SELECT
sum(CASE WHEN datepart(dw,TheDate) BETWEEN 2 AND 6 THEN 1 ELSE 0 END)
WHERE TheDate between @fromdate AND @ToDate
EDIT: Typo corrected.
November 21, 2011 at 12:08 pm
You are much better off creating a dates table. This is just one of it's many uses.
http://www.sqlservercentral.com/scripts/Date/68389/
While you're at it, you might as well create a Tally table too.
November 21, 2011 at 11:54 am
Gazareth (11/18/2011)
Maybe this:
RETURN ( CASE WHEN
(SELECT COUNT(Credit_ID)
FROM
(
SELECT Credit_ID
FROM DIP.dbo.ProgramCredit
WHERE Program_ID = @ProgramID1
INTERSECT
SELECT Credit_ID
FROM DIP.dbo.ProgramCredit
WHERE Program_ID = @ProgramID2
) z
)...
November 18, 2011 at 10:25 am
CREATE FUNCTION dbo.CreditOverlap
(@ProgramID1 INT
,@ProgramID2 INT)
RETURNS BIT
AS
BEGIN
RETURN (SELECT CASE WHEN COUNT(*) > 1 THEN 1 ELSE 0 END
...
November 18, 2011 at 10:24 am
And don't forget the REAL benefit of contract to hire. You get to decide if you want to stay there too, without taking a hit on your resume for such...
November 17, 2011 at 1:47 pm
whole (11/17/2011)
may be 7-8 times a day
How many records are you talking about...
November 17, 2011 at 1:41 pm
as with anything in SQL "it depends."
How often will you be doing this comparison? Daily, Hourly, Every millisecond, as part of another process, etc...?
How many records are you talking about...
November 17, 2011 at 1:06 pm
terryshamir (11/17/2011)
November 17, 2011 at 7:58 am
This isn't completely dynamic, but close.
Instead of using SvcName, use a key/identity (1,2,3,4,5 ....) write the pivot to reference the key and have a set # that is more than...
November 17, 2011 at 7:24 am
I completely agree it's annoying as hell. What I'm looking for are arguments for and against. 😀
I am 100% against CS, FYI.
November 7, 2011 at 9:33 am
Although adding a simple "." does the same. 🙂
November 2, 2011 at 9:17 am
Viewing 15 posts - 226 through 240 (of 1,182 total)