stored procedure to get data form table

  • I have a table where it has weekdes column where it contains data in this format.

    Data looks like -
    Wk 1 Oct 2017
    Wk 2 Oct 2017
    Wk3 Oct 2017....

    Query to get data from table - select weekdes from dbo.FYear

    It will show the data for all the weeks in a month and in a year.

    So I want to write a stored procedure , with two parameters start and end week that contains same data. to get this data form this column (Weekdes) and i want to show this stored procedure data in asp.net drop down list.
    My asp.net code has 2 date parameter drop down list where the data populates from this stored proceudre
    How to write a stored proc?

  • To create a Stored procedure is as simple as:
    CREATE PROC dbo.HelloWorld AS
        SELECT 'Hello World' AS HelloWorld;
    GO

    So to return a dataset from a table uses the exact same idea.

    I'm not really sure what you mean for the latter. Is this for a website? What language is the site in.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • select weekdes from dbo.FYear is the query

    I want this column data to be in both start and end variables?

    when i execute stored procedure same data should see in both the varaibales strart and end

  • mcfarlandparkway - Wednesday, August 2, 2017 7:43 AM

    select weekdes from dbo.FYear is the query

    I want this column data to be in both start and end variables?

    when i execute stored procedure same data should see in both the varaibales strart and end

    What variables? There aren't any in your query.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply