Create sql server view or any other method that accepts parameters

Posted on 2007-10-01
Last Modified: 2012-06-27

I am planning to migrate my website which uses the MS ACESS Database to MS SQL Server 2000.
So, I have to move the tables and queries from access db to sql server.
I have no problem moving the tables.

I have to move the queries from access db to MS SQL SERVER as views..
The access queries gets a parameter and displays the results.
How do I move this with the same functionality to the SQL SERVER 2000????
Question by:jawahar_prasad
    LVL 11

    Expert Comment

    You can create stored procedures on SQL Server that accept parameters, you can get a recordset returned from those.
    LVL 23

    Expert Comment

    by:Ashish Patel
    NO, views in SQL Server 2000 will not accept parameters so write a general query and then you can add where clause to the view in 2000 whenever you use them.
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    you can create functions or stored procedures to accept parameters.
    LVL 1

    Accepted Solution

    for a procedure:

    CREATE PROCEDURE usp_getSelect
    @param1 varchar(10) = NULL
    @param2varchar(10) = NULL

    param1 = @param1 AND
    param2= @param2
    LVL 14

    Expert Comment

    the best bet is to create stored procedures which will accept parameters and perform...
    but in case you want to use a repititive query (which will return a scalar value) you can use functions with parameters and a return value...again it all depends on wht you are doing with  your query

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
    Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now