Viewing 15 posts - 121 through 135 (of 182 total)
--I had to edit for dupes...
--I make no promisses on efficiency
SELECT DISTINCT t1.nbr, t1.dt, t2.dt, DATEDIFF(d, t1.dt, t2.dt) + 1 timeSpan
FROM @table t1
INNER JOIN @table t2
ON t1.nbr = t2.nbr
AND DATEDIFF(d,t1.dt,t2.dt)...
March 7, 2006 at 9:28 am
obviously, that would return 2 records by def 5/4-5/6 and 5/5-5/7
if you want to omit the second record...
select *
from @table t1
inner join @table t2
on t1.nbr = t2.nbr and t1.dt +...
March 7, 2006 at 8:50 am
if you are adamant about sticking to the DOS prompt, you can pipe the results of an osql.exe query to a DOS script after running DTS #1.
March 2, 2006 at 11:42 am
create a connection to computer #2. Create an execute sql task object referencing the connection. EXEC xp_cmdshell '...\program.exe'
March 2, 2006 at 11:39 am
thank you for the reply..
I am using an adp. It doesn't prompt as an error. It's a special record lock message. I will try to reproduce it...
March 1, 2006 at 2:45 pm
it's been a long day.. I was Reading it as D.O.S. Though that should have clued me in as well. I am assuming you are using DtsRun.exe. ...
March 1, 2006 at 1:40 pm
--I haven't forgot about you...
--I'm pretty sure this is your expected result set
SELECT
P2.R_ID,
P2.Field1,
P2.Date1,
S2.Field2,
S2.Field3
FROM
(
SELECT
R_ID,
--P.Field1,
MIN(S1.startDate) minStartDate
FROMTable1 as P
LEFT JOINTable2 as S1
ONP.Field1 = S1.Field1
ANDS1.StartDate >= P.Date1
GROUP BY
R_ID
--,P.Field1
) P1
INNER JOINTable1...
March 1, 2006 at 1:16 pm
I am unsure what DOS prompt refers to...
There are connection properties on the Execute DTS Package Task. If you must run via a sp, then add another connection object.
March 1, 2006 at 1:12 pm
just call the second dts from the first if that condition occurs.
IF (SELECT ISNULL(COUNT(*),0) FROM Table [WHERE ...]) = 0
BEGIN
RAISERROR()
END
Use the "on failure" work-flow to call the DTS
March 1, 2006 at 12:48 pm
a few different ways to do this...
first would be creating an sp to execute the DTS. IF COUNT(*) > 0 DTS ELSE RAISEERROR
another way (inside the dts) is add...
March 1, 2006 at 11:19 am
"C:\PROGRAM FILES\MICROSOFT SQL SERVER\80\TOOLS\BINN\Dtsrun.exe" /F "[.dts]"
you can pass variables like so...
/A[var name]="[value]"
March 1, 2006 at 11:08 am
did you set a primary key or index for your tables? how many records in each?
you may think about using the EXISTS statement.
p
inner join s1
on ...
where exists
(select min() from...
February 27, 2006 at 11:34 pm
play with the text file (destination) object in dts or if you don't want to do that...
select 'columnname' columnname
union
select columnname
from MyTable
February 27, 2006 at 12:31 pm
Select P.R_ID
, P.Field1
, P.Date1
, Min(S1.StartDate) As EarliestStartDate
, S2.Field2
, S2.Field3
from Table1 as P
Left join Table2 as S1
On P.Field1 = S1.Field1...
February 27, 2006 at 12:11 pm
>= vs > ...
the only difference was the pattern 100100 and 101010 respectively.
not sure why you couldn't get it started. I cut and pasted the query.
thank you for the...
February 27, 2006 at 7:50 am
Viewing 15 posts - 121 through 135 (of 182 total)