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 Mike Lewis 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. mholbert

    Optimize Sql Query

    Awesome examples. I created the stored procedure 3 more times, one for each of your examples above. I then tested them each by right clicking on them and choosing execute, then populating the appropriate values for each input variable, and then running the resulting logic. I used the same...
  2. mholbert

    Optimize Sql Query

    The query takes 00:00:00.078 seconds to run. Both #LOV and #NOV only return the # of appointments for a given patient, so they could contain a hundred records each, but generally it would be far less than that. There are 1,902,333 records in the appointments table, and it grows by about 600...
  3. mholbert

    Optimize Sql Query

    I am building a stored procedure against a SQL 2005 database and need some help optimizing the query. It will end up running several hundred times a day so I want to make it as efficient as possible. I ended up having to use temp tables to get where i was going, and that is what i would like...
  4. mholbert

    Cleanup My Logic

    I cannot make any changes to the database structure perse, so i don't think i can enable cascade delete, but i will definately look into using Having instead of temp tables. thx. MH
  5. mholbert

    Cleanup My Logic

    I am working against a mssql 2005 db. I have largely tought myself sql, and as you will probably notice from the script below, I have lots to learn. The following logic collects encounters that need to be deleted, and then uses a fetch statement to accomplish the deletions. It works, but it...
  6. mholbert

    Top(50) Per Provider

    If either of you care to expound on your statements, I would love some plain english explanations of your syntax. What is CTE? it looks like you are defining it on the fly using the 'with ctexxx as'. are you using a variable as a table? What is the Over statement? I need to look up...
  7. mholbert

    Top(50) Per Provider

    interesting,is there a performance gain with your logic versus where i started? MH
  8. mholbert

    Top(50) Per Provider

    Awesome, I appreciate the help. Clearly i have lots to learn about t-sql. I would be interested to see how you would make the initial query less complex, and how it could be done with a derived table with row number in it. Thanks, MH
  9. mholbert

    Top(50) Per Provider

    its gonna take me a bit to make sense out of how that works, but in the meantime, i am getting the following syntax error. Msg 156, Level 15, State 1, Occurred on Line: 1 Incorrect syntax near the keyword 'where'. I copied and pasted what you sent and then had to clean it up bc the copy/paste...
  10. mholbert

    Top(50) Per Provider

    I am working on a sql statement to collect the top 50 highest patient balances per provider. I am running against a MSSQL2005 db. At present I have the following, which returns the top 50 for the whole database, not per provider, how do I change this to collect the 50 highest balances per...
  11. mholbert

    How to create a Does Not Contain query

    OK, no it seems pretty cut and dried using the NOT EXISTS, but I can't seem to get any answers. Here is the actual query. select distinct(c.source_id) as enc_id into #CT from charges c inner join patient_encounter pe on pe.enc_id = c.source_id inner join encounter_payer ep on ep.enc_id =...
  12. mholbert

    How to create a Does Not Contain query

    oops, that should have been select c.enc_id,c.sim into #one from charges c where c.sim in ('list of serveral sim codes') i haven't used the NOT IN or NOT EXISTS before. I will look into those. thx
  13. mholbert

    How to create a Does Not Contain query

    Im searching a sql database and trying to find where item A exists, but item B doesn't exist. so far I have something like the following: select c.enc_id,s.sim into #one from charges c where c.sim in ('list of serveral sim codes') that gives me a temp table with the encounter ids and the...
  14. mholbert

    NTDS Inter-site Messaging Errors

    I have a windows 2003 standard sp2 server, that appears to be having a problem. The Directory Service log shows the following errors, over and over again. First error: Date: 9.9.2007 Time: 8:47:51 AM Type: Warning User: N/A Computer: LRDCDC2 Source: NTDS Inter-Site Messaging Category...
  15. mholbert

    How do I Create a Table with a variable name

    awesome, thanks for the help. MH
  16. mholbert

    How do I Create a Table with a variable name

    I am working on a stored procedure to export data from a sql 2005 database. I would like to have the stored procedure create a new table in the database, and then populate it. I am planning on creating a job to have the stored procedure run once a month, and would therefore like the table...
  17. mholbert

    Moving Roaming Profiles to a different Server

    I have about 30 users with roaming profiles in my Windows Server 2003 Active Directory network. I want to move the location where the profiles are stored from one server (a db server) to another (my AD controller). Is there a problem with having roaming profiles, or home directories, stored on...
  18. mholbert

    Query Active Directory in Front Page 2003

    I am building an internal page and would like to have a form field on the page automatically populated with the windows user information. How do I get FrontPage 2003 to query active directory? Additionally, I would also like to find a way for a field to do a lookup without having to have a...
  19. mholbert

    Dynamic Parameters

    I am building a CRXI report against a stored procedure on a sql2k db. The stored procedure is quite simple, and has three input parameters. I want to build a dynamic list for the user to pick from to satisfy one of the parameters, but I cannot find a way to accomplish this. I need the...
  20. mholbert

    Password protect a bat file

    I downloaded it and will test later today. Thank PCE, I appreciate the assistance. MH

Part and Inventory Search

Back
Top