April 9, 2015 at 11:39 am
nason.peter (4/8/2015)
To address the point of the question, it is interesting/important to note that the same rules apply to database, schema and column names so you could in fact have a whole database with no visible names. I wonder if there are some security applications for this information.
I think that it might go some toward making SQL injection harder.
I do love SELECT [*] FROM [FROM] ORDER BY [ORDER BY]
just to keep me on my toes. As far as practical for every day use, probably not. Naming tables and columns oddly on purpose is just mean. It's kind of like an Axe Throwing competition or juggling chain saws. Not very practical but a lot of fun.
ATBCharles Kincaid
April 10, 2015 at 1:33 am
This assumes that you have a schema in the database named "tmp" otherwise it fails because the schema does not exist.
in this question have a schema in the database named "dbo" instead of" tmp" . The table is created with out errors
April 12, 2015 at 11:20 am
April 13, 2015 at 8:23 am
MyDoggieJessie (4/7/2015)
This assumes that you have a schema in the database named "tmp" otherwise it fails because the schema does not exist.
+1
Guessed correctly that that important piece was omitted...
April 15, 2015 at 12:00 am
Executing your script in SQL 2008 R2 and SQL 2012 SSMS without the "tmp" schema is created I was getting the following message:
Msg 2760, Level 16, State 1, Line 1
The specified schema name "tmp" either does not exist or you do not have permission to use it.
So in the view is this "Sorry but you are wrong". your script returns error in two environments.http://www.sqlservercentral.com/Forums/Skins/Classic/Images/MessageIcons/ExclamationMark.gif
June 3, 2015 at 6:16 am
It gives error unless tmp schema is crated in the database
June 4, 2015 at 8:29 am
I did not expect that, but I will not use it that way either.
April 20, 2016 at 7:01 am
Good to know. This doesn't seem very practical though.
Viewing 8 posts - 46 through 52 (of 52 total)
You must be logged in to reply to this topic. Login to reply