Snowflake output when run in Fargate - snowflake-cloud-data-platform

Is it possible to see the output of a Snowflake SQL statement when the SQL is run in Fargate? For example, if the SQL was just: SELECT CURRENT_DATE;
I was hoping the output would appear in a CloudWatch log, but it doesn't.

Related

How to send a command to SQL Server complete a batch started from a select query sent by a VB.Net program?

I'm trying to execute a select query (with joins) and when there are a small number of records to return, I can see in SQL Server Profiler the following EventClass:
SQL:BatchStarting and after that SQL:BatchCompleted.
I'm using the ExecuteReader from ADO.NET.
So far, so good, I can use the information and make some inserts in the same table I retrieved the information in the select query.
But when the select query returns more rows (I can't specify how much, but I believe it is irrelevant) the SQL Server Profiler doesn't show the SQL:BatchCompleted event and the insert I need to do can't run because the batch is still running.
How do I send a command to execute and return all the rows and then complete the batch.
I'm using VB.NET but I believe C# answers can help me too.
The batch request is not complete until the client fetches the rows.
Al you need to call SqlDataReader.Read() for each row in the result and then SqlDataReader.Close(), or SqlDataReader.Dispose() to complete the batch request.

Access Database - Understand Pass Through

I have been given an Access Database that I have to try to decipher what it is doing.
As a start I see that there is a Pass Through query with a command like:
Exec RefreshGLTableLatestEntries
#sourceDB = 'DB_NAME' ,
#tablePrefix = 'TableName$' ,
#logFile = 'C:\logDB.txt'
When I run it I will get something like:
Result
Success... 108 rows inserted with a total amount of $0.000000
What I don't understand is where are the rows being copied from or copied to.
In the MSSQL database I don't see a table, query, standard procedure or function called 'TableName$'. There are quite a few tables & queries called 'TableName$SomethingElse'. Is there a way to see more details on where is the data coming from?
Similarly, how can I see where are the rows being inserted to? I can not find any file named 'logDB.txt' in my hard disk to see the log. I would suspect that it might not say much more that '...108 rows insterted...'
I'm using:
Access 2016 from Office 365, Version 1609
MS SQL Server Management Studio v17.1
Any ideas on how to get more information on how to get more information on what the Pass Through do?
A Pass-Through query in Access is equivalent to running its SQL code in SQL Server Management Studio.
(In the database that is designated by the connection string of the Pass-Through query.)
The SQL is sent as-is to MSSQL and run there.
RefreshGLTableLatestEntries is the stored procedure that is executed here. You need to locate and analyze it in SQL Server.

SQL Agent job - no results, yet stored proc works

I have a SQL Agent Job which claims to succeed, however doesn't ACTUALLY do what it is supposed to do. If I run the script inside on its own it does generate results.
I am using SQL 2014. The scrip used/inside the agent job is:
IF OBJECT_ID('TEMPDB..##RCCON','U') IS NOT NULL DROP TABLE ##RCCON
SELECT top 10 R.RC_C__ID as ConsentId
,dbo.clr_RC_CON(R.RC_CON__ID,'','') AS RC_CON
INTO ##RCCON FROM RC_CON R
The script works independently, but as a JOB yields no results.
Any suggestions please? Cheers
The ##RCCON evaporates when the SQL Agent Job is done. They only exist for the duration of the session.
Perhaps use [dbo].[RCCON] instead

SQL Server Profiler does not show data in SQL statement

I am using the SQL Server Profiler to trace the SQL generated from nHibernate in a Windows SmartClient appplication.
The trace of the SQL statement does not show actual data, but rather, looks like this:
exec sp_executesql N'SELECT attachment0_.RecordKey as RecordKey1_, attachment0_.Id as Id1_, attachment0_.Id as Id87_0_, attachment0_.RecordType as RecordType87_0_, attachment0_.RecordKey as RecordKey87_0_, attachment0_.FileName as FileName87_0_, attachment0_.OriginalFileName as Original6_87_0_, attachment0_.DateTimeAttached as DateTime7_87_0_ FROM MyDatabase.dbo.tblAttachment attachment0_ WHERE attachment0_.RecordKey=#p0',N'#p0 int',#p0=262
Is there a way to see the the actual data in the SQL command?
It's just showing the parameterized sql. If you want to log or to show non-parameterized sql I came up with a solution to this here:
Execute NHibernate-generated prepared statements in SQL Server Management Studio
The item of note is the log4net appender that basically translates this in the accepted answer.

Query taking more time on local SSMS than remote

When I am executing a select statement with 4 'inner' joins and two 'WHERE' conditions it took 13-15 s in local SSMS (I have executed 5 times). But when I connect the same instance from another server's SSMS and execute the same query it took 5 s to execute first time and then it took 0 s! I am using the same user SA.
Is there any possible explanation for that?
Host instance is SQL 2008 and Remote instance has SQL 2008 R2.
If your query is returning data to display in your local SSMS then this data needs to be transferred from the server to your local SSMS. The time to transfer the data from the server to your local SSMS is included in the execution time. So, the execution time is a combination of executing the script and fetching the data in order to display it.
You might want to "Include Client Statistics" and then review the row "Bytes received from server" in the "Client Statistic" tab of the result window.
In order to verify my assumption you can alter your select only to execute without fetching the data.

Resources