Viewing 15 posts - 1,156 through 1,170 (of 6,036 total)
vilyana (9/19/2016)
Sergiy (9/19/2016)
PatientMedicationCourse must be allocated to PatientTherapyCourse, not directly to PatientTreatment.
Medications prescribed for one Therapy Course must not be mixed with medications for another...
_____________
Code for TallyGenerator
September 19, 2016 at 2:21 pm
It seems the design is faulty.
PatientMedicationCourse must be allocated to PatientTherapyCourse, not directly to PatientTreatment.
Medications prescribed for one Therapy Course must not be mixed with medications for another one.
Relying on...
_____________
Code for TallyGenerator
September 19, 2016 at 12:41 am
Tom Goltl (11/19/2007)
Example.
Select char(39) + name + char(39) from sysobjects
Just build your string using char(39) to surround your strings. I find...
_____________
Code for TallyGenerator
September 18, 2016 at 9:12 pm
SQLBill (9/14/2016)
Conn1.temp01
Conn2.temp01
When using...
_____________
Code for TallyGenerator
September 15, 2016 at 8:49 pm
September 15, 2016 at 8:44 pm
If you're not feeling like emotionally attached to cursors then this should work fro you:
declare @PATIENT_ID int = 191
SELECT PATIENT_ID,VITAL_SIGN_ID,TS.CM_VITAL_TASK_SCHEDULE_ID, DATEADD(dd, t.N, SCHEDULE_START_DATE) EventDate, FREQUENCY_TIME EventTime
FROM TASK_SCHEDULES TS
INNER JOIN dbo.Tally...
_____________
Code for TallyGenerator
September 15, 2016 at 12:23 am
WHILE in that loop will never stop.
Value of @TSF_CM_VITAL_TASK_SCHEDULE_ID is coming from TSF.CM_VITAL_TASK_SCHEDULE_ID which according to the cursor query is equal to @CM_VITAL_TASK_SCHEDULE_ID:
SELECT TSF.CM_VITAL_TASK_SCHEDULE_ID,FREQUENCY_TIME
FROM TASK_SCHEDULE_FREQ TSF
JOIN SCHEDULE_FREQUENCY SF ON SF.SCHEDULE_FREQUENCY_ID...
_____________
Code for TallyGenerator
September 15, 2016 at 12:08 am
Did you forget FETCH NEXT in the inner cursor?
OPEN db_getTaskSchFreq
FETCH NEXT FROM db_getTaskSchFreq INTO @TSF_CM_VITAL_TASK_SCHEDULE_ID, @FREQUENCY_TIME
WHILE @CM_VITAL_TASK_SCHEDULE_ID = @TSF_CM_VITAL_TASK_SCHEDULE_ID
BEGIN
PRINT @SCHSTARTDATE+1
--SELECT @SCHTIME,@SCHSTARTDATE,@SCHENDDATE,@SCHFREQTP,@VITAL_SIGN_ID,@CM_VITAL_TASK_SCHEDULE_ID
-- INSERT INTO TASK_EVENTS(PATIENT_ID,VITAL_SIGN_ID,CM_VITAL_TASK_SCHEDULE_ID,EVENT_DATE,EVENT_TIME,
--EVENT_SLOT,ASSIGNED_TO,CM_TASK_EVENT_STATUS_ID,PAT_VITAL_SIGN_ID,IS_CONFIRMED,FACILITY_ID,CUSTOMER_ID,GN_STATUS,
--GN_MACHINE_IP,CREATED_BY,CREATED_ON,EDITED_BY,EDITED_ON,EVENT_END_DATE,EVENT_TYPE_CODE)
-- VALUES(@PATIENT_ID,@VITAL_SIGN_ID,@CM_VITAL_TASK_SCHEDULE_ID,@SCHSTARTDATE,@FREQUENCY_TIME,1,1,1,NULL,'Y',3,2,1,'127.0.0.1',
-- 1,GETDATE(),1,GETDATE(),@SCHSTARTDATE,1)
FETCH NEXT FROM...
_____________
Code for TallyGenerator
September 14, 2016 at 11:59 pm
Actually in the topic you referenced Boris from MSFT provided a query which returns dbid's for cached plans.
But you have to remember - some dbid's returned by it are odd.
And...
_____________
Code for TallyGenerator
September 14, 2016 at 11:47 pm
dbid makes sense only for DDL queries - CREATE PROC, ALTER VIEW, etc.
For "adhoc" DML queries you're asking for there is no certain database they can be mapped to.
A single...
_____________
Code for TallyGenerator
September 14, 2016 at 11:05 pm
abhas (9/14/2016)
Department Name Salary ...
_____________
Code for TallyGenerator
September 14, 2016 at 5:57 pm
You have 3 OR's in line with all the AND's.
Looks like the logic of the WHERE clause is broken.
_____________
Code for TallyGenerator
September 14, 2016 at 2:43 am
in WHERE clause change all checks like this:
[worksheetname] IS NOT NULL
AND Datalength([worksheetname]) > 0
to this:
[worksheetname]>''
_____________
Code for TallyGenerator
September 14, 2016 at 2:36 am
This should go faster:
insert into TypeRollup (col1,col2........as selected below...)
SELECT cpt.col1, cpt.col2,... ...... cpt.col10
FROM PType cpt
WHERE CLM_PKey = @PartKey
and PTypeID BETWEEN 1 AND 11
_____________
Code for TallyGenerator
September 13, 2016 at 11:16 pm
They even created the "getordinal" function for you:
SELECT COLUMNPROPERTY(OBJECT_ID(@TableName), @ColumnName,'ColumnId')
_____________
Code for TallyGenerator
September 13, 2016 at 11:07 pm
Viewing 15 posts - 1,156 through 1,170 (of 6,036 total)