Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server 2005 Integration Services
»
How to insert records based on Audit Table
How to insert records based on Audit Table
Rate Topic
Display Mode
Topic Options
Author
Message
sqlstud
sqlstud
Posted Friday, October 05, 2012 2:47 AM
SSC Journeyman
Group: General Forum Members
Last Login: Tuesday, March 12, 2013 3:57 AM
Points: 93,
Visits: 237
Audit table:
CREATE TABLE [dbo].[AUDIT_RECORD](
[FILENAME] [varchar](100) NULL,
[LOAD_DATE] [datetime] NULL
)
Insert into [dbo].[AUDIT_RECORD] values('Sample',12/09/2012)
Insert into [dbo].[AUDIT_RECORD] values('Sample',13/09/2012)
----------------------------------------------------
DB Table:
CREATE TABLE [dbo].[Sample1](
[pKey] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
[SasId] [nvarchar](max) NULL,
[Name] [nvarchar](max) NULL,
[TypeId] [nvarchar](max) NULL,
[UserName] [nvarchar](max) NULL,
[SysCreatedDateTime] [datetime] NULL,
[CompletedDateTime] [datetime] NULL,
[Boolean] [bit] NULL,
)
insert into Sample1 values('sdf','werwer','s233','xzfdsdf',12/11/2011,14/11/2011,'TRUE')
----------------------------------------
Ques:
Have a table “Sample1” and one of the columns is “SysCreatedDateTime”
Need to transfer the records from a table(Sample1) to another table(Sample2) based on the below condition
Condition:
Sample.SysCreatedDateTime > [dbo].[AUDIT_RECORD].MAX(LOAD_DATE)
How will we do this using SSIS 2005?
Regards
Sql
Post #1368881
ChrisM@Work
ChrisM@Work
Posted Friday, October 05, 2012 3:10 AM
SSCertifiable
Group: General Forum Members
Last Login: 2 days ago @ 9:27 AM
Points: 5,618,
Visits: 10,990
sqlstud (10/5/2012)
...
How will we do this using SSIS 2005?
Regards
Sql
SSIS is a bit overkill for this.
INSERT INTO ...
SELECT... FROM ... WHERE ...
“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.”
- Gail Shaw
For fast, accurate and documented assistance in answering your questions, please read
this article
.
Understanding and using APPLY, (I)
and
(II)
Paul White
Hidden RBAR: Triangular Joins
/
The "Numbers" or "Tally" Table: What it is and how it replaces a loop
Jeff Moden
Exploring Recursive CTEs by Example
Dwain Camps
Post #1368893
Sree Divya
Sree Divya
Posted Friday, October 05, 2012 3:26 AM
SSCrazy
Group: General Forum Members
Last Login: Tuesday, April 23, 2013 10:52 PM
Points: 2,118,
Visits: 343
you can use execute sql script task and there you write one script of select * into...
Post #1368902
sqlstud
sqlstud
Posted Wednesday, October 10, 2012 12:30 AM
SSC Journeyman
Group: General Forum Members
Last Login: Tuesday, March 12, 2013 3:57 AM
Points: 93,
Visits: 237
Thanks Chris and Div
Regards
Sqlstud
Post #1370704
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.