473,394 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Creating a View from a Stored procedure

Hello

Newbie here.

Is there a way of creating a VIEW...using a stored procedure. I am
basically trying to create a view to return some data that I am
getting using a stored procedure.

I have created the procedure and when I execute this its working ok.
The stored procedure uses a datefrom and dateTo which I have set up by
tweaking the getdate() and getdate()-2.

In other words can you create a view like this

CREATE VIEW view_test
AS
exec proc_test
GO

Any help will be greatly appreciated.

Remmy

Sep 19 '07 #1
1 13144
A view is a single SELECT statement. If you can write the stored
procedure as a single SELECT you can make that SELECT into a view.

Otherwise, you might look into Table Valued Functions.

Roy Harvey
Beacon Falls, CT

On Wed, 19 Sep 2007 14:43:04 -0000, apothecary <wa*****@gmail.com>
wrote:
>Hello

Newbie here.

Is there a way of creating a VIEW...using a stored procedure. I am
basically trying to create a view to return some data that I am
getting using a stored procedure.

I have created the procedure and when I execute this its working ok.
The stored procedure uses a datefrom and dateTo which I have set up by
tweaking the getdate() and getdate()-2.

In other words can you create a view like this

CREATE VIEW view_test
AS
exec proc_test
GO

Any help will be greatly appreciated.

Remmy
Sep 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: MD | last post by:
I am trying to create a dynamic SQL statement to create a view. I have a stored procedure, which based on the parameters passed calls different stored procedures. Each of this sub stored procedure...
11
by: randi_clausen | last post by:
Using SQL against a DB2 table the 'with' key word is used to dynamically create a temporary table with an SQL statement that is retained for the duration of that SQL statement. What is the...
10
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I...
0
by: billmiami2 | last post by:
Perhaps many of you MS Access fanatics already know this, but it seems that stored procedures and views are possible in Jet. I thought I would leave this message just in case it would help anyone....
1
by: Matt | last post by:
Hi, I'm trying to fill an ASP.NET DataGrid from a SQL-Server View. Note that this is a View and not a Stored Procedure. If i write the SQL instructions directly in the code, or if i use a...
104
by: Beowulf | last post by:
I have the view below and if I use vwRouteReference as the rowsource for a combo box in an MS Access form or run "SELECT * FROM vwRouteReference" in SQL Query Analyzer, the rows don't come through...
5
by: Grzegorz Danowski | last post by:
Hi I have two databases: Customers and Operations. In Customers database I have made a view based on a few tables from both Customers and Operations (left join - customers without any...
2
by: Andy | last post by:
Hi guys I having a problem creating a report in Access 2003 project talking to a SQL database through and ODBC connect. After hours of trying things from Access Help, MSDN and Google I still...
1
by: Sureshbari | last post by:
Dear All, I have four table in database , each table contain the 5 lacs record, i have created a view on that four table using union clause. and now i am call that view form my code like ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.