Skip to content

Invalid Object Name – Tried a few things

I have the following query: It keeps telling me ‘invalid object name’. The table exists. I checked the drop-down to ensure the right database is connected. I refreshed Intellisense cache. Not sure what else to do… Answer I think you are looking for linked server object names, if so then you …

Better way to write a multiple case statement SQL

I have this query bellow. And I’m trying to find a better way to write this query that has a statement. I don’t want to store each case value in a temp table, but maybe in an array.. Any input? Answer Does IN satisfy what you want to do? It certainly shortens the code.

SQL Update with COUNT(*) less than 2

I have two tables to query from. An “Order_Details” table and a “Product” table. I need to COUNT(*) the amount of times each product has been ordered(identified by unique a “ORDER_ID”), from the “Order_Details” table. If the amount of times a product has been or…

Finding highest reached threshold

I have a table that contains 2 columns that store values of certain thresholds that can be reached. The table columns are: ThresholdValue (INT), Reached (BIT) and the table looks like this: …