It's possibile create a stored procedure without check sintax or code?

Alen Cappelletti 911 Reputation points

Hi I know seems a little bit strange..
but I'm only curious about...

basically I would like to create a stored in a DB like:

CREATE PROCEDURE [dbo].[rpt_Fatt]
SELECT bla from bla

Obviously I got:
Must declare the scalar variable "@Source Technology ".
Msg 102, Level 15, State 1, Procedure rpt_Fatt, Line 180 [Batch Start Line 9]
Incorrect syntax near ','.
but I know ...

only if it'is possible to SET a RUN AND CREATE without check.

Thanks ALen

A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,552 questions
{count} votes

2 additional answers

Sort by: Most helpful
  1. Erland Sommarskog 100.9K Reputation points MVP

    No, that is not possible. The procedure you create must be syntactically correct. It must also pass binding. That is, all columns in known tables must exist. However, if a query refers to a non-existing table, this will be suppressed, and so will other binding errors in that query.

    All source code should be stored on disk and be under version control. In that case, there is no reason to store unfinished code in the database.

    0 comments No comments

  2. EchoLiu-MSFT 14,571 Reputation points

    Hi @Alen Cappelletti ,

    When you execute arbitrary code in ssms, ssms will automatically check the syntax. If your grammar is incorrect, your execution will not succeed.
    So each piece of your code must have complete and correct syntax.
    Of course, you can simplify the code as much as possible. You only need to write the basic syntax requirements.

    If you have any question, please feel free to let me know.
    If the response is helpful, please click "Accept Answer" and upvote it.


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues November--What can I do if my transaction log is full?
    Hot issues November--How to convert Profiler trace into a SQL Server table

    0 comments No comments