This is the weirdest and most simple error I have ever seen in my 5+ years of SQL experience. Hopefully someone has run into this before. I am getting a query timeout when including a specific column in a select statement, but no timeout when I do "select *". I'll paste in queries that work, as well as queries that don't work. When I include by name the column "invoice_finalised" the query times out. When I include invoice_finalised and remove *any other column* it works fine (<0.1s). When I do "select * from invoice" it runs fine. The problem seems to be when I use the column by name. This is terribly confusing. Thanks for any help you guys can offer.Works:select invoice_id, customer_code, invoice_creation_ts, invoice_created_by, customer_invoice_code, total_items, total_weight, invoice_total from dbo.invoiceselect * from dbo.invoiceselect invoice_finalised, invoice_id, ((((customer_code removed)))) invoice_creation_ts, invoice_created_by, customer_invoice_code, total_items, total_weight, invoice_total from dbo.invoiceselect invoice_finalised, use_shipping_address, invoice_id, customer_code, invoice_creation_ts, invoice_created_by, customer_invoice_code, total_items, total_weight, invoice_total from dbo.invoice
DOESN'T work (just times out):select invoice_finalised, invoice_id, customer_code, invoice_creation_ts, invoice_created_by, customer_invoice_code, total_items, total_weight, invoice_total from dbo.invoice
Below is my table creation statement. There are only two rows in the table, and the offending bit column (invoice_finalised) is set to 1 for both rows. Does this make sense to anyone?CREATE TABLE [invoice] ([invoice_id] [int] NOT NULL ,[customer_code] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,[invoice_creation_ts] [datetime] NULL ,[invoice_created_by] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,[current_gold_fix_gram] [decimal](6, 2) NULL ,[invoice_processed_by] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,[shipping] [decimal](6, 2) NULL ,[customer_invoice_code] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,[total_items] [int] NOT NULL CONSTRAINT [DF_invoice_total_items] DEFAULT (0),[total_weight] [decimal](6, 2) NOT NULL CONSTRAINT [DF_invoice_total_weight] DEFAULT (0.0),[invoice_total] [decimal](18, 2) NOT NULL CONSTRAINT [DF_invoice_invoice_total] DEFAULT (0.00),[logged_in_user] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_invoice_logged_in_user] DEFAULT (''),[invoice_notes] [varchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,[invoice_finalised] [bit] NOT NULL CONSTRAINT [DF_invoice_invoice_finalised] DEFAULT (0),[use_shipping_address] [bit] NOT NULL CONSTRAINT [DF_invoice_use_shipping_address] DEFAULT (0),CONSTRAINT [PK_invoice] PRIMARY KEY CLUSTERED([invoice_id]) ON [PRIMARY]) ON [PRIMARY]