Questions tagged [temp-tables]
Temporary tables are a feature of RDBMS's as a means of storing intermediate results. Some RDBMS's make the distinction between local and global temporary tables. Temporary tables are typically dropped when the session ends for local, or when the temporary table is no longer referenced for global. Note that a temporary table is not the same as a table variable even though both are temporary in nature.
temp-tables
1,661
questions
1
vote
0
answers
26
views
Error while inserting data using jdbc connection in temporary table
I am writing a aws glue etl job in which I am creating a jdbc connection to push the data from dataframe to the mssql table.
jdbc_url = "jdbc:sqlserver://{host}:{port};database={databaseName};...
0
votes
0
answers
42
views
Is there a way to optimize this query in Tsql?
WITH CTE AS
(
WITH flattened_data AS
(
SELECT
DISTINCT
MAX(CASE WHEN (entry.value:Id::STRING)='123' THEN entry.value:Answer:text::STRING END) AS VD,
MAX(CASE WHEN (...
0
votes
0
answers
21
views
MySQL with recursive table can't reopen issue [duplicate]
I need to query data from Oracle SQL, and use it query in MySQL 8.0.36 server's data
so create temporary table and with recursive table, but always show can't reopen table
and full join temporary ...
0
votes
2
answers
51
views
Insert INTO #TempTable is fast but SELECT * FROM #TempTable is very slow, why and how to improve performance?
I need to insert into temp table "#Temp" 300 000 rows and 30 columns from different tables, I created indexes and inserting is very fast, it needs about 3 seconds. But then, when I want to ...
-2
votes
1
answer
34
views
Temporary table already exists on SqlServer [duplicate]
Why this behavior with SqlServer
IF @xx = 1
SELECT x.col1 INTO #tbl FROM x
ELSE
SELECT y.col1 INTO #tbl FROM y
error when running : Table #tbl already exists
0
votes
1
answer
113
views
Create a stored procedure that iterates over another stored procedure?
I have a question about using stored procedures iteratively. I created a stored procedure called sp_indicators that accepts an indicator as a parameter and returns a table with 43437 rows and 15 ...
0
votes
0
answers
43
views
Cannot reference BigQuery temp table after creation
I am receiving the following error when trying to pull data from a temp table I just created in the statement immediately before.
Invalid value: Table "tt_orders" must be qualified with a ...
1
vote
1
answer
48
views
Is there a correct way to utilise SQL UNIONs in order to select the max value from three potential queries?
I'm writing a Stored Procedure in SQL and as part of it, I need to select the maximum of three potential values (demand, average and forecast). I've got the queries to find each of these values, but I'...
0
votes
0
answers
27
views
Mysql: Determine size of user-created temp table
I am creating a temp table in mysql. I would like to know the size of the table once it is created, but nothing appears for it using SHOW TABLE STATUS or in information_schema.TABLES. Is there any way ...
0
votes
1
answer
96
views
Is it possible to wrap a string of CTE's together into one TEMP table in SQL? [duplicate]
Within SQL Server is it at all possible to wrap a string of CTE's into just one temporary table in SQL?
Not all of the CTE's have equal amount of columns in nor are they the same data type so a UNION ...
0
votes
0
answers
10
views
Why is BigQuery Sandbox saying its ERROR: Expected keyword AS but got "(" at [1:17]
Is this an issue with BigQuerry. I was follwing along with this youtube video and for some reason this code will not work.
WITH pop_vs_vac (continent, location, DATE, population, new_vaccinations, ...
0
votes
1
answer
108
views
Using temporary table- How do I pass more than 1,000 parameters in SQL in Clause
I want to use a parameter to pass more than 1,000 parameters in SQL in Clause and created a temporary table for the same:
drop table if EXISTS #k_temp_table
select i.account_value
into #k_temp_table
...
0
votes
2
answers
61
views
How to fetch records having multiple rows with different column values
I have a table disp table. Which has 3 columns, service_code, row_status and business_unit_id.
service_code
row_status
business_unit_id
A
1
BU1
A
0
BU2
A
0
BU3
B
1
BU1
B
0
BU2
C
0
BU2
C
0
BU3
...
0
votes
0
answers
49
views
Using SQLCMD Mode within SSMS and a SQL script file path, how can I store the result in a temp table?
Using SQLCMD Mode in SSMS (not the SQLCMD Utility) and a file path to a SQL query script, I would like to store the results into a temp table.
I am aware the following command executes the query from ...
0
votes
0
answers
44
views
How do I Create a local temp table with the 'Select Into' function with the source tables text Name and not the table object
Here is what I'm trying to accomplish.
I am creating a dynamic table value reading script.
I only need to read and collect specific values in each of the tables.
Collect the tables #...