Viewing 15 posts - 2,896 through 2,910 (of 3,544 total)
I would use and IF statement on CASESETTLED to decide which table to join to TBLCASE.
Far away is close at hand in the images of elsewhere.
Anon.
December 5, 2003 at 7:25 am
SELECT a.class, a.account, a.cust, a.doc_type
FROM documents a
LEFT OUTER JOIN documents b
ON b.class = a.class
AND b.account = a.account
AND b.cust = a.cust
AND...
Far away is close at hand in the images of elsewhere.
Anon.
December 5, 2003 at 6:35 am
Following on from Fank's suggestion, use ping instead
declare @ip varchar(255),@cmd varchar(100)
set @cmd = 'ping ' + HOST_NAME()
create table #temptb (grabfield varchar(255))
insert into...
Far away is close at hand in the images of elsewhere.
Anon.
December 4, 2003 at 6:50 am
Store value as both varchar and decimal, use the varchar to show original input and use decimal value for calculations.
Far away is close at hand in the images of elsewhere.
Anon.
December 3, 2003 at 7:00 am
John,
You might want to check your answer. There is a WHERE missing and you will not be use
a.StudentID in the sub query as it does not appear in the GROUP...
Far away is close at hand in the images of elsewhere.
Anon.
December 3, 2003 at 2:36 am
SELECT a.Year,a.CourseId, COUNT(distinct b.StudentId)
FROM TCourseTaken a
LEFT OUTER JOIN TCourseTaken b
ON b.CourseId = a.CourseId
AND b.StudentId = a.StudentId
AND b.Year < a.Year
GROUP BY...
Far away is close at hand in the images of elsewhere.
Anon.
December 1, 2003 at 7:27 am
quote:
envisaged it to be done without cursors
One way would be to create a...
Far away is close at hand in the images of elsewhere.
Anon.
December 1, 2003 at 7:14 am
AFIK it is set during install and relates to the unicode settings. I can't remember if you can select it, MS reckons you can. The normal id is 1033, is...
Far away is close at hand in the images of elsewhere.
Anon.
November 28, 2003 at 6:36 am
quote:
pick up multiple occurrences of the string in the same row
You could put...
Far away is close at hand in the images of elsewhere.
Anon.
November 27, 2003 at 5:36 am
What I was alluding to was to create the cursor like this
DECLARE db_curs CURSOR
FOR SELECT au_id FROM authors
WHERE Address LIKE '%'+@SearchStr+'%'
to do the scan...
Far away is close at hand in the images of elsewhere.
Anon.
November 27, 2003 at 4:55 am
Another possibility is to insert the PKs into a temp table (also with PK) and then loop thru that table using 'TOP 1', select, updatetext, delete until all rows processed.
...
Far away is close at hand in the images of elsewhere.
Anon.
November 27, 2003 at 4:17 am
quote:
can't use cursor because can't declare variable as text
If the table has a PK...
Far away is close at hand in the images of elsewhere.
Anon.
November 27, 2003 at 4:13 am
Jonathan, nice answer.
Just a question though. Whilst it may not be important but if, for example, there were 100 rows to be updated then the select between BEGIN/END would read...
Far away is close at hand in the images of elsewhere.
Anon.
November 26, 2003 at 6:12 am
One way is to use CASE but there may be performance issues.
WHERE (CASE
WHEN T_DocumentType.[Id] = '{8511C9BA-8D2E-4D8C-A58E-B1016F4A9977}') THEN
(CASE WHEN CAST(UD3 AS Integer) = 123456...
Far away is close at hand in the images of elsewhere.
Anon.
November 26, 2003 at 5:51 am
quote:
...if you placed a GO between the Alter and the Select...
True in this contrived example...
Far away is close at hand in the images of elsewhere.
Anon.
November 26, 2003 at 2:25 am
Viewing 15 posts - 2,896 through 2,910 (of 3,544 total)