0

I want to debug what went wrong with the SQL so want to know what parameters were used is executing SQL like schema name. I can grab Session ID from Query history UI but unable to fetch associated parameters. Any idea how to fetch those?

mad_
  • 8,121
  • 2
  • 25
  • 40

1 Answers1

0

The Query History for the session should show if the user does any ALTER session parameter statements. Otherwise, the sessions parameters would be at their defaults.

The list of session parameters is here: https://docs.snowflake.com/en/sql-reference/sql/alter-session.html

Suzy Lockwood
  • 1,050
  • 4
  • 6
  • No I want to know what schema was used within the session As it is giving me error No Schema was set. So I believe I am looking at the wrong place – mad_ Nov 17 '20 at 20:11
  • Ah, my apologies for misunderstanding. It is possible for NULL to be returned as the schema if no schema was set/required during the operation particularly if it's a metadata operation. For example, if have a new worksheet with no database/schema set in the context and run something like SELECT 1 which doesn't require a schema, then it could be NULL in the query history. I'd recommend using the Account_Usage views or Information_Schema functions for querying the Query History as opposed to the UI since there's more dynamic SQL search options. – Suzy Lockwood Nov 17 '20 at 21:38