amachanic / sp_whoisactive

sp_whoisactive
GNU General Public License v3.0
1.17k stars 289 forks source link

Rename file to dbo.sp_WhoIsActive.sql #4

Closed ktaranov closed 2 years ago

ktaranov commented 5 years ago

Hi, Adam. Great thanks to move in open source club your awesome stored procedure. Could you rename who_is_active.sql to dbo.sp_WhoIsActive.sql (prefered for me ) or just sp_WhoIsActive.sql ?

amachanic commented 5 years ago

Can you share the reasoning behind that change?

ktaranov commented 5 years ago

Hi, Adam, thanks for quick response. It is more clear and consistent naming files with production stored procedures with schema name (we use schemas for maintaining security roles ) and procedure name. First what I do with new version of your procedure - rename the file name. Also we use case sensitive instances and for us is very important to have correct notation: sp_whoisactive and sp_WhoIsActive critical difference in this case.

paulholmes-london commented 5 years ago

{SchemaName}.{ObjectName}.sql is also what Redgate source control uses, capitalised exactly as the object and schema are named.

amachanic commented 5 years ago

Okay. This seems like a reasonable request. I'm going to pin it for a few weeks.

If you're reading this and interested, please reply and cast a vote:

1 Leave it as-is

2 sp_WhoIsActive.sql

3 dbo.sp_WhoIsActive.sql

My vote is #2.

This is entirely due to my personal preference of organizing objects by schema in subfolders. So I'd have a subfolder called "dbo" in my project, with all of my dbo. stuff in it.

paschott commented 5 years ago

Torn on this. I usually name my files just as files and they sit in a separate folder for schema so no schema prefix. I lean slightly towards #2, but wouldn't be bothered by #3. I do agree that the name of the file matching the name of the proc is a good thing.

ktaranov commented 5 years ago

3

luporpi commented 5 years ago

2

ClaudioESSilva commented 5 years ago

2

olegstrutinskii commented 5 years ago

2

wdcadmin commented 5 years ago

2

paulholmes-london commented 5 years ago

3 (neither SSMS File Per Object scripting, or Redgate source control, uses folder per schema)

BobPusateri commented 5 years ago

2

BruceSpruce commented 5 years ago

2

blaw-fc commented 5 years ago

I prefer 3, but 2 is also fine.

tgspacelabs commented 5 years ago

2

lowlydba commented 5 years ago

2

beargle commented 5 years ago

My preference is 3 first, 2 at a close second.

Some examples, for those that may not be familiar with Red Gate or the default Visual Studio database project folder structures.

Red Gate SQL Source Control (i.e. number 3)

├───Assemblies ├───Data ... ├───Security ... │ ├───Roles │ ├───Schemas │ ├───Symmetric Keys │ └───Users ... ├───Stored Procedures │ _dbo.spWhoIsActive.sql ├───Synonyms ├───Tables ├───Views

Default (w/ schema folders) Visual Studio database project (i.e. number 2)

│ Database6.sqlproj ├───bin │ └───Debug ├───dbo │ ├───Stored Procedures │ │ _spWhoIsActive.sql │ └───Tables ├───obj │ └───Debug ├───Security ...

MisterZeus commented 5 years ago

2 for me, because of Visual Studio defaults.

vemund commented 5 years ago

3

sqlmaas commented 5 years ago

2 because of VS.

andrew-bickerton commented 5 years ago

Similar to a lot of others: 3, followed by 2 as an acceptable alternative

MattHubble commented 5 years ago

3

NoDakCoder commented 5 years ago

2 looks cleaner, and I personally sort projects and archives similarly (Server > Database > Schema > File)

chrome-brutus commented 5 years ago

3

waynerossi commented 5 years ago

2, if nothing else it matches. Don't like putting the schema in file names.

robboek commented 5 years ago

2

sam-bryant commented 5 years ago

3

AartBluestoke commented 5 years ago

3. reasoning: 2, if used in scenario 3 removes information which is expected to be there. 3, if used in scenario 2 shows a redundant schema, a mild cosmetic effect (summarised above by comments "don't like")

Also in terms of 'fixing' the name, it is easier to delete a spurious dbo. in the dbo folder than it is to guess which schema should be prefixed onto a schema-less object.

Therefore, a reluctant 3, because it is the only thing that 'works' in both scenarios. (if magic could occur, 2 for the people that would like it, and 3 that would like it that way, but i don't think that magic exists)

Either 2 or 3 is better than having a slightly different name for the file than the thing it deploys.

philcart commented 5 years ago

Would lean towards #3 as we have things arranged by object type, similar to what's in SQL Management Studio.

Could live with #2 as well.

You could also drop that "sp_" prefix :)

ladayaroslav commented 5 years ago

2

robinwilson16 commented 5 years ago

3 is first preference and #2 is second.

I think it is good to be as explicit as possible then if anyone wants less "explicifness" they can remove the first bit themselves.

slimrich commented 5 years ago

2

mikejwhitty commented 5 years ago

2

Stevoni commented 5 years ago

3

Eagle3386 commented 5 years ago

2

@amachanic: may I submit two suggestions for future votings:

  1. IIRC, there's a new GitHub extension for such vote calls
  2. Use emoji reactions for not only less wrongly linked issues (FYI: "#" creates links to that very issue), but also doesn't clutter the issue with simple replies and, most importantly, makes the counter recognizable on first sight.
jericsmith commented 5 years ago

2 - sp_WhoIsActive.sql

jacobgexigo commented 4 years ago

2

kapsiR commented 4 years ago

2 sp_WhoIsActive.sql

Matches the First Responder Kit's naming (btw. maybe integrate it there @BrentOzarULTD)

fredclown commented 4 years ago

2

uygary commented 4 years ago

I personally vote for option 2. I prefer using source control for db objects, and structuring the repo along the lines of: DatabaseName/SchemaName/ObjectName.sql

Option 3 would be preferable to option 1, but it would still not be ideal due to the flattened hierarchy it causes.

EmanueleMeazzo commented 4 years ago

Vote for 2

PianoMatt commented 4 years ago

3

spike1234 commented 4 years ago

2

bruce-dunwiddie commented 4 years ago

3

imajaydwivedi commented 3 years ago

2 sp_WhoIsActive.sql

Eagle3386 commented 3 years ago

@amachanic ~1.5 years passed, so when you're choosing the winning option since you've originally wrote about pinning it "for a few weeks"?

WaydeBunker commented 3 years ago

2

mattcargile commented 3 years ago

2

runamuk0 commented 3 years ago

I like #2 as well for organization.

bonomo1 commented 3 years ago

3