Viewing 15 posts - 91 through 105 (of 127 total)
Please help me.
June 5, 2013 at 3:48 pm
THE RESULT SHOULD BE LIKE THIS
Student table
StudentIDTitleFirstNameMiddleNameLastNameLASTMODIFIEDSTATUS
a7msjessicaraya2008-01-02NULL
a1mrparasrays2011-11-12NULL
a3mskoiraya2009-01-02NULL
a4msmoiraya2013-01-02NULL
a5mrjalparaya2011-01-02NULL
a6mrjonesraya2010-01-02NULL
a8mrjinaraya2011-11-12NULL
this is the destination table, which is updated by the merge query..
and record no. a9 is deleted..
from here and other record copied from source...
June 5, 2013 at 3:46 pm
APPLY THIS ATTACHED STORED PROCEDURE..YOU CAN FIND IT AT THE BOTTOM OF THIS ARTICLE'S PAGE http://www.sqlservercentral.com/Forums/Attachment12862.aspx
OR
CREATE PROCEDURE [TEST_SCHEMA].[generate_merge]
...
June 5, 2013 at 3:43 pm
DESTINATION TABLE SHOULD LOOK LIKE THIS
StudentIDTitleFirstNameMiddleNameLastNameLASTMODIFIEDSTATUS
a1mr pratikroy b2013-06-08NULL
a2ms jessicaray...
June 5, 2013 at 3:41 pm
FOR INSERTING DATA INTO DESTINATION TABLE
INSERT INTO [AdventureWorks].[Person].[Student2]VALUES('a7','ms','jessica','ray','a','2008-01-02',null)
GO
INSERT INTO [AdventureWorks].[Person].[Student2]VALUES('a1','mr','paras','ray','s','2011-11-12',null)
GO
INSERT INTO [AdventureWorks].[Person].[Student2]VALUES('a3','ms','koi','ray','a','2009-01-02',null)
GO
INSERT INTO [AdventureWorks].[Person].[Student2]VALUES('a4','ms','moi','ray','a','2013-01-02',null)
GO
INSERT INTO [AdventureWorks].[Person].[Student2]VALUES('a5','mr','jalpa','ray','a','2011-01-02',null)
GO
INSERT INTO [AdventureWorks].[Person].[Student2]VALUES('a6','mr','jones','ray','a','2010-01-02',null)
GO
FOR INSERTING DATA INTO SOURCE TABLE
INSERT INTO [AdventureWorks].[Person].[StudentDetails1]VALUES('a7','ms','jessica','ray','a','2008-01-02')
GO
INSERT INTO [AdventureWorks].[Person].[StudentDetails1]VALUES('a3','m','koi','ray','p','2009-01-02')
GO
INSERT INTO [AdventureWorks].[Person].[StudentDetails1]VALUES('a4','ms','moi','ray','p','2013-01-02')
GO
INSERT INTO...
June 5, 2013 at 3:40 pm
DESTINATION TABLE
USE [AdventureWorks]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Person].[Student2](
[StudentID] [nchar](2) NOT NULL,
[Title] [nvarchar](8) NULL,
[FirstName] [dbo].[Name] NOT NULL,
[MiddleName] [dbo].[Name] NULL,
[LastName] [dbo].[Name] NOT NULL,
[LASTMODIFIED] [DATE] NOT NULL,
[STATUS] [nchar](10)
) ON [PRIMARY]
GO
SOURCE TABLE
USE...
June 5, 2013 at 3:39 pm
this is working 100% , when we handle only specific table names for source and detination and we can harcode everything.
but the merge statment which I am using , its...
June 5, 2013 at 2:04 pm
Please friends..give me a hint..so i can start working around..
I ried so many different options but, they are not good for getting solution.
thanks in advance.
pratik.
June 5, 2013 at 12:43 pm
Please find an attachement , which indicates what I need for the solution and how my solution should look like.
The problem is when I use that merge statment which I...
June 5, 2013 at 12:04 pm
Please find an attachement , which indicates what I need for the solution and how my solution should look like.
The problem is when I use that merge statment which I...
June 5, 2013 at 11:15 am
Ok I guess , I need to jsut replay the post, not actually starting the new topic.!!
Is it right?
June 5, 2013 at 9:34 am
should I unsubscribe them?
June 5, 2013 at 9:26 am
Hi,
But I really don't knwo how should i delete old threads..that's is the reason I also posted one topic how to delete the threads..yeasterday.
Please let me know how I can...
June 5, 2013 at 9:21 am
Can use something like number instead of the string..will it make significance in getting solution of my query?
June 4, 2013 at 5:23 pm
only adding "Delete" word into the status column will also work for me at this stage.
thanks in advance.
pratik.
June 4, 2013 at 3:33 pm
Viewing 15 posts - 91 through 105 (of 127 total)