> From: [EMAIL PROTECTED] > > In Oracle 9i(?), I was able to write stored procedure where I simply > referenced the field behind the parameter/variable, thus telling Oracle the > type and length implicitly (as it would look it up instead of me hardcoding > it). For example, cName as Customers.cName instead of saying cName > varchar(20). > > Is there an equivalent in SQL Server? I'm looking at BOL now but thought I'd > ask in the interim.
Hey Charlie can I help Mike out? Here is the top of one of my SPs: I have to define the params at the top, so @ACHBatchID bigint, .... are all within ( ). You then use AS to set the sprocs starting point. I need to DECLARE other vars for my processing. I then set a gloable var and run with what the SP is designed to do. Create PROCEDURE [dbo].[ACH_InsertDomesticSaleEntry] ( @ACHBatchID bigint, @transactionId BIGINT, @recurring INT, @refCode VARCHAR(10), @abaNum CHAR(8), @checkDig CHAR(1), @acctNumber VARCHAR(17), @acctType CHAR(8), @acctName VARCHAR(22), @amount CHAR(10), @ACHEntryDescriptor varchar(80), @SEC_CODE CHAR(3), @ODFI_ABA CHAR(8) ) AS DECLARE @recurringIndicator CHAR(1), @count INT, @transCode INT; IF @recurring=0 SET @recurringIndicator = 'S' ELSE SET @recurringIndicator = 'R' SET NOCOUNT OFF; SELECT @count = 1--COUNT(1) + 1 FROM Pending_ACH_Entry WHERE ACH_Batch_ID = @ACHBatchID; IF (@acctType = 'SAVINGS') SET @transCode = 37 ELSE SET @transCode = 27 IF (@SEC_CODE <> 'TEL') BEGIN HTH _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.