close
Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Filter by
Sorted by
Tagged with
Filter by Employee ID
Score of 2
1 answer
136 views

DDL: IF OBJECT_ID('tempdb..#Tab2And3Pop') is not null DROP TABLE #Tab2And3Pop; SELECT CAST(115704 AS INT) AS ConflictNoticeID , CAST(16003573 AS INT) AS MerchantID , CAST(13 AS ...
Advice
0 votes
8 replies
92 views

Is there an index hint in T-SQL that says "do not use any nonclustered index that would require a key lookup"? Apart from that one restriction, I want to let the query planner have a free ...
Advice
0 votes
7 replies
170 views

I have a reference table that contains a computed, delimited hierarchy column for items in a parent-child-grandchild relationship. For example if item #11 is under item #1, its ancestry is "~1~11~...
Score of 0
0 answers
82 views

I created a table in a script where one of the columns was established as such: CREATE TABLE [schema].[table]( [ColumnName] [int] DEFAULT 45); This will randomly generate a constraint like so: ...
Advice
1 vote
15 replies
234 views

I have two tables. One has the 2 partners & their events start date. The other has identical layout but has the last event date of the partnership. I need to get the last/current partnership with ...
Advice
0 votes
5 replies
122 views

I have an SQL query that displays all products, but I want to somehow apply a filter to display a subset of products from within using the field rWardStockList.TitleText that looks for the following ...
Score of 1
1 answer
148 views

I have two tables, and I'm looking to create a foreign key constraint between them. The tables are essentially structured as follows: Table 1: Name Description idx Table 2: Tbl1_idx1 Tbl1_idx2 idx ...
Score of 0
1 answer
146 views

I am working with a database that contains some special characters in nvarchar columns. Specifically, it has some text written in special characters, like those font generators create for Twitter or ...
Advice
1 vote
3 replies
134 views

I would like to query SQL database and set conditions in the Where clause that return results if a specified number of the conditions are met rather than if all or any of the conditions are met. For ...
Score of -5
1 answer
109 views

I've been tasked to write a query where a month and date combination from one column needs to not equal another date column. i.e. MED_EFF_DATE = 06/01/XXXX and MED_CANC_DT NOT EQUAL 08/29/XXXX I've ...
Advice
2 votes
2 replies
124 views

I am currently practicing SQL using the AdventureWorks sample database. Before posting, I tried searching but couldn’t find a structured collection of exercises specifically designed for practicing ...
Best practices
0 votes
3 replies
68 views

I have a report application that i'm replicating. This report shows us 4 columns based on a date filter. Assembly Line, Product#, Enters and Exits. The Enters and Exits are time Stamps of when this ...
Best practices
0 votes
5 replies
126 views

What is the best way to alter a production SQL Server 18 table's column size, varchar(n +1). My understanding would be the following: Shut the website down to stop the transaction from coming in. ...
Score of 9
1 answer
443 views

In a stored procedure (version 2019), renaming a column of a #table to a @value stops working for subsequent executions. The #table retains/gets the @value name of the very first execution. Is this an ...
Score of 3
1 answer
141 views

Suppose the following is the select statement of a view SELECT Emp.ID, Emp.FullName, Emp.JoiningDate, Dept.DepartmentName, Reg.RegionName FROM Employees AS Emp INNER JOIN Departments AS Dept ...

15 30 50 per page
1
2 3 4 5
4908