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 TouchToneTommy 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. BobThornton

    Drop a table based on the count of records in another table

    Thanks to both of you! You both are way over my head. Chris, are you suggesting that I have one table - BOB Nightly, run the process, and compare the nightly data to BOB and only insert those records that do not match? Would I have to match all 70 fields from Nightly to Bob? Thanks again for...
  2. BobThornton

    Drop a table based on the count of records in another table

    Thanks! The issue is the count of records is usually >200K so having that many tables with that much data is the issue. The current process is automated using TOAD, so I want to keep it automated. I currently have - IF OBJECT_ID ('AdHocData.MDCOutEd.FL_MCD_Uni_Prev') IS NOT NULL DROP TABLE...
  3. BobThornton

    Drop a table based on the count of records in another table

    Thanks Andrejeck. No the tables do not need to be re-created. What approach would you take? I used to drop the PREV table, move CURR to PREV, drop CURR, then results to CURR
  4. BobThornton

    Drop a table based on the count of records in another table

    I run table updates daily. What I want to know is, can I drop table based on the count of another table? So I run the query that is built with CTE's. The last CTE output is FINAL What I want to do is - if the count of FINAL is greater than 1 then drop table PREV - this contains the data from 2...
  5. BobThornton

    Drop/Truncate tables based on a stored procedures value

    How do I reply directly to Andy?
  6. BobThornton

    Drop/Truncate tables based on a stored procedures value

    It's part of an overall SQL query. If the file is present - 1. drop tables 2. update table with new file 3. Do some table/field cleanup
  7. BobThornton

    Drop/Truncate tables based on a stored procedures value

    Hi Andy, I want to drop/truncate tables in a different database i.e. - DROP TABLE [database].[schema].RDTFOO
  8. BobThornton

    Drop/Truncate tables based on a stored procedures value

    I have the following so far - USE MASTER CREATE TABLE #TEMP_PHARM ( FILE_EXISTS INT ,FILE_DIRECTORY INT ,PARENT_DIRECTORY INT ) INSERT INTO #TEMP_PHARM EXEC xp_fileexist 'file path \ filename' SELECT * FROM #TEMP_PHARM Now I want to start DROP OR TRUNCATING...
  9. BobThornton

    Count records until a record value changes

    Thanks in advance for all of your help, it is greatly appreciated! I want to count the number of 'N' ANSWER records until the value of ANSWER changes the first time. So in below the count would equal 3 How can I do this? Please see below ID ANSWER DATE RANKING 12345 N 11/7/2022 1 12345 N...
  10. BobThornton

    windows command in a sql script

    I have a SQL query written that works fine. My question is, can I create a way to open and run a Windows Command from a third party software? Thanks in advance for your help and time.
  11. BobThornton

    Cross Join in an Insert Into

    Please see the query below. When I run the Insert Into... by itself, it runs, but when I run the entire query it fails with - Column name or number of supplied values does not match table definition. I'm trying to automate this query is why I have the T1 and T2. Thanks in advance for all of...

Part and Inventory Search

Back
Top