What deos the "N" and "::" Mean

  • I should know this but I don't so here is the question. when generating a script in EM the statement looks something like this:

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Gary_test]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)

    drop procedure [dbo].[Gary_test]

    I unsert stand the script just fine except I have never known what the "N" means or what it is there for.

    When using a function BOL lists something like this:

    USE pubs

    SELECT * INTO temp_trc

    FROM ::fn_trace_gettable(c:\my_trace.trc", default)

    What do the two colons :: do or mean.

    Thanks

    Gary

     

     

  • The N denotes that that string is Unicode. Think of nvarchar versus varchar.

    I don't remember the reasoning, but I'm pretty sure that "::" precedes system UDFs, i.e. built-in ones.

  • N stands for National Language in SQL92 and is used to denote unicode literals

    :: Denotes GLOBAL SCOPE in other words system scope

     


    * Noel

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply