Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "::" mean in a SQL context?

What does the "::" syntax mean in SSDT error message SQL71561? For example:

SQL71561: View: [dbo].[V_RPT_MART_SIGNALS] contains an unresolved reference to an object.Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects:
[SSISDB].[CATALOG].[EXECUTIONS].[EXECUTION_ID] or
[SSISDB].[CATALOG].[EXECUTIONS].[TM]::[EXECUTION_ID]

This seems like such a strange syntax to see in in a SQL context, I can't believe I can't find it documented anywhere. (I've found that doing an online search for "::" doesn't work too well!)

like image 357
ckapilla Avatar asked Oct 19 '25 16:10

ckapilla


1 Answers

In the specific case there

  [SSISDB].[CATALOG].[EXECUTIONS].[TM]::[EXECUTION_ID]

The syntax would be database.schema.table_or_view.column::static_method_on_clr_type

The double colon is also used in legacy syntax for some functions

 SELECT * FROM ::fn_trace_getinfo(default)

And in the grammar for GRANT, REVOKE, DENY. (Example)

 GRANT INSERT ON SCHEMA :: HumanResources TO guest;
like image 130
Martin Smith Avatar answered Oct 22 '25 06:10

Martin Smith



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!