Viewing 14 posts - 61 through 74 (of 74 total)
I guess the reason for not using select @@version (which I agree is far easier to type ) is that @@version requires further interpretation...
July 23, 2004 at 1:57 am
I'm not sure I can manage all that in a single query, however a stored procedure would be straightforward enough: use statements like select top 1 where <, select top...
July 16, 2004 at 9:35 am
Try this
update tablename T
set job_index = (select count(job_id) from tablename T2 where T.location=T2.location and T.job_id<T2.job_id) + 1
Here we are saying 'for all rows, set job_index to (the number of rows with...
July 9, 2004 at 3:10 am
I would love to use an integrated T-SQL debugged from within the Visual Studio IDE. Unfortunately, at the last THREE sites where we have tried to get it to work,...
July 9, 2004 at 3:04 am
This should work...
select order_id, account_id, order_date, order_status
from ordertable O
where
-- the latest order for a given account
order_date = (select max(order_date) from ordertable O2 where O.account_id=O2.account_id)
or
-- the not-quite-latest for a given account,...
July 8, 2004 at 3:23 am
I have to give a hearty 'me too' to what Julian Kuiters said. Don't use dynamic SQL unless you absolutely have to! - and even if you think you have to,...
July 8, 2004 at 3:12 am
OK so you want two kinds of row displayed in the query - type A: those that are the start of a 2+ week run of not-in-office, and type B: those...
June 28, 2004 at 8:19 am
Here's one example. Suppose you have Table1 with an id field ID and a flag field AwaitingProcessing. You need to process each row that has AwaitingProcessing equal to 1; for whatever reason,...
June 24, 2004 at 9:32 am
I would say what you say you have at the moment (which I assume is along the lines of
if var=A then
select fields from table where condition1
elseif var=B then
select fields from...
June 24, 2004 at 8:40 am
"to do with unicode" is correct. Just as the delimeter characters for a char, varchar, or text type literal are ' and ' (or " and "), the delimeter characters...
June 24, 2004 at 8:35 am
- Create a temporary table with the same columns as the target table, but with no indexes (to speed inserts)
- Do the one-by-one inserts into the temporary table
- When those...
June 23, 2004 at 10:30 am
If the SP runs arbitrary dynamic SQL, then the user must have the ability to run arbitrary SQL. However, I suspect there is going to be some pattern to the...
June 23, 2004 at 2:38 am
To get to a list of your watched topics:
Float over the 'My Account' element in the toolbar while you are viewing a forum page; the second item on the drop...
June 23, 2004 at 2:24 am
Viewing 14 posts - 61 through 74 (of 74 total)