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 |
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2005-11-15 : 11:12:53
|
| Here's my sp. Before I insert my new values I want to delete the existing records from the table. Can I do this in the same sp ? If so, could someone tell me the syntax please.CREATE PROCEDURE [spRB_AddBlockBookingDateRef]** here Delete * from tblRB_BlockBookingDates@strBookingDateRef nvarchar(100),@strRoomRef nvarchar (50),@strDateRequired datetimeASINSERT INTO tblRB_BlockBookingDates(BB_BookingDateRef,BB_RoomRef,BB_DateRequired)VALUES(@strBookingDateRef,@strRoomRef,@strdateRequired)GO |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-11-15 : 11:50:51
|
...ASdelete from tblRB_BlockBookingDates where you conditioninsert into ....Go with the flow & have fun! Else fight the flow |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2005-11-15 : 11:52:28
|
| I don't need a 'WHERE' I want to delete all the records. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-11-15 : 11:54:56
|
well then just do delete from tblRB_BlockBookingDatesGo with the flow & have fun! Else fight the flow |
 |
|
|
Vivaldi
Constraint Violating Yak Guru
298 Posts |
Posted - 2005-11-15 : 12:25:37
|
| truncate table tblRB_BlockBookingDatesgoINSERT INTO tblRB_BlockBookingDates(BB_BookingDateRef,BB_RoomRef,BB_DateRequired)VALUES(@strBookingDateRef,@strRoomRef,@strdateRequired)________________________________________________SQL = Serious Quaffing of Liquor |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2005-11-16 : 04:28:00
|
| Many thanks - it's working fine now. |
 |
|
|
|
|
|