HLRosenberger
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_informati on](
[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_informati on] WITH CHECK ADD CONSTRAINT [FK_IHPS_case_information_ IHPS_clien t] FOREIGN KEY([clientID])
REFERENCES [dbo].[IHPS_client] ([ID])
GO
ALTER TABLE [dbo].[IHPS_case_informati on] CHECK CONSTRAINT [FK_IHPS_case_information_ IHPS_clien t]
GO
CREATE TABLE [dbo].[IHPS_case_informati
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[clientID] [bigint] NULL,
CONSTRAINT [PK_IHPS_case_information]
(
[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_informati
REFERENCES [dbo].[IHPS_client] ([ID])
GO
ALTER TABLE [dbo].[IHPS_case_informati
GO
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER