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.
| Author |
Topic |
|
OBINNA_EKE
Posting Yak Master
234 Posts |
Posted - 2007-03-02 : 08:42:17
|
| I want to insert data into a table Period without overwriting old dataSELECT Period1Start,Period1End, 1 as PeriodType, SuperAreaID,Period1Price INTO Period FROM EUBoatsPreferences2 where SuperAreaID = 71goSELECT Period1Start,Period1End, 2 as PeriodType, SuperAreaID,Period1Price INTO Period FROM EUBoatsPreferences2 where SuperAreaID = 72SQL 2005 IS SAYINGMsg 2714, Level 16, State 6, Line 1There is already an object named 'Period' in the database.Which I know, I just want to append the data, pls helpIf it is that easy, everybody will be doing it |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-03-02 : 08:45:38
|
| 1. Don't use SELECT...INTO for large data copy operations, it results in placing locks on system tables for the duration of copy2. Create table first and then insert data using INSERT INTO...SELECT statement.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
OBINNA_EKE
Posting Yak Master
234 Posts |
Posted - 2007-03-02 : 08:54:58
|
| Thank u people, I have solved itINSERT INTO Period(PeriodStartDate,PeriodEndDate,PeriodType,SuperAreaID,PeriodPrice)select Period1Start,Period1End, 6 as PeriodType, SuperAreaID,Period1Pricefrom EUBoatsPreferences2 where SuperAreaID = 76If it is that easy, everybody will be doing it |
 |
|
|
|
|
|
|
|