Synapse Serverless Stored Procedure is not executed in Synapse Pipelines [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
The community is reviewing whether to reopen this question as of 3 days ago.
Improve this question
I have a stored procedure stored in a Serverless Pool SQL DB
(https://i.stack.imgur.com/wSppv.png)
In Synapse Pipelines I' no able to use the SQL Pool Stored Procedure activity because is only for a Dedicated Pool so I'm using the Stored Procedure Activity
(https://i.stack.imgur.com/zlBLJ.png)
When triggered the corresponding pipeline nothing happens
(https://i.stack.imgur.com/rmHLR.png)
I was investigating any restriction on using the Stored Procedure Activity and nothing. I do not want to use the Script Activity but if there's no other chance I'll be forced to do that.
A sample of the script is
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE OR ALTER PROCEDURE CSVtoParquetBronze
AS
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[bronze].[Table]') AND type in (N'U'))
DROP EXTERNAL TABLE bronze.Table;
GO
CREATE EXTERNAL TABLE bronze.Account
WITH
(
LOCATION = 'bronze/Table',
DATA_SOURCE = lakehouse_EDS,
FILE_FORMAT = SynapseParquetFormat
)
AS
SELECT *
FROM dbo.Table
GO
GO
The expecting result its simple since the connection is working fine and the Stored Procedure exists in the Database as well as the location, data source y file format.
(https://i.stack.imgur.com/5d1f4.png)

Related

how to fix sql server page level corruption? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
How can i fix the page level corruption in sql database. I am facing a big issue related to this. Can anyone help me.
Go to SQL Server Management Studio
Select the DB
Right Click the DB
Go to Properties
Select Options
Under Other Option select the Page Verify
Select as NONE.
Run this Query to Change DB into Single User Mode
ALTER DATABASE corrupted_db SET SINGLE_USER WITH ROLLBACK IMMEDIATE
Run this Query to Recover the Table/DB.
DBCC CheckTable ('corrupted_table', REPAIR_ALLOW_DATA_LOSS)
(OR)
DBCC CheckDB ('corrupted_db', REPAIR_ALLOW_DATA_LOSS)
Once this Execution Completed Sql returns “Errors are Corrected”
Run this Query to Change the DB into Multi-User Mode
ALTER DATABASE Application Manager SET MULTI_USER
Go to SQL Server Management Studio
Select the DB
Right Click the DB
Go to Properties
Select Options
Under Other Option select the Page Verify
Select the Option CHECKSUM.
Now Run DBCC CHECKDB('Your DB')

passed parameter of a stored procedure to insert? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
HI I want to take a passed parameters of a stored procedure, and then use that to update or add rows to a table. is that possible?
Here's a basic example of how to do it.
-- Create the stored procedure
CREATE PROCEDURE usp_TestSp
#Param1 INT
AS
INSERT INTO Table1 VALUES (#Param1)
GO
-- Execute the stored procedure
EXEC dbo.usp_TestSp #Param1 = 2 -- int

How to Schedule a trigger? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
We had created a trigger for inserting a set of rows.
I want to schedule this trigger automatically and insert these data into another table. i.e, it has to execute automatically based on the period given.
Kindly suggest the possibilities steps for this.
Here i give you the clear explanation about the operation,
My project to transfer the data from MS SQL database table to MY SQL Database table. This event has to be scheduled. I have to select few fields from MS Sql table and that selected data to be transfer to My Sql table Automatically based on Scheduled.
You could use mysql event scheduler to configure and run your job.
Please have look into
http://dev.mysql.com/doc/refman/5.1/en/events-configuration.html
First, Trigger is one database object and trigger created over the any physical table. this is depends on table action so at every action of table trigger will execute.
we cant schedule trigger to execute on perticluar time.
There is alternative solution is: Enable and Disable trigger using scedule SQL Job.
Script is :
--To Enalble Trigger
ENABLE TRIGGER [Trigger_Name] ON [TableName]
GO
--To Disable Trigger
DISABLE TRIGGER [Trigger_Name] ON [TableName]
GO
If you're using MS SQL, then you can use SQL Server Agent to schedule a job/task to execute whatever you need done.
You can read more about it here http://msdn.microsoft.com/en-us/library/ms191439.aspx
Your best bet maybe to create a stored procedure and then in the scheduled job, simply execute that stored procedure to run.
Alternatively, if you don't have SQL Server Agent (requires full version of MS SQL not SQL Server Express) then you could possibly look into using Windows Scheduled Task to schedule a batch file to run periodically, making a call to the sqlcmd utility http://technet.microsoft.com/en-us/library/ms165702(v=sql.105).aspx which you should be able to setup to execute your stored procedure.
Hope this helps.

Recommended SP/method to gain information [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
When I need more information about table and its column I always use the build-in stored procedure 'sp_help xxxxx' to retrieve more information.
What other method or SP are usable to use?
You can use sp_depends to get want tables and columns it is using
EXEC sp_depends yourProcedure;
I prefer to use dynamic management views (DMV) and functions (DMF) to get more information about database server..........The DMV/DMF's have been organized into the following different groups:
Common Language Runtime related
Database Mirroring related
Execution related
Full-Text Search related
Index related
I/O related
Query Notifications related
Replication related
Service Broker related
SQL Server Operation system
Transaction related
Just browsing to the table in SQL Server Management Studio will tell you quite a lot.
Table/Column definitions.
Indexes
Triggers
Constraints
Primary/Foreign Keys
Dependancies
etc, etc
Look into the sysobjects view (http://msdn.microsoft.com/en-us/library/ms177596.aspx):
SELECT * FROM sysobjects WHERE type = 'P'
Other sys view can be handy too.
How about using sp_columns
EXEC sp_columns #table_name = N'TableName'
Using sp_helptext will come in handy, it gives you the definition of a stored procedure, function or view.
I.E.:
CREATE PROC usp_MyProcedure AS SELECT * FROM TABLE
Runing the following will output the query above.
Exec sp_helptext 'usp_MyProcedure'

No connection to tables, sprocs etc [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have been working on a database for a couple of weeks now, and suddenly nothing works and I just can't figure out how to solve it.
I can login to SQL server and list all the tables and sprocs. The problem is that when I try to run a sproc I get a message telling me that there are no such table, even though it exists.
When I try to alter or create a sproc I get the following message:
Msg 262, Level 14, State 1, Procedure usp_GetUser, Line 14
CREATE PROCEDURE permission denied in database 'master'.
What can be wrong?
... in database 'master'.
Wrong database context: I assume it should be "MyDatabase" not "master"
You're currently running against the master database rather than whichever user database you have been working on.
Either run
use MyDatabaseName
Or at the top of SSMS there is a drop down that currently says ''master". Change it to your database name