Solved

I need help creating a Stored Procedure that calls a view using SQL Server 2012

Posted on 2016-09-07
3
66 Views
Last Modified: 2016-09-19
Hi Experts,
I need help creating a Stored Procedure that calls a view using SQL Server 2012.  Is this possible?  What's the syntax for this?

Thanks in advance,
mrotor
0
Comment
Question by:mainrotor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 500 total points
ID: 41787951
A SQL View is like a table so for sure you can do that as in your SP code you will just have statement like


SELECT col1,col2,etc...
FROM YourViewNameHere
WHERE....

For security considerations the user running that SP must (obviously) have SELECT rights from all the view underlying tables.
1
 
LVL 50

Expert Comment

by:Vitor Montalv√£o
ID: 41789245
Totally agree with Icohan. A view isn't more than a virtual table so there's no difference on the way you're using both.
0
 

Author Comment

by:mainrotor
ID: 41805198
Thanks. It works just fine.
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
index related performance counter  for SQL server DB 11 41
Creating a View from a CTE 15 50
File attachment in the SQL Database from application 10 48
Creating Scalar Function 3 20
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.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

710 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