Home Forums SQL Server 7,2000 T-SQL retrieving an ID from one table and into another RE: retrieving an ID from one table and into another

  • I wasn't actually passing in empName.

    I was using that as an example but I do understand what your example is saying.

    For instance, if I need to retrieve the value of empid from emp table to be inserted into tblMain, by looking at your example, it would be written like this:

    select empid

    from emp

    where empid = @empid.

    If this assumption of what I think you mean is correct, then that will solve my problem.

    Thank you!