IF OBJECT_ID (N'dbo.AWBuildVersion', N'U') IS NOT NULL
DROP TABLE dbo.AWBuildVersion;
I don't understand what N and U are for in SQL server ?
Thanks
U
stands for Table (user-defined).
Check here for more info. The syntax OBJECT_ID
is
OBJECT_ID ( '[ database_name . [ schema_name ] . | schema_name . ]
object_name' [ ,'object_type' ] )
here Object_type = 'U'
which denotes Table (user-defined)
N
Makes the String to be considered as nvarchar data type
. It denotes that the subsequent string is in Unicode (the N
actually stands for National language character set). Which means
that you are passing an NCHAR, NVARCHAR or NTEXT value, as opposed
to CHAR, VARCHAR or TEXT. 'U'
character stands for itself. The N
prefix makes it a one-character UNICODE string. OBJECT_ID procedure expects you to pass one of pre-defined one-character values for the second parameter, which needs to be a UNICODE string.
This syntax is used to create literals with characters in other encodings, for example
CREATE TABLE hello_world (str NVARCHAR(20))
INSERT INTO hello_world (str) VALUES (N'Здравствуй, мир!')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With