See :help modeline
For instance, add near the top or bottom of the file a line with either
-- vim: ft=sql
(modeline form 1, which goes to the end of the line)
or
/* vim: set ft=sql :*/
(modeline form 2, which can be followed by a colon and then anything,
such as a comment terminator)
as an SQL comment, and optionally with additional options to be set
for that file as with :setlocal. Anything is allowed before the "
vim:" modeline leader; usually a comment leader for the current
language is placed there.
Best regards,
Tony.