About 34,600 results
Open links in new tab
  1. Need to create unique value in a column - recursive CTE?

    Dec 22, 2016 · I want the tsql to make a certain column (column1) unique and at least +2 away from any other column1 value. Definitely want to limit using more than +2 as I want the final …

  2. How to get row_number in sequence in recursive CTE

    Jan 21, 2016 · Functions like ROW_NUMBER operate only on the subset of data passed to them by the current recursion level and not the entire set of data passed to the recursive part of the …

  3. How to update CTE - social.msdn.microsoft.com

    Jan 25, 2012 · CTE is only available to the immediate T-SQL stmt after the with clause. You have repeat the whole CTE after the first update Like.

  4. what is difference between views and table and stored procedure

    Feb 8, 2012 · Tables contains data, views are defined queries basing on the tables and/or other views.

  5. Best way to reference calculated fields in a query

    May 14, 2009 · A CTE in 2005 is probably the best way to implement what you are after for neatness of code, but there is no performance difference between the CTE and a derived table …

  6. sql query to compare the last two records

    Dec 1, 2010 · After defining the CTE, I'm using it to compare the records as required. This uses a select statement against the CTE name data. The latest value is determined using the max …

  7. get comma separated list using STUFF - social.msdn.microsoft.com

    Jul 20, 2015 · Answers 1 Sign in to vote with cte as ( SELECT 1 Column1, 1 Column2 UNION ALL SELECT 1 Column1, 2 Column2 UNION ALL SELECT 1 Column1, 3 Column2 UNION …

  8. Assign a Day of week value to each table row?

    Jan 30, 2012 · My question is, how can I code some T-SQL to automatically assign the Day of the week value to each row in the table whenever the table is recreated/updated?

  9. function to test password complexity - social.msdn.microsoft.com

    Feb 24, 2008 · Nevertheless, I would be interested if anyone could provide benchmark figures for using regular expressions in CLR versus complex LIKE expressions in T-SQL for situations …

  10. Operand data type varchar is invalid for subtract operator

    Apr 20, 2012 · Actually I am trying to create a report in SQL Reporting Services. I need the T-SQL code to be accepted by Query Designer, otherwise it will just create an empty dataset with no …