question

Rod avatar image
Rod asked

Question about parameters to a SP

I'm used to writing stored procedures like this: CREATE PROCEDURE MyProc @FirstName VARCHAR(50), @LastName VARCHAR(50) AS BEGIN --do stuff END But I've also seen this same code written like this: CREATE PROCEDURE MyProc ( @FirstName VARCHAR(50), @LastName VARCHAR(50) ) BEGIN --do stuff END Is it better to use paratheses, or not?
tsql
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
SQL Kiwi avatar image
SQL Kiwi answered
It makes no difference; it's purely a question of preference. Parentheses are required for functions, so some people find using them for procedures more consistent, but I really don't think it matters much at all. Go with whatever the coding standard at your current gig dictates.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.