DECLARE @tmpOldTable TABLE
(
ID BIGINT, DueDate DATETIME, ContactID BIGINT,
Email NVARCHAR(100), Mobile NVARCHAR(50), Phone NVARCHAR(50),
Subject NVARCHAR(100), Description NVARCHAR(MAX), ProductID BIGINT,
StatusID INT, PriorityID INT, ChannelID INT,
ClassificationID INT, Owner NVARCHAR(50)
)
INSERT INTO @tmpOldTable
(ID,DueDate,ContactID,Email,Mobile,Phone,[Subject],[Description],ProductID,
StatusID,PriorityID,ChannelID,ClassificationID,Owner)
SELECT TOP 1 ID,DueDate,ContactID,Email,Mobile,Phone,[Subject],[Description],ProductID,
StatusID,PriorityID,ChannelID,ClassificationID,Owner
FROM TableName WHERE ID=@ID
Select * FROM @tmpOldTable
(
ID BIGINT, DueDate DATETIME, ContactID BIGINT,
Email NVARCHAR(100), Mobile NVARCHAR(50), Phone NVARCHAR(50),
Subject NVARCHAR(100), Description NVARCHAR(MAX), ProductID BIGINT,
StatusID INT, PriorityID INT, ChannelID INT,
ClassificationID INT, Owner NVARCHAR(50)
)
INSERT INTO @tmpOldTable
(ID,DueDate,ContactID,Email,Mobile,Phone,[Subject],[Description],ProductID,
StatusID,PriorityID,ChannelID,ClassificationID,Owner)
SELECT TOP 1 ID,DueDate,ContactID,Email,Mobile,Phone,[Subject],[Description],ProductID,
StatusID,PriorityID,ChannelID,ClassificationID,Owner
FROM TableName WHERE ID=@ID
Select * FROM @tmpOldTable
No comments:
Post a Comment