Jump to content

scottbak

Members
  • Posts

    3
  • Joined

  • Last visited

scottbak's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. See BELOW: example of SQL Table:field field p_2 p_1 RESULT 17 230843a 170843 left 2 characters of P_2 and right 4 NUMBERS of P_1 combined 17 230994a 16 231086b 17 231237 3028 232487 3002 233256 17 233539 17 237916 18 238697 72 238883 65STP 240072 62 241206 3014 241796 74 241876 12 241949 65 242117 17 243672 FTIME 243911 16 245984 72 246362 3014 246670 16 246705 18 246811 3014 246954 13 246954A 17 246956 13 246991 18 247488 13 247488A 3002 247488B 12 247680 65STP 247703 17 248096 72 248591 3003 248637 17 249012 12STP 249238 72 249656 17 250406
  2. I want to be able to cycle through each value in the 2 fields and put the value in for: EXEC SearchAndReplace @find,@repl@find and @repl in that command line. So there are 100 records, so I want 100 different values for @find and @repl.
  3. and use the values for each line in the below query as the @find and @repldeclare @find as varchar(12), @repl as varchar(12)SET @find = (select sEmployeeID from tblPREE);SET @repl = (select sEmployeeIDf from tblPREE);EXEC SearchAndReplace @find,@replGO the error I get when I run this is:Server: Msg 512, Level 16, State 1, Line 2Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.Server: Msg 512, Level 16, State 1, Line 3Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.Thanks for all your help,Scott
×
×
  • Create New...