Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 6th, 2007, 08:37 AM
Registered User
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Validating SQL query

Hi. I hope you can help me with this. I have a program where the user can modify a user query, but how do I validate in SQL that the query is fine?

Thanks in advance.

Kind regards,


Hailey
www.msaccessrepair.com - Access Recovery
 
Old September 6th, 2007, 08:42 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Use:

SET NOEXEC ON
//user query
SET NOEXEC OFF

This will just compile the TSQL and wont actually execute it if the syntax is correct. An incorrect syntax will geneate an error.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with C# and SQL query Codeman1234 C# 2005 19 April 24th, 2008 05:26 AM
Output Query to txt file from SQL Query everest SQL Server 2005 4 November 22nd, 2007 01:49 AM
sql query plug_samir SQL Server 2000 1 May 17th, 2005 08:26 AM
SQL query PinkyCat Classic ASP Databases 3 March 11th, 2005 01:41 PM
sql query vohra_vikas SQL Server 2000 2 September 28th, 2004 07:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.