Viewing 15 posts - 4,006 through 4,020 (of 7,597 total)
CELKO (12/13/2016)
Obviously in a real schema, the identifier of an employee would be some sort of industry-standard encoding (Social Security number in the United States, social insurance number in Canada,...
December 13, 2016 at 12:23 pm
I see some strong advantages to the combined-bits approach.
To distinguish NULL values, I think you'd need another column of the same int type, with bits in it to indicate NULL...
December 13, 2016 at 10:55 am
You still don't need to cast the column, so why get into that bad habit? Yes, SQL corrects it in this case (at least for now?!). Why not...
December 13, 2016 at 10:45 am
Create the index below. Uncomment anything you can:
CREATE /*UNIQUE*/ NONCLUSTERED INDEX AdminObservation__IX_TherapyAdmin_ID
ON hcs.AdminObservation ( TherapyAdmin_ID )
INCLUDE ( VisitObservation_ID )
...
December 12, 2016 at 3:42 pm
...
WHERE datetime_column >= @StartDate_set_to_0800_AM AND
datetime_column < DATEADD(DAY, 1, @EndDate_set_to_midnight) AND
DATEPART(HOUR, datetime_column) BETWEEN 8 AND 16
December 7, 2016 at 3:23 pm
Personally I've had much lesser delays/stalls using this command:
ALTER DATABASE SQLTRIX SET OFFLINE WITH ROLLBACK_IMMEDIATE;
And you can get into devilish issues with "SINGLE_USER". You need to make sure you...
December 2, 2016 at 9:00 am
Double oops, you're right. I made sure, too, that I went back to Jan 1 00:00 to get the full year.
November 29, 2016 at 2:29 pm
I'd urge you not to create triggers on system tables, particularly job tables.
The sysjobs table does have a "date_modified" column. Presumably that column is updated whenever any step within that...
November 28, 2016 at 1:59 pm
Hmm, not sure. That file name should be allowed.
Verify again that the filename is correct:
USE <your_db_name>
EXEC sp_helpfile
The first column of the output will contain the logical file names.
November 28, 2016 at 1:48 pm
No, it isn't.
First, the first constraint name in the EXISTS is not the same as the first one in the code.
Second, you really need to check for, and create, these...
November 28, 2016 at 1:46 pm
Something like this should do it:
SELECT
SUM(CASE WHEN YEAR(Invoice_date) = YEAR(curr_year_jan_01) - 2 THEN amount ELSE 0 END) AS Total_2_Years_Ago,
SUM(CASE WHEN YEAR(Invoice_date) =...
November 28, 2016 at 1:41 pm
When a user wants to search for something in that log they almost always use a filter on the Created column. ...
* Clustured Index is a good choice when dealing...
November 25, 2016 at 9:58 am
This should be more efficient:
SELECT VisitID
FROM #Test
GROUP BY VisitID
HAVING MAX(CASE WHEN IsPrimaryCareProvider ='Y' THEN 1 ELSE 0 END) = 0
November 23, 2016 at 8:34 am
First, the Project table should be keyed on ( DomainID, SchoolID, ID ), if, as your example query implies, Domain is the more dominant "parent" relation. Reverse the first two...
November 22, 2016 at 11:19 am
Viewing 15 posts - 4,006 through 4,020 (of 7,597 total)