AutoAudit prefixes

Nov 26, 2013 at 10:28 AM
Hi,
there is always prefix "p" in AutoAudit procedure name.
Now there is schema called Audit, I think no meaning to use "p" prefix anymore.

I know, some still use prefixe "sp" or "sp_" anyway I doesn't make sense. It is obvious that it is stored procedure, not table of view. ORMs use sproc names as names of generated methods used to call sproc from apps etc.

The same is true for _RowHistory and _Deleted views, Prefixed by "v"

Therefore using prefixes for tables, view, stored procedures etc. is outdated.
Coordinator
Nov 26, 2013 at 12:56 PM
I guess that is a matter of opinion and not really an AutoAudit issue.

I am a proponent of prefixing object names in SQL Server. I think prefixes and the name itself help you to quickly know more about the object you are dealing with.
The prefix "p" goes back to the way Paul had prefixed the stored procedures originally.

It is quite common and also a best practice to use a prefix for object names.
For stored procedures, some DBA use "p" some use "usp" etc. BTW, you should never use "sp_" for a stored procedure prefix because when SQL Server looks for the stored procedure, it will look in the Master and MSDB databases if it does not find it in the current database.

There are several articles that have been written about SQL naming conventions.
Marked as answer by JohnSigouin on 11/26/2013 at 5:56 AM
Nov 26, 2013 at 7:52 PM
As for as 'v' prefix for generated _RowHistory and _Deleted views, it is just string repeated several times in AutoAudit script.

Would you consider to replace it by variable @ViewPrefix with default value of ='v' ? It is simple search&replace
Similar way you use for @CreatedColumnName etc.

In this case win-win :-)

I understood such change for stored procedures prefix is more complicated. I changed my version of the AutoAudit script to not bother you.

Robert
Nov 26, 2013 at 8:34 PM
John,
forget this, if 'v' prefix is not used for generated views andalso "Default _RowHistory function Creation Flag"=1 then there is name conflict which should be handled by turning "Default _RowHistory function Creation Flag"= 0

I adjusted my script, it is ok, the others are happy with prefixes. Why to change? :)

Thx
R.