Viewing 15 posts - 1,606 through 1,620 (of 3,482 total)
Oh, like that... (feeling stupid)... definitely easier to see if they're all together, but I get it. Thanks!
February 20, 2017 at 12:34 am
I think this works... test it on a bigger dataset:
SELECT *
FROM (
SELECT SrvName
, [status]
, run_dt
, ROW_NUMBER() OVER (PARTITION BY SrvName, [Status]...
February 20, 2017 at 12:32 am
This is a 'Gaps and Islands' question. You're looking for all islands of size 4 or greater.
http://www.sqlservercentral.com/articles/T-SQL/71550/
February 20, 2017 at 12:05 am
Do you mean you want to use some code to identify the columns that only contain nulls so that you can skip them? If you know which columns are always...
February 19, 2017 at 6:35 pm
Ed,
Do you have an example of creating constraints the way Gail does, but naming them? The only examples I have seen require an ALTER TABLE ADD CONSTRAINT style... I...
February 19, 2017 at 4:56 pm
Probably a silly question, but if you don't name the foreign key, how do you drop it (the easy way)? Can you name the constraint when you declare it that...
February 19, 2017 at 12:57 pm
Does it work? Can you query the table to get the answers you need?
February 19, 2017 at 12:43 pm
Something like this?
CREATE TABLE dbo.Grades (
StudentID INT
,ExamID INT
,Grade TINYINT
,StudentStatus VARCHAR(10)
CONSTRAINT pkGrades PRIMARY KEY (StudentID, ExamID)
);
GO
ALTER TABLE dbo.Grades...
February 19, 2017 at 11:46 am
Taking a step backward, what is the table supposed to describe / store data about? Are the values {present, absent, disallowed} mutually exclusive?
February 19, 2017 at 11:03 am
Why not just put the "absent" or whatever in another column? If you try to stuff everything in the same column, querying your data is going to be a nightmare.
February 19, 2017 at 10:18 am
Does your parameter have a default set? If not, and you don't enter anything, the report won't run because the stored procedure can't return any data.
February 16, 2017 at 10:09 am
You've been here over 500 times and can't even post an answerable question with proper sample data??? Please read this article and repost.
February 8, 2017 at 11:49 pm
Create a variable to store the value and then pass it?
February 8, 2017 at 7:47 pm
Sounds like you could use a Windowing function to do this... this isn't right, but should give you some idea.
SELECT SuperTaskID
, SubTaskID
, ID
, TaskName
,...
February 8, 2017 at 5:49 pm
I tried running your CREATE TABLE and INSERT scripts, but they wouldn't compile. Oh wait, there were no scripts. Hence no useful reply,,,
February 6, 2017 at 9:26 pm
Viewing 15 posts - 1,606 through 1,620 (of 3,482 total)