Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. markVII

    LoadFromSQLServer failed - OLE Automation Error

    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)
  2. markVII

    joining tables from different servers

    Link the servers. Make sure the DTC (Distributed Transactions Coordinator) is up and running. Know ramifications (performance, resources etc).
  3. markVII

    SQL 2000 - Column description?

    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(...
  4. markVII

    SQL 2000 - Column description?

    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
  5. markVII

    Is a cursor the best way to fetch a value?

    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...
  6. markVII

    Best Practice - Checking values in table/query to continue

    A procedure or function would be more elegant solution. use this: SELECT (value1-value2) as diff FROM dbo.TMPTABLECOMPARE WHERE ABS(value1 - value2) < 5
  7. markVII

    PAD_INDEX

    I believe sysindexes would be the place. check INFORMATION_SCHEMA views, too
  8. markVII

    Stored Proc - Hours banding

    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()...
  9. markVII

    sql query question

    Use subquery. Something like this: select * from customers where date not in (select date from details)
  10. markVII

    Nesting Queries or Another Way

    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
  11. markVII

    need to create a complex stored procedure

    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...
  12. markVII

    Is a cursor the best way to fetch a value?

    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.
  13. markVII

    Use Table error &quot;Table not found&quot;

    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...
  14. markVII

    Use Table error &quot;Table not found&quot;

    Where do you run the script from? Works fine from my Query Analyzer. Nevertheless, I would separate the tasks anyhow, just to be on the safe side.
  15. markVII

    Suggested methodology for SP update

    Use the forward only cursor, as I recommended in the previous thread.
  16. markVII

    XML to text file question...

    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 =...
  17. markVII

    Is a cursor the best way to fetch a value?

    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.
  18. markVII

    need to create a complex stored procedure

    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...
  19. markVII

    need to create a complex stored procedure

    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...
  20. markVII

    XML to text file question...

    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...

Part and Inventory Search

Back
Top