C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Safer Execution of Queries in SQL


Posted Date: 27 May 2008    Resource Type: Tips    Category: Web Development
Author: Vasudevan Deepak KumarMember Level: Diamond    
Rating: Points: 1



Quick Overview


The query analyzer is a kind of double edged sword. You can just wipe out the entire database in just a couple of statements. Hence, whenever it involves an update or delete with an involved where clause, it is better to have it associated with a select first and then comment it out before linking with the actual update. While, many would resort to this, SQL itself comes with another syntax-checking mode called 'set parseonly on'.

MSDN URL: http://msdn.microsoft.com/en-us/library/ms178629.aspx

The SQL Way


If you just want to make sure of the syntax, just have this executed before the real statements.

set parseonly on

The .NET Way


The Microsoft.SqlServer.Management.Common comes with an enumeration to control the ParseOnly for ExecuteNonQuery. But I haven't yet delved deeper into it. Just thought of sharing this with other developers and hence putting it as a tip.

Conclusion


Hope this would be a quick and useful tip for developers fiddling around with SQLDb more carefully.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Add controls to GridView
Previous Resource: Automatic Memory Management and Garbage Collection
Return to Discussion Resource Index
Post New Resource
Category: Web Development


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use