Ranter
Join devRant
Do all the things like
				++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
				Sign Up
			Pipeless API
				From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
				Learn More
			Comments
		- 
				
				This is why I actually write the where clause first, then the rest of the update or delete query.
 - 
				
				
yusijs12459yI always write the select statement first, and when I'm happy I remove everything before where and replace with update / delete / whatevs. :) - 
				
				A Post I read here once Said:
"I always start my update and delete querida with "LIMIT 1".
From there on, I always do that too, and if not necessary I remove after writing the full statement. - 
				
				@freeridet I altered up the SSMS default templates to start with BEGIN TRAN and end with ROLLBACK. I only change it to COMMIT when I'm sure it's good. This has saved me many times from stupid mistakes, even long after I was no longer a beginner.
 

The intern learned a great lesson today...
undefined