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

    Family query in self-join

    The query I have at the moment is: SELECT id FROM users WHERE id='Bill' OR parent_id='Bill' OR id=(SELECT parent_id FROM users WHERE id='Bill) It seems like this might not be the most efficient way to write the query; the sub-select looks like it could be expensive. Any ideas?
  17. pwills

    Self-join

    Hi MeanGreen The basic query, without the case, doesn't seem to work. Take the following table: id, company, parent_id Bill,Microsoft,<null> Bob,<null>,Ben Ben,Oracle,<null> My query needs to produce the inherited company name: Bill, Microsoft Bob, Oracle Ben, Oracle The query select...
  18. pwills

    Family query in self-join

    My table is (id, name, parent_id) where parent_id is another row. I need a &quot;family&quot; query that will list all records that are either siblings or a parent or children of an id For example, table: 1, Bill, <null> 2, Bob, 1 3, Ben, <null> So the view family_of_Bill would list Bill and...
  19. pwills

    Self-join

    Can I check something with you? If I always pick the parent data id a parent ID is provided (i.e. regardless of whether null or not), is the query then: select t1.id, t2.company from customers t1 left join customers t2 on t1.parent = t2.id Obviously <null> parent is permitted but any value...
  20. pwills

    Web application user - standard permissions?

    I'd like to create a user &quot;application&quot; with which I connect to SQL Svr from all my web applications (rather than using dbo). Given that I have a standard database-driven website where users can insert,update, delete records is there a pre-defined role in Sql Svr 2k that I can assign...

Part and Inventory Search

Back
Top