Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Migartion script required

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2010-05-21 : 09:43:58
Hi please help me in giving Migration script

Migartion Script for the below requirement
1. Create one table having patient_id, first_access_date,last_access_date with data types as varchar,date,date

2. Get all the tables having the patient_id, then do the union query for all the table

3. Using the above query get the min and max for the created_date or modified_date columns with group by patient_id, year of the date field

4. At last populate the newly created table with patient_id, min-> first_access_date and max -> last_access_date

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2010-05-21 : 18:08:32
Your requirement is not clear. Give us some sample data.
Go to Top of Page

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2010-05-22 : 03:07:45
i want to get all patient_id,created_date columns related tables and want to union them and using above query i want to find the min and max for the created_date column how to do this.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2010-05-23 : 11:36:49
and where is sample data and expected output.. Remember that we can't read your mind.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-05-24 : 10:08:55
quote:
Originally posted by sodeep

and where is sample data and expected output.. Remember that we can't read your mind.


Note that this OP is very poor in giving enough informations to help him

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -