How can i dynamically change the table name: in the stored procedure depending on the @ModuleIn the following stored procedure under the select query where i use from table names: the table name i hardcoded now is Tab_CCSNETCN mplease, i want to make that dynamic so that i can pass the table name using the parameter @Moduleusing a case: CASE @Module WHEN 'CN' THEN 'Tab_CCSNETCN m' WHEN 'SU' THEN 'TAB_CCSNETSU m' WHEN 'CO' THEN 'TAB_CCSNETCO m'CREATE PROCEDURE dbo.USP_SendEmailActionsSUM (@ModuleID int, @Module Varchar(50)) ASINSERT INTO Tab_ccsNetEmailsum (toemail, alerttime, body, emailsubject)Select u.Email, getdate(), 'Program: ' + pg.progno + char(13)+char(13)+ 'Project: ' + pj.projno + char(13)+char(13) + 'Contract: ' + ct.contractno + char(13) +char(13)+ 'Due Date: ' + CONVERT(varchar(10),a.DueDate,101) + char(13) +char(13)+ 'Company: ' + rtrim(isnull(a.company,'')) + char(13)+char(13) + 'Action Description: ' + a.actiondescription + char(13)+char(13) + 'Status: ' + rtrim(isnull(a.status,'')) + char(13)+char(13)+ 'Comment: ' + rtrim(isnull(a.comment,'')) + char(13)+char(13)+ 'Assigned To: ' + u.UserName + char(13)+char(13) as body,'You have been assigned a Task on CCSNet: '+a.actiondescriptionfrom tab_ccsnetactions a, tab_ccsnetprograms pg, tab_ccsnetprojects pj,tab_ccsnetcontracts ct, TAB_ccsNetUsers u, Tab_ccsNETCN m where a.ModuleRecordID = m.cnid anda.assignedto = u.UserID andm.progid = pg.progid and m.projid = pj.projid andm.contractid = ct.contractid anda.modulerecordid = @ModuleIDGO