VS Code .sql file colorization/prettify - sql

VS Code is colorizing the script in my .sql files, but with what seem to be some errors. For example I would expect "RENAME" to be colorized here:
I've tried using a few extensions, but I can't fix this problem. I don't know if it's because I'm using postgreSQL and it's reading some other SQL dialect? Any assistance appreciated.

Figure it out. At the bottom right of VS Code, click the button that says 'Postgres' as shown here:
You can then select/search whichever language you want to use. Mine was on SQL, and I changed it to postgresql.

Related

IntelliJ IDEA cannot format SQL code properly

I have reinstalled the last version of IntelliJ IDEA and then when I try to format an SQL file, it orders all the lines as shown on the image.
However, I have not made any settings for SQL formatting in the previous versions and the format was OK as shown on my current setting preview as shown below:
So, is there anything default to format SQL properly? There are lots of choices in the settings, but I just want to use a default one available on the settings (I tried but it format almost the same).
Faced same issue. Settings/Languages&Frameworks/SQL Dialects, there you can find the dialect of file. Change it to what you use.
That's how I solved problem, even though you apply global or project SLQ Dialect, somehow the file may not be updated.
As you see from the image, Generic SQL causes problem here.

ExecuteMso error

This question may have been asked before.
I have tried using ExecuteMso in VBA but returns Method or data member not found.
Not sure what I am doing wrong or if there is an issue using this code as using excel on a Mac. I have also tried this on a windows version of Excel however it is a very old version (if that makes a difference?)
Any help or tips regarding this would be great.
Thanks in advance
The following sample executes the Copy button.
Application.CommandBars.ExecuteMso(“Copy”)
Otherwise, post what you have tried and what is giving you the problem.

SQL SERVER 2014 Code Snippets missing

I'm trying to use the Snippets functionality in SQL Server.
I'm testing out adding new snippets to SQL Server 2014 following the instruction here.
Everything works fine except that after I added the snippet, it doesn't show up in the IntelliSense. Even more, I realized that not all build-in Snippets are showing up.
I wonder if anyone else has the same experience, and knows how to resolve this?
This is a list of build-in snippets under Function
And this is what I see from IntelliSense (3 of them are missing)
The issue is likely in the definition of the snippets.
If you inspect your snippets you should see a section like:
<SnippetTypes>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
Or
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
These indicate where the snippet can and will be used from.
In a query window you have 2 options when you right click:
Insert snippet
Surround with
Which give you the different options as you can see here:
This explains why you're not seeing the missing options when you try to insert a snippet.

Bulkloader syntax Error

Having been struggling trying to bulkload data to the datastore, I have reached the point where expert help is needed.
I don't think what is am doing is tricky, I have the following configuration file:
and when I use the appcfg.py command, the error messages end with:
File "config.txt", line 1
python_preamble:
^
Syntax error: invalid syntax.
I have used a .txt file as it is faster to edit in notepad initially - I don't know if that is a problem and the remote_api for the appspot all seems to be okay.
I am thinking it is a fairly fundemental problem as it has stopped working at the top line. I removed the comment lines at the top of the original file - maybe that caused it.
I have tried to find working examples to set me right but they all seem to follow the syntax above, or where they are slightly different, I have tried both variants.
Help on bulkloading for my first cloud app would be much appreciated.
Thanks in advance for anyone taking time to read my post whether they solve it or not.
Be sure the configuration file extension is .yaml

New Line Not Working on Windows Notepad (SAP ABAP)

Tried CL_ABAP_CHAR_UTILITIES=>CR_LF, CL_ABAP_CHAR_UTILITIES=>NEWLINE.
Both work on NotePad++ and Excel 2010 but not on Notepad.
Any hints?
The reason is that I made a wrong definition of CR_LF. Please check my blog for the detailed explanation.
http://www.dsun.us/node/60
I made a similar mistake yesterday. I think I need to take a break now.