Hot answers tagged

6 votes
Accepted

Can we exchange logical disjunction for UNION ALL?

One potentially important difference is that in the second case the literals are nvarchar and in the first case they are varchar. Ignoring that aspect however... Yes SELECT * FROM TABLE WHERE ...
Martin Smith's user avatar
2 votes
Accepted

Calculate total_worker_time in minutes

You may find this solution cleaner. Rather than doing a bunch of math over and over again and concatenating things together, you can add the milliseconds to a point in time (in this case 19000101) and ...
Erik Darling's user avatar
  • 38.2k
1 vote
Accepted

Can I do transaction for dynamic sql which contains DISABLE change tracking / TRUNCATE / PARTITION SWITCH

Yes, all DDL at a database level is transactional. This is not the case for server-level DDL, such as CREATE DATABASE or BACKUP RESTORE, but that is not relevant here. Dynamic SQL does not make a ...
Charlieface's user avatar
  • 11.4k

Only top scored, non community-wiki answers of a minimum length are eligible