hi,
i have two tables and i write this query..
it successfully worked but only when
partner_master have a regid value
.
and i want that
if partner_master table has not regisd then only register_master display its record
if partner_master have regid value then both tables value display.
-----------
how to write dynamic query ??
------------
two tables
===========
1) register_master
2) partner_master
------------------------------
@param varhcar(100)=null,
@regid bigint=0,
@sql_query varchar(max)=null
if @param='profile_detail'
begin
select * from Register_Master join Partner_Master
on Register_Master.Reg_Id=Partner_Master.Reg_Id
where
Register_Master.Reg_Id=@regid;
end
-----------
write dynamic query in @sql_query parameter.
-------------------------------