Viewing 15 posts - 226 through 240 (of 1,183 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 @a SELECT 2,1,18
INSERT @a SELECT...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 22, 2011 at 12:44 pm
GSquared (11/21/2011)
CREATE PROC dbo.DeleteMe
(@WeekDay INT,
@FromDate DATE,
@ToDate DATE)
AS
...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 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.
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 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.
http://www.sqlservercentral.com/articles/T-SQL/62867/
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 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
)...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 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
...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 17, 2011 at 1:47 pm
whole (11/17/2011)
may be 7-8 times a day
How many records are you talking about...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 17, 2011 at 1:06 pm
terryshamir (11/17/2011)
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 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.
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 7, 2011 at 9:33 am
Although adding a simple "." does the same. 🙂
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 2, 2011 at 9:17 am
Viewing 15 posts - 226 through 240 (of 1,183 total)