update TCalendar
set = WeekNumberOfMonth = DATEDIFF(week, DATEADD(MONTH, DATEDIFF(MONTH, 0, FullDateAlternateKey), 0), FullDateAlternateKey) +1
More Related Contents:
- Add a column with a default value to an existing table in SQL Server
- Can I protect against SQL injection by escaping single-quote and surrounding user input with single-quotes?
- How to Join to first row
- Is SQL IN bad for performance?
- Pivot using SQL Server 2000
- How to get the first and last date of the current year?
- How can I generate a temporary table filled with dates in SQL Server 2000?
- How Can I Sort A ‘Version Number’ Column Generically Using a SQL Server Query
- Perform regex (replace) in an SQL query
- WHERE IS NULL, IS NOT NULL or NO WHERE clause depending on SQL Server parameter value
- Find last sunday
- MySQL: Alternatives to ORDER BY RAND()
- IN vs ANY operator in PostgreSQL
- sql query to return differences between two tables
- SQL Server 2005 How Create a Unique Constraint?
- Is there any boolean type in Oracle databases?
- Record returned from function has columns concatenated
- Rails 3 execute custom sql query without a model
- How to Select a substring in Oracle SQL up to a specific character?
- passing table and column name dynamically using bind variables
- SQL Use alias in Where statement
- PostgreSQL JOIN with array type with array elements order, how to implement?
- Trim trailing spaces with PostgreSQL
- Nth max salary in Oracle
- divide by zero/null workaround in SSRS 2008 report
- What does sp_reset_connection do?
- How to correctly insert newline in nvarchar [duplicate]
- Check whether string is a date Postgresql
- Postgresql query between date ranges
- Oracle ‘Partition By’ and ‘Row_Number’ keyword