Click here to Skip to main content
15,888,610 members
Home / Discussions / Database
   

Database

 
AnswerRe: Return output parameter and dataset Pin
kubben16-Mar-07 12:47
kubben16-Mar-07 12:47 
QuestionAutomatically generating scripts? [modified] Pin
LongRange.Shooter16-Mar-07 7:00
LongRange.Shooter16-Mar-07 7:00 
AnswerRe: Automatically generating scripts? Pin
Mark J. Miller19-Mar-07 5:57
Mark J. Miller19-Mar-07 5:57 
GeneralRe: Automatically generating scripts? Pin
LongRange.Shooter20-Mar-07 6:27
LongRange.Shooter20-Mar-07 6:27 
QuestionMultiple Instances - SQLSERVER Pin
clint198216-Mar-07 5:00
clint198216-Mar-07 5:00 
AnswerRe: Multiple Instances - SQLSERVER Pin
Mike Dimmick16-Mar-07 6:22
Mike Dimmick16-Mar-07 6:22 
GeneralRe: Multiple Instances - SQLSERVER Pin
clint198216-Mar-07 8:26
clint198216-Mar-07 8:26 
Questionstored procedures Vs dynamic SQL Pin
digsy_16-Mar-07 3:40
digsy_16-Mar-07 3:40 
I have a question about stored procedures Vs dynamic SQL.

I'm a noob but from the googling I've done this seems to be a hot topic so I dont want to start an arguement but I'm stuck.

The website I am working on has a data access layer that takes in a SP name & parameters. It runs the SP and returns the resulting data to the page that requested it.

This is easy & quick to maintain for me.

However, my users want to be able to search the customer using search criteria parameters that can be different each time. By that I mean they want to be able to search for customers using whatever data they have. Sometimes they will have a last name, other times a last name & birth date, sometimes a phone number and a first name.

This doesnt seem to lend itself to a SP - the parameters change each time so the solutions seem to be:

1. A SP that has every criteria in it and use LIKE '%%' when the customer doesnt use one of them
2. Have the data access layer dynamically build the required SQL and then insert it into the SP somehow. (Which sorta kinda sounds like SQL injection)
3. Build an SP for each group of search criteria (Name, DOB, Phone numbers, TIN) and then only allow the users to use one search criteria group at a time.

Neither solution sounds that great to me. (There may be others but like I say I'm a noob)

Which leads me to think that maybe in this case I should use Dynamic SQL - e.g. have the data acccess layer create the SQL statement and then execute it against the database without using an SP.

But then that breaks my rule of only using SP (which I originally created cos I thought SP ran quicker but then I read that according to some guys at MS that dynamic SQL runs as quickly as SP in the .Net environment) so now I'm confused.
AnswerRe: stored procedures Vs dynamic SQL Pin
Pete O'Hanlon16-Mar-07 3:44
mvePete O'Hanlon16-Mar-07 3:44 
GeneralRe: stored procedures Vs dynamic SQL Pin
digsy_16-Mar-07 3:56
digsy_16-Mar-07 3:56 
GeneralRe: stored procedures Vs dynamic SQL Pin
Pete O'Hanlon16-Mar-07 4:09
mvePete O'Hanlon16-Mar-07 4:09 
GeneralRe: stored procedures Vs dynamic SQL Pin
digsy_16-Mar-07 4:51
digsy_16-Mar-07 4:51 
GeneralRe: stored procedures Vs dynamic SQL Pin
Pete O'Hanlon16-Mar-07 13:02
mvePete O'Hanlon16-Mar-07 13:02 
AnswerRe: stored procedures Vs dynamic SQL Pin
Mike Dimmick16-Mar-07 6:44
Mike Dimmick16-Mar-07 6:44 
QuestionMultiple Instances - SQLSERVER Pin
clint198216-Mar-07 3:39
clint198216-Mar-07 3:39 
AnswerRe: Multiple Instances - SQLSERVER Pin
Hesham Amin16-Mar-07 9:01
Hesham Amin16-Mar-07 9:01 
Questionhow we can use stored proceder with asp.net Pin
jayvaishnav8216-Mar-07 2:42
jayvaishnav8216-Mar-07 2:42 
AnswerRe: how we can use stored proceder with asp.net Pin
kubben16-Mar-07 2:47
kubben16-Mar-07 2:47 
AnswerRe: how we can use stored proceder with asp.net Pin
Marcus J. Smith16-Mar-07 2:47
professionalMarcus J. Smith16-Mar-07 2:47 
AnswerRe: how we can use stored proceder with asp.net Pin
Colin Angus Mackay16-Mar-07 3:37
Colin Angus Mackay16-Mar-07 3:37 
JokeRe: how we can use stored proceder with asp.net Pin
LongRange.Shooter16-Mar-07 7:48
LongRange.Shooter16-Mar-07 7:48 
GeneralRe: how we can use stored proceder with asp.net Pin
jayvaishnav8216-Mar-07 20:01
jayvaishnav8216-Mar-07 20:01 
GeneralRe: how we can use stored proceder with asp.net Pin
Colin Angus Mackay16-Mar-07 23:50
Colin Angus Mackay16-Mar-07 23:50 
Questioncopy data between 2 instances Pin
Ista16-Mar-07 2:35
Ista16-Mar-07 2:35 
AnswerRe: copy data between 2 instances Pin
kubben16-Mar-07 2:43
kubben16-Mar-07 2:43 

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.