SQL Server - DECLARE and commas

10 Posts
2 Users
0 Reactions
3,307 Views
Guido
Posts: 295
Admin
(@admin)
Member
Joined: 5 years ago

Thanks for the reminder. In SQL Sever I can see 3 different statements where the comma rule would apply

grafik

Do you see any other statment where the comma linebreak rule could be applied?


Reply
Posts: 6
Topic starter
(@tix2garr)
Member
Joined: 4 years ago

For SQL Server...

  • Procedure/function Parameters - CREATE PROCEDURE name @var type, @var type... AS
  • EXEC sproc var, var, var
  • INSERT INTO table (field, field...) VALUES (value, value...)
  • SELECT field, field...
  • ORDER BY field, field, ...
  • GROUP BY field, field, ...
  • My Lists...  (really like this, by the way!)
    • Some of mine:  IN, CONVERT, TRY_CONVERT, DECIMAL, IIF, ISNULL, LEFT, PATINDEX, RIGHT, SUBSTRING
  • UPDATE ... (field = , field = ...)
  • DECLARE @var type, @var type, ...
  • SET @var =, @var =, ...
    • Which can also be SELECT @var =, @var =, ...
  • CREATE TABLE name ( file type, field type, ...)

Those are the "only" ones I could think of/find.  Yes, most of the rest of them are already covered somewhere, but wanted to be as complete as I could.  🙂

There are much more specific ones like CREATE INDEX, etc., but those are a pain no matter what.  (I just put --FORMAT_OFF / --FORMAT_ON around them.  <chuckle>)

Back to you!  🙂

Michael


Reply
Guido
Posts: 295
Admin
(@admin)
Member
Joined: 5 years ago

OK, thanks. First tests ran fine. I will try to improve the indentions which looks sometimes ugly, when there are only 2 vars

grafik

Reply
Posts: 6
Topic starter
(@tix2garr)
Member
Joined: 4 years ago

Sounds like a plan.  Thank ya much!!  🙂

Michael


Reply
Guido
Posts: 295
Admin
(@admin)
Member
Joined: 5 years ago

Hi,

the new release is available for Download with a few new options

grafik

Reply
Page 2 / 2
Share: