Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create permanent object aliases

I recently found myself using some rather lengthy names for the tables and views involved in a development piece, which got me wondering whether it's possible to create client/database/server level aliases for objects.

Say for example I have a view named dbo.vAlphaBetaGammaDelta . Is there a way (with or without Intellisense) to create a reference to it named dbo.vABGD ?

If not, would there be any downfalls to creating a view of a view or single table aside from maintenance necessary if/when the table schema changes?

I should note that these aliases/views would not be intended for use in other objects, but for alleviation and prevention of carpal tunnel during day-to-day troubleshooting and delving xD

like image 878
Zok Wobblefotz Avatar asked Nov 25 '25 19:11

Zok Wobblefotz


1 Answers

SQL Server allows for the creation of synonyms. That seems to be what you are looking for: http://msdn.microsoft.com/en-us/library/ms177544.aspx

However, as @MitchWheat mentioned. this seems to be going in the wrong direction. There are a few quite good SSMS plugins available that provide auto completion of long object names (e.g. SQL Prompt). Incidentally those products have trouble with synonyms...

like image 67
Sebastian Meine Avatar answered Nov 28 '25 17:11

Sebastian Meine



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!