SQL Server: what is better for performance?
What is better to use from point of view performance:
I have condition like this:
Combine table fields into one unique value (as input for HASHBYTES)
Objective I want to combine the four fields of a row into one value, named “COMBINED_VALUE”. These strict rules apply: Two rows with the same field values in the same order must produce the same COMBINED_VALUE. No two different rows may produce the same COMBINED_VALUE. Order of fields makes a difference, trailing spaces make a […]
SQL Server: Invalid Column with view and multiple schemas
I have two tables and two schemas created. I’ve already have a VIEW using both tables and both schemas. But when I try to modify it I receive the error invalid column name
. But if execute the query (only the SELECT
statement) with f5
it works fine.
How to transpose rows into columns and ensure all other data matches with the record using T-SQL (SQL Server)
I am repeating the question that was previously answered. I need further transposing for columns in the database, hence, I am reposting the question:
How to write a TSQL query that reduces multiple rows using COUNT with a filter for counting different columns?
I’m trying to write a TSQL query that reduces the following query result structure …
Dynamic pivot column list always with trailing whitespace
I have a problem creating a dynamic pivot table in SQL Server 2012.
SQL Server dynamic pivot column list always with trailing whitespace
I have a problem creating a dynamic pivot table in SQL Server 2012.
T-SQL claim subquery returns more than one value yet the data is unique
First Question. I am using SQL Server 2012. I couldn’t find a similar problem in other places, and I am still learning SQL.
I am trying to get a subquery to return one value. My table (JobMilestones) is unique when you compare JobPaperID AND Milestone. Any independent query will return only one value or no values. It gives and error –
Recursive CTE and how to overcome circular reference error
I have a script that is meant to find the originalLocation.
It starts with a table like this:
How to update rows for generic vs specific inputs in sql server
I have a table with structure
table1: col1, col2, col3, col4