Tag Info

New answers tagged

0

This is beyond what SQL can do. Your application (which needs to be something more of a programming language than Excel) should orchestrate the task.


5

SQL Server 2008 R2 service packs are cumulative and can be used to upgrade all releases of SQL Server 2008 R2 to Service Pack 3. From http://www.microsoft.com/en-US/download/details.aspx?id=44271 Given the documentation, you should be able to go directly from SP0 to SP3.


0

For Sql Server , you can try something like this using GROUP BY UPDATE t SET date_to = '3000-12-31' FROM table t INNER JOIN ( SELECT ID ,max( date_to ) date_to FROM table group by ID ) t2 ON t.ID = t2.ID AND t.date_to = t2.date_to WHERE t2.date_to <> '3000-12-31' Or like this using ROW_NUMBER() UPDATE T SET date_to = '3000-12-31' FROM ( ...


0

I guess this is what you are looking for : UPDATE table_name SET date_to = "2011-05-29" WHERE date_to IN (SELECT MAX(date_to) FROM table WHERE date_to NOT IN("3000-12-31") GROUP BY ID); But it would be better if you use a unique ID(Primary Key) for each row,so that the update would be easy.


0

I ended up doing this, to do it in batches of 1krow (which takes about .2s per batch if there's nothing to update, 2s otherwise; basically it has the same total speed per row if it's in batches of 10k, 5k or 1k): SET SESSION sql_mode = 'strict_all_tables'; SET SESSION sql_warnings = 1; \W DELIMITER // DROP PROCEDURE IF EXISTS update_dmf_lifespan// CREATE ...


0

I think I got it..... SET hdIssues.IssueDate = COALESCE(DATEADD(day,@NumberOfDays,hdIssues.IssueDate),null), hdIssues.StartDate = COALESCE( DATEADD(day,@NumberOfDays,hdIssues.StartDate ),null), hdIssues.ResolvedDate = COALESCE(DATEADD(day,@NumberOfDays,hdIssues.ResolvedDate ),null), hdIssues.LastUpdated = COALESCE( ...


0

That is the most basic form of an update statement: update the_table set the_column = the_colum + 100; and one of the rows, is of the data type int. No. One of the columns is of data type int.


0

ROOT CAUSE Look at the following parts of your query UPDATE table_name (<<-- table_name) SET quantity = 19 WHERE productID = 148357 AND productCost IS NOT NULL AND exampleDate1 >= (SELECT min(exampleDate1) FROM table_name (<< -- same table_name) ...



Top 50 recent answers are included