Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Feb 2005
    Posts
    9

    Unanswered: How to retrieve data using a search?

    Hello
    Is there any way in which i can retirve data using input parameters?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you're thinking of the way a dialog box pops up in microsoft access?

    no, in sql server you have to do this with application code
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2005
    Posts
    9

    application code

    yes , u r right, i was thinking teh way exactly as it can be done in access?
    can u pls send me a sample code of writing an application code?
    Thanx in advance

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    not me, no, maybe someone else

    i'm not a programmer
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Feb 2005
    Posts
    9
    so its beeen a big ask in retrieving data of a particular choice in MS SQL?

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    No. It's pretty easy. Is it a big ask to figure it out yourself?

    We don't even know what interface you are using. VB? Access mdb? Access adp? DotNet? C#?

    You expect people to not only do your work for you, but to guess what you want? That's a pretty big ask.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  7. #7
    Join Date
    Feb 2005
    Posts
    9
    But i am using webassitant wizard to get the reports on the Intranet. and VB is our front end.
    where i have an option for reports tab on the VB front end where it fetches data from the webassistant wizard.
    every other report works fine, Only thing i am trouble designing in reports is to search in a particular field. as i am new to this developing part in SQL any ones help in solving the search with input parameters would be much appreciated.
    Thanx in advance
    VEE Yes

  8. #8
    Join Date
    Jan 2005
    Location
    TempDb
    Posts
    228
    Ummmmm... post your question in a forum for whatever front-end application your using (I was unable to decipher anything other than VB from your description).

    You're on the wrong forum, but you might get lucky from a passer-by understanding what you are experiencing. If you don't want to wait around for a ride, then go directly to the right forum, do not pass Go and do not collect $200.
    I love deadlines. I like the whooshing sound they make as they fly by. Douglas Adams

  9. #9
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Just a guess at what you want, but you should probably write a stored procedure on your SQL Server database that takes your search terms as parameters and returns the dataset to your application.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  10. #10
    Join Date
    Feb 2005
    Posts
    9

    stored procedure

    CAn any one help me with a stored procedure to write to take an input parameters to search and retrieve data?

  11. #11
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    Remember two things...
    only use this code to benefit man
    and
    Soylent Green is PEOPLE!!!!!!!!!


    Code:
    /*
    this script creates a db, a table, and a stored procedure.
    the table shows the level of my malaise 
    which steadily grows from crappy to the ultimate level
    rdjabarov
    the proc asks for a parameter to return query rows.
    */
    
    create database crappyDB
    go
    use Crappydb
    go 
    create table CrappyTable
    (
    col1 int
    ,col2 varchar(20)
    )
    go
    
     insert into crappytable select 1, 'crappy' 
    union select 2, 'really crappy'
    union select 3, 'extra crappy'
    union select 4, 'totally crappy'
    union select 5, 'RDJabarov'
    go
    select * from crappytable
    go
    create  procedure Pcrappyproc
    @col1 int
    as 
    select col2 as 'rate my malaise' from crappytable 
    where col1 = @col1
    
    go
    exec Pcrappyproc 5 
    go
    --drop database crappydb

  12. #12
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    brilliant code

    especially col2's column alias

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  13. #13
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    shhhhhhhh

    i get no pleasure from doing it.....plus it gets him all riled up.

  14. #14
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Oh, like THAT is so difficult...
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  15. #15
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Quote Originally Posted by Ruprect
    ...select 5, 'RDJabarov'...
    So you have time to post silly things like this, but you don't have the time to send your resume???

    How's VA?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •