Click here to Skip to main content
15,909,530 members
Home / Discussions / Database
   

Database

 
Questionmost efficient way to create query... Pin
adairjk15-Jan-07 11:56
adairjk15-Jan-07 11:56 
AnswerRe: most efficient way to create query... Pin
Miszou15-Jan-07 12:28
Miszou15-Jan-07 12:28 
GeneralRe: most efficient way to create query... Pin
adairjk16-Jan-07 3:15
adairjk16-Jan-07 3:15 
GeneralRe: most efficient way to create query... Pin
Miszou16-Jan-07 17:09
Miszou16-Jan-07 17:09 
QuestionSQL Server 2005 Express and Database Diagrams Pin
Miszou15-Jan-07 8:42
Miszou15-Jan-07 8:42 
AnswerRe: SQL Server 2005 Express and Database Diagrams Pin
Colin Angus Mackay15-Jan-07 12:51
Colin Angus Mackay15-Jan-07 12:51 
AnswerRe: SQL Server 2005 Express and Database Diagrams Pin
Pete O'Hanlon15-Jan-07 22:53
mvePete O'Hanlon15-Jan-07 22:53 
Questionusing sp_MSForEachTable to delete data with a where clause [modified] Pin
PrashantJ15-Jan-07 5:10
PrashantJ15-Jan-07 5:10 
Hi All,

I wanted to use the undocumented SP sp_MSForEachTable to selectively delete data from tables. So in short i want to achieve something like this using sp_MSForEachTable.

delete from TableName where Date = '2007-01-03'

I looked at various queries on the internet using sp_MSForEachTable, but was not able to find out the usage of sp_MSForEachTable with a "Where" clause, so if anybody has the query or links request to post it here.
All that I found was to delete all data from all the tables in the db.

I tried using the @whereand option like this, but the got an error saying Invalid column: SomeDate. I have this column in all the tables in that database. I did a quick check looping thro all the tables using cursors and that works fine.

EXEC sp_MSForEachTable @command1='DELETE FROM ?'
,@whereand='and SomeDate = "2007-01-15"'

Thanks.
PJ


-- modified at 14:39 Monday 15th January, 2007
QuestionPlease Guide Me Pin
Ashish Porwal15-Jan-07 5:04
Ashish Porwal15-Jan-07 5:04 
Question[Message Deleted] Pin
Orcun Ozturk15-Jan-07 5:04
Orcun Ozturk15-Jan-07 5:04 
AnswerRe: Desktop Database! Pin
Kschuler15-Jan-07 9:51
Kschuler15-Jan-07 9:51 
GeneralRe: Desktop Database! Pin
Orcun Ozturk16-Jan-07 1:53
Orcun Ozturk16-Jan-07 1:53 
GeneralRe: Desktop Database! Pin
Kschuler16-Jan-07 2:57
Kschuler16-Jan-07 2:57 
GeneralDesktop Database! Pin
Orcun Ozturk16-Jan-07 3:07
Orcun Ozturk16-Jan-07 3:07 
QuestionHow to get all table's name ? In OdbcConnection Pin
mlqxj3567415-Jan-07 4:40
mlqxj3567415-Jan-07 4:40 
AnswerRe: How to get all table's name ? In OdbcConnection [modified] Pin
Uri Lavi15-Jan-07 7:03
Uri Lavi15-Jan-07 7:03 
GeneralRe: How to get all table's name ? In OdbcConnection Pin
mlqxj3567416-Jan-07 4:22
mlqxj3567416-Jan-07 4:22 
QuestionHow to fetch dates havng interval of 7 weeks betwwen them? Pin
Guru_yogi15-Jan-07 1:48
Guru_yogi15-Jan-07 1:48 
AnswerRe: How to fetch dates havng interval of 7 weeks betwwen them? Pin
Pete O'Hanlon15-Jan-07 2:04
mvePete O'Hanlon15-Jan-07 2:04 
Questiondata retrive from database Pin
Pradip Kishore14-Jan-07 22:46
Pradip Kishore14-Jan-07 22:46 
AnswerRe: data retrive from database Pin
Colin Angus Mackay14-Jan-07 23:08
Colin Angus Mackay14-Jan-07 23:08 
Questiondifference Pin
Ashutosh Kumar Gupta14-Jan-07 20:14
Ashutosh Kumar Gupta14-Jan-07 20:14 
AnswerRe: difference Pin
Colin Angus Mackay14-Jan-07 22:39
Colin Angus Mackay14-Jan-07 22:39 
GeneralRe: difference Pin
PavanPareta18-Jan-07 18:55
PavanPareta18-Jan-07 18:55 
Questionsql querry Pin
pradeep kulkarni14-Jan-07 18:29
pradeep kulkarni14-Jan-07 18:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.