ALTER TO - SQL SERVER

Asked

Viewed 40 times

-1

in my Bank I have 2 stored procedures ,dbo. A and dbo. B . in the database. A there are the parameters @name , @street in the process dbo. B there are the parameters @cep , @phone

however I also need to have the @rua parameter of the dbo. A , on the dbo. B . I need to do via Microsoft SQL SERVER Management Querysql.

  • You could [Dit] your question and clarify the specific problem or add other details to highlight exactly what you need, as part of the code. See the [Ask] page for help clarifying this question.

1 answer

2

I’m not sure I understand your question. To add a parameter to a precedent, you need to rewrite the entire parameter. There is no way to alter only the parameters.

For example: typing sp_helptext dbo. B you’re gonna have something like:

CREATE PROCEDURE dbo.B
  @cep varchar(20)
, @telefone varchar(20)
AS
SELECT @cep, @telefone

To add a new parameter to it, you would have to do:

ALTER PROCEDURE dbo.B 
  @cep varchar(20)
, @telefone varchar(20)
, @rua varchar(200)
AS
SELECT @cep, @telefone, @rua

Browser other questions tagged

You are not signed in. Login or sign up in order to post.