Link to home
Start Free TrialLog in
Avatar of HLRosenberger
HLRosenbergerFlag for United States of America

asked on

SQl stored proc

I want to turn these 3 statements into a stored proc so that I can reuse and create a set of tablew, where the table name is the input parm.   Actually, I need the prefix IHPS on  the table, so I'll only pass everything after IHPS_



CREATE TABLE [dbo].[IHPS_case_information](
      [ID] [bigint] IDENTITY(1,1) NOT NULL,
      [clientID] [bigint] NULL,
 CONSTRAINT [PK_IHPS_case_information] PRIMARY KEY CLUSTERED
(
      [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[IHPS_case_information]  WITH CHECK ADD  CONSTRAINT [FK_IHPS_case_information_IHPS_client] FOREIGN KEY([clientID])
REFERENCES [dbo].[IHPS_client] ([ID])
GO

ALTER TABLE [dbo].[IHPS_case_information] CHECK CONSTRAINT [FK_IHPS_case_information_IHPS_client]
GO
SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HLRosenberger

ASKER

thanks