Viewing 15 posts - 181 through 195 (of 1,347 total)
I believe this will do it, but not sure how it will perform:
UPDATE M
SET Date_Rtn = rmt.CUS_DATE
FROM MAIN_TBL As M
INNER JOIN
-- Derived table
(
SELECT ORD_NBR, CUS_DATE
FROM LinkServer..DB.TableName AS L1
...
January 11, 2007 at 2:25 pm
T-SQL Parsing happens first. Then execution.
If the column does not exist, the parser barfs on the ALTER TABLE statement at *parse* time, before any of the code has actually executed.
You...
January 11, 2007 at 2:11 pm
>>where clearedate = 'Blank'
What datatype is the [clearedate] column ? If it's a datetime, you can't compare it to the text...
January 9, 2007 at 2:29 pm
You could use DatePart() and construct the string from each date element - would require the zero-padding logic.
An alternative is using format codes 10 (date as DD-MM-YY) and 8 (time as...
January 9, 2007 at 1:52 pm
Do you have any clustered indexes on the tables to prevent fragmentation ?
Does the UPDATE statement join on the "Invoice" column ? If so, is that column indexed in either...
January 9, 2007 at 1:19 pm
Create a queue table to hold the details of the email, and have the trigger insert records to this table, along with a timestamp of when the item was queued.
Then...
January 9, 2007 at 8:53 am
You didn't provide any DDL for table named "rptpxa2".
What are the datatypes of columns rptpxa2.PNO and rptpxa2.DCode ?
January 9, 2007 at 8:50 am
Why purchase a SQL RDBMS with a query optimizer that does all this for you, if all you're going to do is try to force the joins yourself ?
Wrapping certain...
December 28, 2006 at 11:34 am
Let's try that again. Too much eggnog ...
My derived table was wrong, should be the MAX() not MIN() for most recent.
Also, as pointed out, I neglected the time portion of...
December 22, 2006 at 1:48 pm
Join to a derived table that generates the most recent date:
SELECT OeOrders.SourceID, OeOrders.OrderID, OeOrders.CategoryName, OeOrders.ProviderID, OeOrders.ProviderName, OeOrders.ProviderOrder,
OeOrders.Meal, OeOrders.OrderDateTime, OeOrders.OrderNumber, OeOrders.OrderedProcedure, OeOrders.OrderedProcedureName, OeOrders.Priority,
OeOrders.ProcedureNumber, OeOrders.Quantity, OeOrders.ServiceDateTime, OeOrders.Status, OeOrders.VisitID,...
December 22, 2006 at 1:24 pm
>>I need to have SQL Mail workign for this to happen, don't I?
Instead of relying on setting up the "Notification" tab, we use the "Advanced" tab under job steps.
For the...
December 22, 2006 at 7:52 am
Consider switching to this:
http://www.sqldev.net/xp/xpsmtp.htm
Replace Send Mail tasks with Exec SQL tasks that call the xp_smtp_sendmail stored proc. SQL Mail with Outlook in Sql 2000 is horrible. We finally threw...
December 22, 2006 at 7:41 am
Even better would be to use this:
http://www.sqldev.net/xp/xpsmtp.htm
We have switched over to this due to continual headaches with xp_sendmail and Outlook. Any DTS task that needs to send email now...
December 21, 2006 at 4:40 pm
Viewing 15 posts - 181 through 195 (of 1,347 total)