Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 bifurcate parameters

Author  Topic 

qutesanju
Posting Yak Master

193 Posts

Posted - 2009-06-08 : 06:35:37
I have one SP like this

create Procedure test_SP](@LastRunDate as varchar(100),
@TableName_N_ColumnName as varchar(100) )
AS
begin
-----------------------------------------------------------------------------------------
--Declare @LastRunDate as varchar(100)
--set @LastRunDate='25-may-2009'
select @TableName = substring (@TableName_N_ColumnName)
select @ColumnName = substring (@TableName_N_ColumnName)
................
...............
end
Here @TableName_N_ColumnName will be passed as table name + column name .....shich I have to separate it

If I passed (Employedd_table-Employee_Name)as a parameter
then how can I separate the TableName = Employee_table
and column name as Employee_Name

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-08 : 06:38:19
You can use CHARINDEX to find out the position of your delimiter.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -