Re: Syntax Check

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Pablo Castro [MS] (pablocas_at_online.microsoft.com)
Date: 02/23/05


Date: Tue, 22 Feb 2005 20:35:23 -0800

If you're running against SQL Server, you can use "SET PARSEONLY ON|OFF".
Check out books online for details on PARSEONLY. The short story is that you
can execute that before your statement so the server parses the statement
and generates an error if there is a syntax error, but the statement never
actually gets executed. Make sure you revert it to OFF before trying to
execute something for real.

-- 
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Cathie Hagen" <cathie@bob.com> wrote in message
news:uDaBA%23VGFHA.2180@TK2MSFTNGP12.phx.gbl...
> Hi All,
>
> Is there a way to do a syntax check on the statement without executing it?
>
> Cathie
>
>


Relevant Pages

  • Re: Execute Persmission denied on object sp_OACreate
    ... > SQL Server is creating a job behind the scenes. ... > permissions. ... > SA account password and gaining access to the database. ... >>> How can get a user permissions to execute these stored procedures ...
    (microsoft.public.sqlserver.security)
  • Re: Output stored procedure
    ... but the .execute command doen't show teh records. ... What object window? ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: grant access to extended properties
    ... Do you know anything about this "EXECUTE AS" for 2000? ... I played around with GRANT but apparently, a member of "db_datareader" ... Reading Books Online tells us that to add extended properties, ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • RE: exec sp_help_job user account rights
    ... wrapper in which u can call original stored procedure sp_help_job using “WITH ... EXECUTE AS “ clause and then give execute permission of external stored ... Database Administrator, SQL Server 2005 ... the sysadmin fixed role can use sp_help_job to view only the jobs he/she owns. ...
    (microsoft.public.sqlserver.security)
  • Re: SSIS - OLE DB Command - how to retrieve query results ???
    ... my side according to your process, and I managed to execute the task. ... Data Destination: <My SQL Server 2005 Instance>.TestDB ... OLE DB Command: ...
    (microsoft.public.sqlserver.dts)