Is it possible to use COMPANYNAME function to create storeprocedure in SQLSERVER
Create Procedure [dbo].[ COMPANYNAME $ CreditAcc]
(
@InvoiceNo nvarchar(20) = null,
@InvoiceLineNo nvarchar(20) = null
)
As
Begin
// Sql statement used in the stored procedure
End
What you want to do here?
You want to create a storeprocedure named " [dbo].[ COMPANYNAME $ CreditAcc]" ?
Or by calling “COMPANYNAME " withing " [dbo].[ COMPANYNAME $ CreditAcc]” you want to get current company name?
what ever it is here is the answer :-
Hi Sriyantha
by callling “COMPANYNAME” within " [dbo].[ COMPANYNAME $ CreditAcc]" I want to get the current company name to be replaced by “COMPANYNAME”.
e.g.
IF current company name is “DynamicNav” then after executing this query i.e.
Create Procedure [dbo].[ COMPANYNAME $ CreditAcc]
(
@InvoiceNo nvarchar(20) = null,
@InvoiceLineNo nvarchar(20) = null
)
As
Begin
// Sql statement used in the stored procedure
End
the name of the store procedure should be
dbo. DynamicNav $ CreditAcc
PS: “COMPANYNAME” function is being used by Navision that holds current name of the company. I want to get the value of “COMPANYNAME” in SQL to create a new storedprocedure in the name of company.
Also I tried your solution already but it doesn’t replaces the value which “COMPANYNAME” function has… in the query.