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 Chriss Miller 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

    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...
  2. 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...
  3. 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...
  4. 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.
  5. 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