I want to hide the body of stored procedure from all other user even administrator ,how can can i do that?
create PROCEDURE [dbo].[AllCsDetails_Bilal]
@FrmDate DATETIME,
@ToDate DATETIME,
@CsID VARCHAR(50),
@ExporterID VARCHAR(50)
AS
BEGIN
SET NOCOUNT ON;
SELECT Row_Number() Over (Order by CostSheet.csID DESC) as SNo,CostSheet.csID,
CostSheet.RaisedBy,
CONVERT(VARCHAR,CostSheet.csDate,106) AS csDate,
Buyer.BuyName,
PriceTerm.PriceTermDesc,
CostSheet.BuyPayTerm,
Port.PortName,
PortFinal.PortName AS FinalDestination,
CostSheet.PerformaInv,
Container.ContainerName,
CostSheet.VIPPayableTo,
CostSheet.CAgentName1,
CostSheet.CAgentName2,
CostSheet.InspectionInst,
CostSheet.PackingInst,
CostSheet.SpecialInst,
CostSheet.Remarks,
CostSheet.AppRemarks,
CostSheet.cswStatus,
Exporter.ExporterName,
CostSheet.LcttInst,
CostSheet.PurchaseTerm,
CostSheet.PurchasePaymntTerm,
ContractNo,
AdditionalCharges,
RemarksChina,
CONVERT(VARCHAR(20),ExpDOD,106) AS ExpDOD,
TotalTable.TotQty,
TotLdq,
TotalTable.TotPriceDP,
TotalTable.TotPriceTT,
TotalTable.TotFrieght,
TotalTable.TotIns,
TotalTable.TotDiscount,
TotalTable.TotCommission1,
TotalTable.TotCommission2,
TotalTable.TotVIP,
TotalTable.TotAdvertismentAmt,
TotalTable.TotDiscountPerContainer,
TotalTable.TotNetFOB,
TotalTable.TotPurchasePrice,
TotalTable.TotMargin,
TotalTable.TotMarginPer,
ItemName,SupName,
Qty,DispatchQty,Ldq,PriceDP,PriceTT,Frieght,Ins,
CSItemTran.Discount,Commission1,Commission2,
VIP,AdvertismentAmt,CSItemTran.DiscountPerContainer,
NetFOB,PurchasePrice,Margin,MarginPer
FROM CostSheet
LEFT JOIN Buyer
ON CostSheet.BuyerID=Buyer.BuyerID
LEFT JOIN Port
ON CostSheet.PortID = Port.PortID
LEFT JOIN PriceTerm ON
CostSheet.BuyPriceTerm=PriceTerm.PriceTermID
LEFT JOIN Container
ON CostSheet.ContainerID =Container.ContainerID
LEFT JOIN Exporter
ON CostSheet.ExporterID = Exporter.ExporterID
LEFT JOIN Port AS PortFinal
ON CostSheet.FinalDestination = PortFinal.PortID
LEFT JOIN (SELECT csID,SUM(Qty) AS TotQty,SUM(Ldq) AS TotLdq,
SUM(PriceDP*Qty) AS TotPriceDP,
SUM(PriceTT*Qty) AS TotPriceTT,
SUM(Frieght*Qty) AS TotFrieght,
SUM(Ins*Qty) AS TotIns,
SUM(Discount*Qty) AS TotDiscount,
SUM(Commission1*Qty) AS TotCommission1,
SUM(Commission2*Qty) AS TotCommission2,
SUM(VIP*Qty) AS TotVIP,
SUM(AdvertismentAmt*Qty) AS TotAdvertismentAmt,
SUM(DiscountPerContainer*Qty) AS TotDiscountPerContainer,
SUM(NetFOB*Qty) AS TotNetFOB,
SUM(PurchasePrice*Qty) AS TotPurchasePrice,
SUM(Margin*Qty) AS TotMargin,
SUM(MarginPer*Qty) AS TotMarginPer
FROM CSItemTran
GROUP BY csID
) AS TotalTable
ON CostSheet.csID = TotalTable.csID
LEFT JOIN CSItemTran
ON CostSheet.csID = CSItemTran.csID
LEFT JOIN Item
ON CSItemTran.ItemID = Item.ItemID
LEFT JOIN Supplier
ON CSItemTran.SupplierID = Supplier.SupplierID
WHERE csDate BETWEEN @FrmDate AND @ToDate
AND CostSheet.csID LIKE @csID
AND CostSheet.ExporterID LIKE @ExporterID
END