Viewing 15 posts - 16 through 30 (of 54 total)
May be like this..there can be another way to do this
SELECT CASE WHEN NAME IN ('Foo','Alice') THEN 'Alice'
WHEN NAME IN ('Dan','Bob') THEN 'Bob'
ELSE NAME
END...
November 25, 2014 at 5:13 am
Hi ,Please try below if it's match with your desire result..
May be it can be done with more simply way.
I have alterd function alldays to include startdate for join.
ALTER FUNCTION...
September 1, 2014 at 4:15 am
You need to use primary key ..if it is sequential then it can be used ,else you need to generate identity i think.
August 7, 2014 at 11:29 pm
may be below script you can use with change as per requirement.
DECLARE @C INT
DECLARE @I INT
DECLARE @L INT
DECLARE @max-2 INT
SET @C = 1
SET @I...
August 7, 2014 at 11:07 pm
Hi,
please try below
SELECT DISTINCT [surveyName],[respondent],
(STUFF(
(SELECT ',' + filmPreference
FROM ##multiPick B
WHERE A.respondent = B.respondent
FOR XML PATH ('')),...
July 2, 2014 at 1:10 am
I think, you need to have audit table which would be same as original table with
two more fields version and action .action will store if it was insert,update or delete.
create...
June 28, 2014 at 5:29 am
Luis Cazares (6/11/2014)
SELECT p.TeacherId AS userID,
s.UserID AS student
FROM #temp p
JOIN #temp s ON p.UserID...
June 12, 2014 at 12:16 am
Jack Corbett (6/11/2014)
Pediatrician Parent Student
6062 6063 6064
6062 ...
June 12, 2014 at 12:14 am
may be like this..not sure if work or not as don't have sample data
INSERT INTO @tbl
(
vCreditApp,
...
June 4, 2014 at 3:50 am
There must be some other technique for this but from what i understand, i come up with below code..
;WITH CTE AS(
SELECT DATEPART(HH,starttime)S,COUNT(*)cnt,ScheduleDate,MIN(starttime)start, DATEADD(mi,1,MAX(endtime))endt
FROM [DoctorScheduleFortoday] WHERE UnitStatus = 0...
June 4, 2014 at 12:54 am
Hi..Ed Pollack
once again thanks..your code works correctly :-).
meanwhile i come up with below code..just to share
/* Data generation for #LocalTempTable */
DECLARE @Date1 datetime
DECLARE @Date2 datetime
SET @Date2 = '03-18-10'
SET...
May 20, 2014 at 8:12 am
Ed Pollack (5/20/2014)
The simplest solution to this would be to use PIVOT to flip the data into the format you are looking for. Please try out this SQL...
May 20, 2014 at 6:48 am
aberndt (5/19/2014)
May 20, 2014 at 1:15 am
Grant Fritchey (5/13/2014)
That's probably because eliminating the JOIN to the view, not considered a good practice, resulted in a better execution plan, speeding things up.
Ok..means view should be avoided in...
May 13, 2014 at 8:15 am
Viewing 15 posts - 16 through 30 (of 54 total)