Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear expert,


1. Want to copy from TABLE A TO TABLE B in a stored procedure in MS SQL SERVER 2008.

table B is a replica of table A.


2. Need to append the period the following

a. The Month
b. The Year
c. The Date


should be appended to the copied table to Table B.


How do you accomplish the above .

Thanks
Posted
Updated 31-Jul-15 18:40pm
v2
Comments
Wendelius 1-Aug-15 1:52am    
Do you mean that you have already copied the data to table B and you want to add the date information to existing records?
sasanka sekhar panda 1-Aug-15 3:33am    
More information required ...

1 solution

Try:
SQL
INSERT INTO TableB SELECT *, GETDATE() FROM TableA

A very simple google would have found you this: http://www.w3schools.com/sql/sql_insert_into_select.asp[^]
 
Share this answer
 
Comments
Member 10744248 1-Aug-15 1:38am    
The critical point is how to attach the additional information
1. Month 2. year 3. Date(). which are constants for each record

Please assist

Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900