Click here to Skip to main content
15,911,646 members
Home / Discussions / Database
   

Database

 
GeneralRe: Damn database wizard! Pin
Wendelius1-Feb-09 7:10
mentorWendelius1-Feb-09 7:10 
GeneralRe: Damn database wizard! Pin
Muammar©7-Feb-09 4:15
Muammar©7-Feb-09 4:15 
QuestionHow to pass table name dynamically for stored procedure Pin
ashok_rgm30-Jan-09 19:12
ashok_rgm30-Jan-09 19:12 
AnswerRe: How to pass table name dynamically for stored procedure Pin
Wendelius30-Jan-09 19:36
mentorWendelius30-Jan-09 19:36 
GeneralRe: How to pass table name dynamically for stored procedure Pin
Colin Angus Mackay31-Jan-09 1:20
Colin Angus Mackay31-Jan-09 1:20 
GeneralRe: How to pass table name dynamically for stored procedure Pin
Wendelius31-Jan-09 1:40
mentorWendelius31-Jan-09 1:40 
GeneralRe: How to pass table name dynamically for stored procedure Pin
ashok_rgm31-Jan-09 3:20
ashok_rgm31-Jan-09 3:20 
GeneralRe: How to pass table name dynamically for stored procedure Pin
Wendelius31-Jan-09 3:28
mentorWendelius31-Jan-09 3:28 
ashok_rgm wrote:
Can anyone explain other possible mechanisms to handle this scenario in detail


As Colin and I wrote you can use either sp_executesql or exec to execute a dynamic sql statement. Both will do as long as you prevent yourself from sql injections.

In your original post you described that you want to pass the table name as a parameter and use it in your sql statement. However your column names were hardcoded in the statement so it makes me wonder, why do you want to change the table name. First impression is that you have several tables with the same structure. If that's correct then again, why?

The need to optimize rises from a bad design.My articles[^]

GeneralRe: How to pass table name dynamically for stored procedure Pin
ashok_rgm1-Feb-09 23:57
ashok_rgm1-Feb-09 23:57 
GeneralRe: How to pass table name dynamically for stored procedure Pin
Wendelius2-Feb-09 5:36
mentorWendelius2-Feb-09 5:36 
QuestionVista ODBC Questions Pin
Richard Andrew x6430-Jan-09 17:06
professionalRichard Andrew x6430-Jan-09 17:06 
AnswerRe: Vista ODBC Questions Pin
Aman Bhullar31-Jan-09 5:34
Aman Bhullar31-Jan-09 5:34 
QuestionAudit Log In and Audit logout problems in sql server 2005 after XML import to sql server 2005 Pin
Pankaj Garg30-Jan-09 2:21
Pankaj Garg30-Jan-09 2:21 
AnswerRe: Audit Log In and Audit logout problems in sql server 2005 after XML import to sql server 2005 Pin
Wendelius30-Jan-09 3:08
mentorWendelius30-Jan-09 3:08 
Questionsaving/recalling image to/from sql server 2005 using asp.net Pin
roachae29-Jan-09 10:38
roachae29-Jan-09 10:38 
AnswerRe: saving/recalling image to/from sql server 2005 using asp.net Pin
Wendelius29-Jan-09 10:51
mentorWendelius29-Jan-09 10:51 
GeneralRe: saving/recalling image to/from sql server 2005 using asp.net Pin
roachae29-Jan-09 12:21
roachae29-Jan-09 12:21 
GeneralRe: saving/recalling image to/from sql server 2005 using asp.net Pin
Wendelius29-Jan-09 12:30
mentorWendelius29-Jan-09 12:30 
GeneralRe: saving/recalling image to/from sql server 2005 using asp.net Pin
roachae30-Jan-09 6:19
roachae30-Jan-09 6:19 
GeneralRe: saving/recalling image to/from sql server 2005 using asp.net Pin
Wendelius30-Jan-09 7:40
mentorWendelius30-Jan-09 7:40 
AnswerRe: saving/recalling image to/from sql server 2005 using asp.net Pin
Giorgi Dalakishvili29-Jan-09 18:51
mentorGiorgi Dalakishvili29-Jan-09 18:51 
GeneralRe: saving/recalling image to/from sql server 2005 using asp.net Pin
roachae30-Jan-09 6:23
roachae30-Jan-09 6:23 
QuestionHow would you store the ID of a product? (a little bit long question) Pin
Joan M29-Jan-09 8:13
professionalJoan M29-Jan-09 8:13 
AnswerRe: How would you store the ID of a product? (a little bit long question) Pin
Wendelius29-Jan-09 8:56
mentorWendelius29-Jan-09 8:56 
GeneralRe: How would you store the ID of a product? (a little bit long question) Pin
Joan M29-Jan-09 21:26
professionalJoan M29-Jan-09 21:26 

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.