• Senchi - Tuesday, January 2, 2018 7:19 PM

    CREATE PROCEDURE sp_cenik
    as begin

    DECLARE
    @OD DATETIME,
    @DO  DATETIME,
    @TipSobe VARCHAR(6),
    @KodaCenika  INT,
    @Sezona   INT

    SELECT
    @Od = :a2,
    @Do  = :a3,
    @TipSobe = :a1,
    @KodaCenika = :a4;

    I get:
    "Msg 102, Level 15, State 1, Procedure sp_cenik, Line 18
    Incorrect syntax near ':'.

    What am I doing wrong ?   These are parameters.

    So, the error message says that your syntax is messed up at the colon, this thing, : . You have colons on your code. T-SQL doesn't use colons in syntax like that. This is why everyone is having a hard time helping.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning