Viewing 15 posts - 1,891 through 1,905 (of 3,543 total)
The problem with using CHECKSUM is the possibility of having the same hash value for different data and therefore you would have to add secondary condition(s) to avoid this, therefore...
May 11, 2006 at 6:41 am
Dynamic PIVOT for 2005 (not tested)
DECLARE @tablename nvarchar(50)
DECLARE @groupby nvarchar(50)
DECLARE @pivcol nvarchar(50)
DECLARE @datacol nvarchar(50)
DECLARE @agg nvarchar(20)
SET @tablename = 'SOURCETABLE'
SET @groupby = 'ROWFIELD'
SET @pivcol =...
May 10, 2006 at 7:21 am
Write a function to concatenate T1ID's (plenty of examples on theis site) or if you do not wish to use a function then this will do it (limited to 6...
May 9, 2006 at 6:47 am
SELECT p.PostID, p.Title, p.Body, COUNT(r.ReplyPostID) AS [noReplies]
FROM Table_Posts p
LEFT OUTER JOIN Table_PostsReplies r
ON r.PostID = p.PostID
GROUP BY p.PostID, p.Title, p.Body
HAVING (SELECT COUNT(*) FROM Table_Posts p2...
May 8, 2006 at 6:42 am
Check the log file
is it set to autogrow?
by how much?
what was it's original size when created?
is all the space in the log used?
If your log file is 10G then it was...
May 8, 2006 at 2:09 am
Yeah possibly
Must admit I do not look to see if it's any form of homework/coursework
Unless you...
May 8, 2006 at 1:58 am
Look in BOL (Books Online) it will give you what you need eg
for a / b
CASE WHEN b=0 THEN 0 ELSE a / b END
May 7, 2006 at 11:14 am
The first error is because your language setting require dates in mm/dd/yyyy format.
The second error will be caused by a zero value divisor. Check the values of floortotal, FinalRtLsincSC and...
May 7, 2006 at 9:50 am
SELECT p.PostID, p.Title, p.Body, COUNT(r.ReplyPostID)
FROM Table_Posts p
LEFT OUTER JOIN Table_PostsReplies r
ON r.PostID = p.PostID
WHERE p.PostID BETWEEN @startIndex AND @stopIndex
GROUP BY p.PostID, p.Title, p.Body
May 7, 2006 at 4:22 am
Joe's solution of using COALESCE is what I first thought of myself.
Then I got to thinking about whether it would be possible to use checksum.
Insert a row in the table with...
May 7, 2006 at 1:36 am
You will have to use MAX to PIVOT the data.
Is there a reason you removed MAX, ie
More than 3 columns?
Multiple values per Element Code?
May 6, 2006 at 12:04 pm
The query works fine for me using your test data.
Are you sure you aer grouping by Pat & Adm only
if you include Element then you will get multiple rows as...
May 6, 2006 at 11:23 am
INSERT INTO [Dest1] (Pat, Adm, Col1, Col2, Col3)
SELECT Pat, Adm,
MAX(CASE WHEN Element = 'A1' THEN EleVal ELSE '' END),
MAX(CASE WHEN Element = 'A2' THEN EleVal ELSE ''...
May 6, 2006 at 5:11 am
The log file contains updates to the database and will increase automatically if allowed to by database settings and it is not truncated.
Depending on your maintenance plans you should regularly...
May 6, 2006 at 3:42 am
Viewing 15 posts - 1,891 through 1,905 (of 3,543 total)