SELECT $ (dollar sign)

前端 未结 3 1460
不思量自难忘°
不思量自难忘° 2020-12-18 17:57

I have good experience in SQL Server, But suddenly I discovered this strange SELECT command

SELECT $ 

or

SE         


        
3条回答
  •  生来不讨喜
    2020-12-18 18:44

    You can prove out that SQL Server is treating it as a money type:

    select $ as n into #x
    
    exec tempdb..sp_help '#x'
    

    sp_help will output (among other things):

     Column_name     Type     Computed     Length     Prec     Scale     Nullable     TrimTrailingBlanks     FixedLenNullInSource     Collation    
     --------------  -------  -----------  ---------  -------  --------  -----------  ---------------------  -----------------------  ------------ 
     n               money    no           8          19       4         no           (n/a)                  (n/a)                    (null)       
    

提交回复
热议问题