Viewing 15 posts - 5,491 through 5,505 (of 7,191 total)
I think you just need to remove that whole line with the underlined part. If that doesn't work, please provide DDL, sample data and expected results.
John
March 21, 2011 at 7:33 am
I think you just need to remove "col4=".
John
March 18, 2011 at 10:57 am
Jith
Is it possible that any particular combination of deptID and locid would contain all NULLs in the grade column? If so, what would happen then?
John
March 18, 2011 at 5:34 am
Jith
What would happen if the same group of deptID, locID had different grades in it? For example, what if you had the following data?
insert into #grades values (5,5,10,'Class A',...
March 16, 2011 at 9:32 am
This is such a strange requirement that I think I must have misunderstood it. However, assuming I didn't, this will work:
create table #grades(id int,deptID int,locid int,desig varchar(10),grade varchar(2))
insert into...
March 16, 2011 at 7:55 am
Jeet
If Grade is NULL, how do you decide whether to update it with A, B or C?
John
March 16, 2011 at 5:29 am
Yes, and don't use NOLOCK in production code unless you don't mind getting approximate, as opposed to accurate, data.
John
March 15, 2011 at 9:55 am
Pete
Something like this?
SELECT COUNT(*)
FROM MyTable t1
JOIN Mytable t2
ON t1.ProcessId = t2.ProcessId
AND t2.Month = t1.Month + 1
AND t1.Compliant <> t2.Compliant
John
March 15, 2011 at 9:48 am
Mike
I don't think there's an easy way of doing this. One option is to restore last night's backup to a different server (or a different database on the same...
March 15, 2011 at 9:24 am
1. No, you should have identical hardware for each node. I can't remember whether this is compulsory or just highly recommended. You should also check that the hardware...
March 14, 2011 at 9:32 am
Philippe
Have you tried a DDL trigger? You should be able to automatically grant permissions on an object as soon as it's created. I've never tried using a trigger...
March 14, 2011 at 9:04 am
I suppose you could create a job on the second server that removes that login's access to your database at a specified time.
John
March 11, 2011 at 8:19 am
Something like this?
WITH PatientNos AS (
SELECT ROW_NUMBER () OVER (ORDER BY NEWID()) AS PNo
, *
FROM Patients
)
UPDATE PatientNos
SET PatientName = 'Patient' + CAST (PNo as varchar(7))
John
March 11, 2011 at 3:33 am
Your CASE statement looks OK, although you haven't said exactly what you're trying to achieve with it. As I said, please provide DDL, data and expected results.
John
March 11, 2011 at 2:47 am
I think we're going to need some table DDL and sample data in order to help you with this, please.
Do you get an error message when you run that query,...
March 11, 2011 at 2:30 am
Viewing 15 posts - 5,491 through 5,505 (of 7,191 total)