Please define "another database".
Another SQL Server, or do you mean another DBMS,
such as Oracle, MySQL, etc.
If you mean another SQL Server (SQL2000),
you can use DTS to do the job.
If some other flavor of db, then it gets more involved.
Try these query examples,
which assumes that the LDAP (AD) server has been
appropriately configured as a SQL linked server:
-- select from Sun iPlanet
select top 100 * from
OPENQUERY(LDAP_Server,'SELECT UserID, UserStatus
FROM ''LDAP://ldapserver:389/dc=org1,dc=org2'' WHERE...
Another convoluted approach would be to establish a linked server definition back to itself (the same server).
Then you can do an OPENQUERY to run your sp.
The mainline query will them treat the sp results as a temp table, to which you can JOIN, as necessary.
However, I wouldn't do this with...
How about:
begin transaction
UPDATE reminder
SET reminder.mycolumn = SOT.mycolumn, ....
FROM reminder
INNER JOIN someothertable SOT
ON reminder.matchup_col1 = SOT.matchup_col1
AND reminder.matchup_col2 = SOT.matchup_col2
...
where SOT.status = 'open'
INSERT INTO reminder(mycolumn, ....)...
SELECT CASE
WHEN ISNUMERIC(Code) = 0 THEN CONVERT(int,Left(Code,4))
ELSE CONVERT(int,Code)
END AS Test,
SUM(amount)
FROM test_search
GROUP BY CASE
WHEN ISNUMERIC(Code) = 0 THEN CONVERT(int,Left(Code,4))
ELSE CONVERT(int,Code)
END
Also, DTS can be run from command line as:
dtsrun /Sserver_name /Uuser_nName /Ppassword /Npackage_name /Mpackage_password
Also, see MSDN library article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/coprompt/cp_dtsrun_95kp.asp
There are fundamentally 2 ways to accomplish this,
and it looks like you have attempted to use both approaches at once. The preferred (newer) method is :
select T1.*
from Table1 T1
left outer join Table2 T2
on T1.[ID] = T2.[ID]
where T1.[ID] is not null
and T2.[ID] is null
The older...
I believe you have 2 choices:
(1)
DECLARE @mycol int
SET @mycol = 5
SELECT TOP 20 CASE @mycol
WHEN 1 THEN Col001
WHEN 2 THEN Col002
WHEN 3 THEN Col003
WHEN 4 THEN Col004
ELSE Col005
END AS mycol
FROM mytable
OR
(2)
DECLARE @mycol int
SET @mycol = 5
DECLARE @sql varchar(255)
SET...
You may want to check whether you are allowing nested triggers, using:
EXECUTE sp_dboption 'myDB', 'recursive triggers'
As described in BOL, you can add 'TRUE' or 'FALSE' to the above statement, to alter your current setting.
This may not be the issue here, but it's worth testing.
If you are using SQL2000, you could also setup a user-defined function, as described at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlmag01/html/TreatYourself.asp
If you are describing locking problems, particularly deadlocks, you may not need to resort to a trace (SQL profiler), although this can also be a useful tool.
Other tools would be Enterprise Manager (under Management/Current Activity), sp_who, sp_who2, and DBCC INPUTBUFFER. You will need to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.