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: *

  • Users: Tim1
  • Order by date
  1. Tim1

    Rebuild Indexes?

    Hiya, I can't see any need to rebuild indexes. If you run an Update Statistics and a DBCC on a regular basis, this should take care of it for you. HTH Tim
  2. Tim1

    Full Outer Join Question

    Hiya, I am not quite sure which version of Sybase you are using, but I don't think that Sybase supports the "OUTER JOIN" syntax that you have used. What should work for you is : SELECT * FROM Table_A A, Table_B B WHERE A.Field1 *= B.Field1 AND A.Field2 *= B.Field2 Tim
  3. Tim1

    Listing tables

    Hiya, To execute a stored procedure, it is just EXEC database_name.owner.stored_procedure_name If you are in the database that the stored procedure is in, and are aliased as dbo, then you can just do EXEC stored_procedure_name To list all tables in a database, you need : USE database GO...
  4. Tim1

    Compare Dates

    Hiya, The function that you need is DATEDIFF. Depending on how you want to see the information, the syntax is DATEDIFF (part_of_date [eg. dd, hh etc.], due_date, actual_date). This will give a positive figure for late deliveries, and a negative figure for early deliveries. HTH Tim
  5. Tim1

    list indexes

    Hiya, Depending on which RDBMS you are using, there is a system table that holds the information. In Sybase/SQL server, the syntax is SELECT name FROM sysindexes This will list ALL indexes in a database. If you want to restrict it to one table use : SELECT name FROM sysindexes WHERE...
  6. Tim1

    getting value of just inserted rows

    Hiya, Which RDBMS system are you using? Are you using an Autonumber (Identity) column? If so, in Sybase, there is global variable @@identity, which will tell you the last value used, depending on the system you are using, there may be an equivalent. Tim
  7. Tim1

    SQL Insert Queries

    Hi Carla, You cannot add more than one row at a time when using the VALUES keyword. To add more rows, you need to create more insert statements. The only way that you can add more than one is when you are copying data from one table to another, when you can use a SELECT FROM in your INSERT...
  8. Tim1

    MAX(... help)

    Hiya, A having clause should only be used for aggregate functions, such as checking counts, mins, maxes etc. Try : SELECT MAX(SELECT Sum(Prescription.Quantity) gross FROM Doctor, Prescription WHERE Doctor.DoctorID = Prescription.PHN AND (Prescription.PCoName="MedCorp") GROUP BY...
  9. Tim1

    retrieving data from different servers

    Hiya, You cannot run across multiple servers on Sybase (not up to version 12 anyway). All you can do is get the DBA to create a proxy table, which is basically a behind the scenes link between the two servers, so that the table appears to be on the server that you are running your code from...
  10. Tim1

    Modulo Question for SQL Server

    Hiya, You could try SELECT ACCOUNT_NUMBER, EM_NO + IN_BANK + NT_BANK AS SPA, CURRENT_BALANCE, CYCLE_CODE_99 FROM dbo.MASTER_CUR WHERE ((EM_NO + IN_BANK + NT_BANK) IN ('502650000000', '851190000000')) AND (CURRENT_BALANCE between...
  11. Tim1

    Prevent selection of certain records

    Hiya, I have never heard of Sybase being set up to provide row level security, which seems to be basically what you need to do. Tim
  12. Tim1

    Checking whether account is valid or not

    Hiya, Why don't you try checking @@rowcount to determine if a valid account number has been found, and just running the cursor through table b as below: create proc check as begin declare csr cursor for select @ac_id=b.account_id from tableB b open csr while (@@sqlstatus !=2) begin SELECT...
  13. Tim1

    Left Join question

    Hiya, I may have misunderstood the question, but I think that you only want what is in table 1 and not in table 2 returned. In this case, you should be able to use NOT EXISTS SELECT t1.* FROM table1 WHERE NOT EXISTS (SELECT 1 FROM table2 t2...
  14. Tim1

    Policy development

    Pivan, I suggested allowing some latitude, not a complete free-for-all. At one of the more progressive places that I work, the rules were: a. Do not let it interfer with your work. If you are waiting for a program to compile or run, or on-hold on the phone, that is OK. b. Do not use sites...
  15. Tim1

    Add A Character

    Hi, This is probably a simple question, so forgive me if it is.... I am currently having problems processing a file that is sent down from our DOS (I know!!) system to the Unix box. It processes all rows except that last one, which for some reason, it does not read. However, if we VI the...
  16. Tim1

    How can I tell if a temp table exists before dropping

    Hiya, You should be able to do: IF OBJECT_ID('my_table') IS NOT NULL DROP TABLE my_table HTH Tim
  17. Tim1

    Selecting ENTIRE Rows or columns with SQL

    OK, I suggest that you repost this query in the MS SQL forum, you will find many good MS SQL people there. Basically, you should be able to do it by building some dynamic SQL using system tables, such as sysobjects, syscolumns etc. HTH Tim
  18. Tim1

    Selecting ENTIRE Rows or columns with SQL

    Hiya, What RDBMS system are you using? There are several ways, but you need to access system tables to do that you want, unless you want to resort to the good old SELECT * FROM table_name
  19. Tim1

    bulk insert

    Hiya, I think that it means that a field terminator has been found in the wrong place. You would need to check the source data that you are entering for a field seperator (I think dbf files are delimited with a tab, but it is a while since I worked with them) in the wrong place, meaning that...
  20. Tim1

    Policy development

    First, I have been blessed to have a develpoment staff that does research on their own time or in the course of solving a work related problem. If as part of their assignment, say optimizing compile time, they have to do research, then I expect to see them researching at their desk. Or if it...

Part and Inventory Search

Back
Top