« first day (1446 days earlier)      last day (2872 days later) » 

12:49 PM
hello what does this character /*! means in sql
/*! 50001
 
Need context to help.
Where is it appearing? Script? Column?
 
its writen like that /*!50001 CREATE NEW VIEW 'TABLENAME' AS SECLECT and so on
 
...okay further on down your code does these symbols appear */ ?
 
yeah
 
Anything inside /* */ is considered comments by SSMS and won't be executed
 
12:57 PM
thats what i thought
 
saves people writing
-- this
-- is
-- a
-- comment
 
but someone here in our office telling me its not a comment!
 
the ! mark is just strange though :)
 
yeah
thank u dude
 
no probs
@Kob_24 What are you using? SQL Server? MySQL? PostgreSQL?
 
1:02 PM
mysql
 
hmmm wasn't sure with mysql as I normally use SQL Server but apparently it still counts
 
i will paste the code asap, just give me a moment
 
hmmm interestingly, your colleague may have a point?
Sometimes it is nice to use the SELECT query options like SQL_CALC_FOUND_ROWS or SQL_CACHE, but to maintain compatibility across different databases or even older versions of MySQL which do not support those options, it is possible to enclose them in a comment block, e.g.:

SELECT /*! 40000 SQL_CALC_FOUND_ROWS */ foo,bar FROM some_table;

The /* construct will stop DBMS's other than MySQL from parsing the comment contents, while /*! will tell ALL MySQL versions to parse the "comment" (which is actually a non-comment to MySQL). The /*!40000 construct will tell MySQL servers starting from 4.0
Best ask a question @Kob_24 as it's getting out of my league already
 
ok ok bro i will do so
 

« first day (1446 days earlier)      last day (2872 days later) »