Querying SQL Tables Named With SQL Keywords

When you have any of your SQL DB table named with any of the SQL keyword, SQL will error as shown below.  In the example, I am using a table named User which is also a SQL keyword. Query: select * from dbo.User (nolock) where Name like ‘%test%’ Error: Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword ‘User’. The trick to use the SQL reserved/keyword in your SQL names you need to enclose the name within either braces [] or double quotes “” as shown below. Query:  select * from dbo.[User] (nolock) where Name like ‘%test%’ select * from dbo.”User” (nolock) where Name like […]

Read more

Fix: Microsoft VBScript compilation error 800A0408: Invalid character

Fixing Microsoft VBScript compilation error 800A0408: Invalid character When you run a newly authored VBScript code that you copied from an existing/working script, you may possibly receive the “Microsoft VBScript compilation error 800A0408: Invalid character” as shown below. ————————— Windows Script Host Script:    C:TestRunBatch.vbs Line:    1 Char:    1 Error:    Invalid character Code:    800A0408 Source:     Microsoft VBScript compilation error ————————— OK ————————— Analysis: This error usually indicates that there is an invalid character in the script that VBScript compiler can’t understand. Thus it fails with the error. Cause: Very common cause for this error would the File Encoding used by the […]

Read more

Controlling ProgramData Folder Setting

About ProgramData Folder: The ProgramData setting specifies the path to the program data folder. Path_to_program_data_folder is a string with a maximum length of 259 characters. This string type does not support empty elements. Do not create an empty value for this setting. The registry location of this setting is: C:>reg query "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionProfileList" /v ProgramData HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionProfileList     ProgramData    REG_EXPAND_SZ    %SystemDrive%ProgramData C:> Redirecting ProgramData to other drives/folder: Many times, when you have to setup an application that needs to use a different set of ProgramData files located in a different folder on the same or different drive.  The option is […]

Read more