April 21, 2002 at 6:18 pm
Is there a way to do an implicit equi-join of
two tables?
If not, how can I find out the primary key of a table from either SQL or T-SQL?
thanks,
Alec
April 21, 2002 at 6:33 pm
Sp_primarykeys will tell you which column(s) is used in the primarykey. You have to specify the relationship when you join, else you wind up with a cross join.
Andy
April 21, 2002 at 7:05 pm
Thanks for your prompt reply.
I used sp_pkeys, which returns a table with primary key information. How can I browse this table within my T-SQL procedure, i.e. how can I declare a cursor to walk through the result set returned from a procedure?
April 21, 2002 at 8:24 pm
Books online is a good place to start for cursor info. Also, a lot of the procs in master use cursors, so you can see how MS uses them. Try the examples, if you get stuck post what you have so far and we'll try to help.
Andy
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply