Azure / Azure/usql

Dynamically passing Table name as parameter in Stored Procedure in U-SQL

Open
#128 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
231
Forks
666
PR merge metrics
No merged PRs in 30d

Description

I want to pass the Table name as in-parameter in a stored procedure in U-SQL and then want to have a SELECT * FROM the table. Something like below ::

USE DATABASE ADLDEMO;

CREATE PROCEDURE IF NOT EXISTS sp_demo
(@TargetTableName string)
AS
BEGIN;

@a=
SELECT * FROM @TargetTableName;

OUTPUT @a
TO "/ADL-Demo/viewmultiple.csv"
USING Outputters.Csv(outputHeader:true);

END;

but this is giving me error like **"Rowset variable @TargetTableName was not found in the procedure 'sp_demo'."**

can anyone please help on how to do select * from a table passed as in-parameter?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.