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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by pwills

  1. pwills

    Can SQL link to MS Exchange or Outlook?

    EITHER Can Outlook folders actually be SQL Svr tables? OR Can SQL Svr link to (like Access can) Outlook folders? [I've searched the tek-tips archives to no avail]
  2. pwills

    SQL Mail doesn't see profile

    I've tried setting the startup account to bothe System and the account I am logged on to the computer as. In bothe cases the drop-down box for the Mail profile is empty. I have tested Outlook on the computer and it works OK. Does anyone know what I am doing wrong?
  3. pwills

    New User vs. New Login

    We have a web-based client database system. Our office admin wants to do a mail-merge via the ODBC connection straight into the database. I want to create an account for the ODBC connection on her machine which I can lock down. I am somewhat confused between logins and users. Question: 1...
  4. pwills

    Cannot export VIEW because table owner changed

    I have several views on source database A which refer to pwills.TABLE1. On my destination database B I intend to change the table to dbo.TABLE1. When I run DTS Export on the VIEW, it throws an error because "pwills" doesn't exist in database B. In practice, I have a large number...
  5. pwills

    Using COUNT to check if data exists horribly expensive

    Hi Terry, Thanks for this post. It does seem to me that is an n^n solution, because sql will search the table n times for each of n employees. But maybe SQL Server is more intelligent than that..
  6. pwills

    Father / Mother query

    My head will explode if I don't crack this soon. I have table like: Child Father Mother Bill Bob Jane Joe Mike Mary I need the view: Child Name Relation Bill Bob Father Bill Jane Mother Joe Mike Father Joe Mary Mother Can anyone help?
  7. pwills

    How do you bucket data?

    E.g. CustID Orders 1 10 2 5 3 5 View to show Bucket Count 0-9 2 10-19 1 20-29 0
  8. pwills

    Crystal Reports - are there alternatives?

    I need to produce many many HTML reports on my data and they have to be nicely formatted and offer drill-down and sort-ordering etc. Do you know if there are any software programs out there that can do this other than Crystal? I can't seem to get a good search on the web for this.
  9. pwills

    Child/Parent table - "family" view

    [NB. This is a derivative of a question posed on MS Sql Svr forum.] I have a classic self-referring table USER(USER_ID,PARENT) I want to list all users in Bob's "family" i.e. Bob, children, parent, siblings. Is the following query OK? Is it possible to avoid repeating the...
  10. pwills

    Using COUNT to check if data exists horribly expensive

    do you know if I can have something like: select empid, empname, supid, case exists (select * from from table t1 where t1.supid = empid) then 'y' else 'n' end from table
  11. pwills

    Using COUNT to check if data exists horribly expensive

    I was thinking for a list of supervisors select empid from table t1 where exists (select * from from table where supid = t1.empid) ..but don't know if legal sql
  12. pwills

    Using COUNT to check if data exists horribly expensive

    Surely this will check if supID and empID are the same? Imagine table: 1,Bob,2 2,Bill,<null> 3,Ben,<null> View should produce 1,Bob,2,N 2,Bill,<null>,Y 3,Ben,<null>,N
  13. pwills

    Self-join

    Thanks, I also found that the following works: select t1.id,t2.company from customers t1 left join customers t2 on isnull(t1.parent,t1.id) = t2.id Pretty neat but may not be ANSI
  14. pwills

    Using COUNT to check if data exists horribly expensive

    I have a table of employees, some of which are supervisors. (ID,NAME,SUP_ID) When I list them out, I want to mark which ID's are supervisors. E.g. ID,NAME,SUP_ID,Y/N It will display Y if any row has a SUP_ID set to ID. It seems horribly expensive (n^n) to do a count each time. Surely there...
  15. pwills

    Using ISNULL in self-join

    I have a classic self-joinable table: (id, profile, parent_id) where parent_id points to id. To produce a table of inherited values I have: select t1.id, case when t2.profile is null t1.profile else t2.profile end from mytable t1 LEFT JOIN mytable t2 on t2.parent_id = t1.id Problem is that my...

Part and Inventory Search

Back
Top