Usually this error is associated with MS Access, points to syntax error
Seems like a security problem; make sure that the scheduled DTS runs in the same privilege context as your manual execution (the one you connect with)
Extended properties cannot be specified in the CREATE TABLE statement . They must be added with sp_addextendedproperty prosedure.
and later retrieved with FN_LISTEXTENDEDPROPERTY function.
All "standard" properties specified at design time could be retrieved with
SELECT COLUMNPROPERTY(...
The recommended way to find metadata information is INFORMATION_SCHEMA views (based on underlying system tables like syscolumns)
In your case:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
while it is possible to query system tables directly, it is not a good idea
Just remember to do this within context of transaction, with proper safeguards.
Some thoughts:
And if you have to transform the data before committing an update, and the transformation is a notch above trivial? What if each row in the returned select must be treated differently? The CASE...
A procedure or function would be more elegant solution.
use this:
SELECT (value1-value2) as diff
FROM dbo.TMPTABLECOMPARE
WHERE ABS(value1 - value2) < 5
You can re-write it as a stored procedure with OUT prameter.
---------------------------------------
create function format_data() RETURN VARCHAR(100)
as
BEGIN
declare @return_string VARCHAR(100)
select @return_string = EmployeeName + ' :' + DATEPART((PunchOut - PunchIn),HOUR) + ':' + GetDate()...
No need for subqueries:
select ld.device_name,dbdr.contact_priority,lc.contact_name
from lst_device ld
,db_device_role dbdr
,lst_contact lc
where LD.device_id = DBDR.device_id
AND LC.contact_id = DBdr.contact_id IN
Where is your JOIN condition? Without it you are bound to get a cartesian product (cross-join).
something like this:
where cal.field = hist.field and hist.field=c1.field
or, if you prefer SQL92/99 syntax:
from cal JOIN hist ON field1=field2 JOIN c1 ONfield=field
And if after that nothing...
Set-based operations are always the way to go, and should be used whenever possible. The soul of SQL are set operations.
However, the procedural extensions (of which cursor is an impostant part) were not introduced just for fun of it. There are situations when only procedural approach will work.
Use WAITFOR DELAY|TIME between the tasks.
It should not really matter as DDL is committed right away,
but your server might be busy, or something.
Also, if you are going to run it during installation time, use OSQL interface (not isql, which is an old DB-LIB interface). And, of course, test it...
create a new package, add an ActiveX Script Task, paste in the script, run it....:
-------------------
Function Main()
Dim oCmd, sSQL, oDom
''' If MSXML 4.0 is not installed this will not work!
Set oDom = CreateObject("Msxml2.DOMDocument.4.0")
Set oCmd =...
I did not mean - avoid cursors, just use them with caution.
For updates, use "forward only" cursor, as it consumes much less resources.
Using DAO/ADO (done my fair share there..)on the client would require additional round trips over the network; hardly superior solution.
Nothing mysterious there either:
-----------------
and c1.company IN('abc','def','hij')
and DATEPART(YEAR,cal.ondate)= '2004'
and DATEPART(YEAR,hist.appointment)= '2004'
-----------------
---and just forget the contacts
The only problem I can see is that SQL Server does not allow you to use...
There is nothing complex about this, or I might be missing something... create a procedure that accepts your parameters and returns resultset of the following query:
select
c1.accountno
,c1.company
,c1.contact
,cal.accountno
,cal.ondate
,cal.userid
,cal.rectype
,hist.accountno
,hist.ondate...
XML in SQL2K was much of afterthought, not a full fledged citizen. It shows even in the approach itself - no SELECT INTO allowed, no special XML data type (which is present in Yukon)...As a consolation I could add that Oracle and DB2 did not much better.
I guess, you cannot fix you EDI package...
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.