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

    Trying to use ODBC with Pervasive

    The instructions you have assume that the server is visible by name, either through SPX or through DNS on a TCP network. If you need to use the HOSTS file normally, I can assume that this is not true. Therefore, you *do* need to set up your HOSTS file to contain a reference to the target...
  2. Vancouverite

    SELECT statement does not work. If

    You cannot specify a field name in a variable without using dynamic SQL. Your query needs to be changed like this: Declare @SQL varchar(400) Declare @Count int SET @SQL = 'SELECT @ct = COUNT(*) FROM member_info WHERE ' + @member_id_typ + ' = @mbr_id' EXEC sp_executeSQL @sql, N'@mbr_id int...
  3. Vancouverite

    No idea how to approach query

    I probably should have included the FROM line in the example. You did add those, yes? Create View vwPayments AS SELECT Capital.Paid_to, Capital.sYear, Capital.sJanuary, Capital.sFebruary.... FROM Capital UNION ALL SELECT Advisors.Paid_to, Advisors.sYear, Advisors.sJanuary...
  4. Vancouverite

    Send Restore without being on Database?

    Restores should be executed while connected to the MASTER db. This is how I have implemented my restores. So, instead of: Initial Catalog = TagLinkSQLCS; Use Initial Catalog = master;
  5. Vancouverite

    Finding DB Tables without indexes

    This should give you the name of all tables without indexes (excluding statistics-generated automatic indexes): Select o.Name FROM SysObjects o LEFT JOIN (select id, indid from sysindexes WHERE name not like '_WA%' AND indid Not In (0,255) ) ix ON o.id = ix.id WHERE...
  6. Vancouverite

    No idea how to approach query

    Personally, I would start with a view: Create View vwPayments AS SELECT Capital.Paid_to, Capital.sYear, Capital.sJanuary, Capital.sFebruary.... UNION ALL SELECT Advisors.Paid_to, Advisors.sYear, Advisors.sJanuary, Advisors.sFebruary.... UNION ALL SELECT Corporation.Paid_to, Corporation.sYear...
  7. Vancouverite

    update record multiple fields

    This should do what you need: Update Table1 Set Field3 = t2.SumField3, Field4 = t2.SumField4, Field5 = t2.SumField5 FROM Table1 t1 INNER JOIN (Select Field1, sum(field3) as SumField3, sum(field4) as SumField4, sum(field5) as SumField5 from table2 group by field1) t2 ON t1.Field1 =...
  8. Vancouverite

    Nested Trigger Not Firing...

    I can't find any information confirming this, but... did you do a RECONFIGURE after the sp_configure 'nested_triggers', 1 call?
  9. Vancouverite

    Which is faster?

    In 2000i, SEEK (transactional access) is always faster for individual record lookups. Note that if you are using client/server access to a remote DB, a SQL call through the ADO driver will frequently be **significantly** slower than the same call through the ODBC driver when doing JOINs, if...
  10. Vancouverite

    Exporting Pervasive 2000i to MS SQL Server 2000

    I recommend using a DTS import package from SQL Server. DTS can use the Pervasive ODBC driver to connect to the Pervasive data, and the transfer is fast. (We use this for one table in our Pervasive DB).
  11. Vancouverite

    Wildcards on int cols

    Without casting, try passing a NULL instead of a % for a selection of all values. Then, your WHERE becomes: WHERE (intcol = @intvar OR @intvar IS NULL)
  12. Vancouverite

    ODBC error

    The DB Names file directory contains the DBNAMES.CFG file. This tracks the names and locations of your databases for ODBC connectivity. If you change this directory, be sure to move the DBNAMES.CFG file to the new location. The Working directory controls where temp files are stored...
  13. Vancouverite

    Rows of one table not present in other table

    Try: Select t1.* FROM Table1 t1 LEFT Join Table2 t2 ON t1.Col1 = t2.Col1 AND t1.Col2 = t2.Col2 WHERE t2.Col1 Is Null A LEFT JOIN returns all of the data in Table1, and any matching records in Table2. If Table2 does not have a matching record, then the Table2 Data is Null, so filtering on...
  14. Vancouverite

    Using a case statement in a view - sql 7

    Your main problem is that a View cannot contain an Order By clause. You will order the data after the select: SELECT * From MyView ORDER BY fldTestTypeID
  15. Vancouverite

    Group By

    Looking at your query, I don't think you need to Group By... I think you need to Order By. When you Group By X, you will return only one row per X, so if you successfully Group By Evaluator, there will only be one row per Evaluator. Instead, try: select eh.EvaluatorID, evo.FullName As...
  16. Vancouverite

    Stored procedure Size limit

    There isn't a size limit -- there is a limit in how much PCC can display on the screen. To see all of your SP, execute this query in PCC: Select XP$Misc FROM x$Proc WHERE xp$Name = 'MyStoredProcName' Make sure that you execute it in text mode (not into the grid). You will get all of your SP...
  17. Vancouverite

    how to use UDT in Visual Basic to depict COBOL Decimal Comp-3?

    This is certainly not a double in the UDT. You will need to construct a translation between the Cobol format and a VB data type. Now, I don't have any access to a Cobol-formatted DB, but... since the DataType is Decimal, this should not be too difficult to translate. Make your UDT for this...
  18. Vancouverite

    Get_Equal / Get_Next

    Actually, that is how GET_EQUAL/GET_NEXT are supposed to work. GET_EQUAL, as you know, finds a match based on the key. GET_NEXT simply steps through the table based on the index specified. Why work this way? Consider an index by date. YOu want to retrieve all of the records between...
  19. Vancouverite

    License

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_runsetup_5alh.asp
  20. Vancouverite

    SQL 2000 DTS Job Execute Process Task hangs...

    The VB program will only show a dialog box if there is an error. I realize that this is inherently dangerous (SQL Agent does not know to click the OK button), but I do not yet know how to write to the event log. I can help you there. Look at the LogEvent function in VB: App.LogEvent Err.Text...

Part and Inventory Search

Back
Top