I have created ASP.NET C#
Web Application (with Database as SQL Server 2008
). My Application Connects to Different databases (Say Count is 10). they all are have same structures i.e. Same Table Name,Stored Procedure Name,SP Argument Count & Type,Table Schema all are same.
But data inside is different.
I have stored procedure inside every database dbo.usp_getData1
which accepts some parameters do some table scans and retrieve data with respect to only that database.
My Question is How Can i Retrieve Data from all my Database using only one of the stored Procedure (As Parameters/Table Structure is same) ?
I can achieve same either by SQL Server
or C# Coding
.
Views will be helpful for me ?
CREATE VIEW [ schema_name . ] view_name [ (column [ ,...n ] ) ]
[ WITH <view_attribute> [ ,...n ] ]
AS select_statement
[ WITH CHECK OPTION ] [ ; ]
<view_attribute> ::=
{
[ ENCRYPTION ]
[ SCHEMABINDING ]
[ VIEW_METADATA ] }