If => then formula in SQL?

How is the query send to SQL Server? in SSMS? Access? ...?

Can you run the script from SSMS?