Adding Data Through Views ?

Dec 8, 2004

Hi!
Is it possible to add/delete/modidy data through views?
What is the major difference between SQL Stored procedure & SQL function?One diff i know is using SP we can execute transact-sql statements.Is there any other difference?

Thanks in advance

View 1 Replies


ADVERTISEMENT

Best Practice - Data Sources And Data Views Vs OLE DB Source

Feb 26, 2008

Hi, i'm wondering which is the best way to search data in a SQL Server.
I reach data using Data Sources and Data Views and also with OLE DB Source with a Data access mode: Named query.
I have to write the data into a Flat File. So, does any one knows which is the best practice for this? Or any one of the two are good choices?
Thanks for your help.

Beli

View 6 Replies View Related

Are Embedded Views (Views Within Views...) Evil And If So Why?

Apr 3, 2006

Fellow database developers,I would like to draw on your experience with views. I have a databasethat includes many views. Sometimes, views contains other views, andthose views in turn may contain views. In fact, I have some views inmy database that are a product of nested views of up to 6 levels deep!The reason we did this was.1. Object-oriented in nature. Makes it easy to work with them.2. Changing an underlying view (adding new fields, removing etc),automatically the higher up views inherit this new information. Thismake maintenance very easy.3. These nested views are only ever used for the reporting side of ourapplication, not for the day-to-day database use by the application.We use Crystal Reports and Crystal is smart enough (can't believe Ijust said that about Crystal) to only pull back the fields that arebeing accessed by the report. In other words, Crystal will issue aSelect field1, field2, field3 from ReportingView Where .... eventhough "ReportingView" contains a long list of fields.Problems I can see.1. Parent views generally use "Select * From childview". This meansthat we have to execute a "sp_refreshview" command against all viewswhenever child views are altered.2. Parent views return a lot of information that isn't necessarilyused.3. Makes it harder to track down exactly where the information iscoming from. You have to drill right through to the child view to seethe raw table joins etc.Does anyone have any comments on this database design? I would love tohear your opinions and tales from the trenches.Best regards,Rod.

View 15 Replies View Related

SQL 2012 :: SSIS Data Flow Items Tab Missing For Adding Data Source / Destination

Apr 3, 2014

I need to see inside a SSIS 2012 project a new SSIS installed component, but in the SSDT 2010 I cannot see the SSIS Data Flow Items tab for adding data source/data destination respect to the choose toolbox items pane.

View 4 Replies View Related

Adding A New Data Column (not Derived) Midway Thru A Data Flow

Jan 5, 2006

I need to know what a table's max row Identity is part way thru a data flow.  I can't get it at the beginning of the data flow.  I need to either (1) add it to the data buffer part way thru or (2) set it into a package variable and then reference the var in a script component.

I've not found a way to add a database column to the data buffer without doing a lookup for each row (too slow and not appropriate here) or some goofy oledb source and then merge join into the data buffer on a contrived join.

I've read questions about referencing package vars in scripts but I can't get that to work.  DTS.Variables("varname").Value isn't recognised when I code it up.

Anyone have an idea or solution for either one of these?  If you're gonna explain the script code, please include the entire snipet including the INCLUDEs, etc.

View 8 Replies View Related

Partition Data/Views?

Jul 17, 2001

Hi folks,

Recently i've been working on a new project that would partition a large table 2 smaller tables. I then create a view to union the 2 smaller tables(table A, B). I've been getting a strange error when i try to update, insert, delete a record through the view. "View needs partitioning column"....i find this strange. Both of my table have a cluster primary key consisting of 3 columns, and one of the 3 columns(date field) consist of a check constraint. The constraint is used to determine what record goes into which table. Am i missing anything else? The really strange part is sometime it works, and sometimes i get the error message.

Any thoughts?

Joe R.

View 1 Replies View Related

Editing Data Using Views

Feb 29, 2008

Please direct me towards good documentation about updating, inserting and deleting data using views involving multiple tables.

Thanks

View 2 Replies View Related

Retriving Data From 2 Views By The Value In A Textbox

Aug 9, 2007

i have a textbox which a user enters a numeric value 
i want it to use SqlDataSource and check if the value exists in any of the tables. 
in my text box the users would enter starting from '100000'  or '200000'
i want it to check the view that starts the # with '100000' and 2ed view starts '200000' 
With this i can check in one of the tables and make the selection.
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:imacstestConnectionString %>"
SelectCommand="SELECT [ReportNumber] FROM [AppraisalSummaryBlue] WHERE ([ReportNumber] = @ReportNumber)">
<SelectParameters>
<asp:ControlParameter ControlID="txtReport" Name="ReportNumber" PropertyName="Text"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
 
How can i make this possible ?
i was thinking putting a second sqldatasource and have that check the second view but how can i make the textbox goto the correct selectcommand ?

View 1 Replies View Related

Reading Data From Table And Views

Feb 2, 2006

Hi
I need to read a very big table more than 60,000 record but it is giving the following problem: But if it is small table there is no problem. Same problem also views.
 
Server Error in '/POBuilds' Application.


Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".



<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.



<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>

View 1 Replies View Related

Very Urgent : Bcp Or Dts Data To Partitioned Views

Jan 1, 2004

someone please tell me if i can bcp or dts data in to partition views
it is failing with the error the bulk operation does not support this

View 14 Replies View Related

Comparing Data In Tables/views.

May 13, 2008

I am looking for an efficient mechanism to compare data between 2 tables/views.

Rationale:
I use a proprietary tool to data transfer between 2 databases. The tool itself uses Microsoft SSIS (integration service) to transfer data. I want to make sure that the data is transfered properly. Both the source and target database are not live database. The source and target database are in seperate servers.

View 2 Replies View Related

Querying Data From Multiple Views

Jul 23, 2005

Hello,I am relatively new to doing non-trivial SQL queries.I have to get data out of 8 diff views based on a parameter Name.There is a view having name-ssn pairs. All other views have SSN field.For a person there MAY NOT be data in all the views.I have to populate data into diff tables in a Report from differentviews.I would like to know what is the best way to approach it.So far I was trying an Inner join from the Name-ssn vies to all otherviews based on the SSN and test for the name field with the inputparameter.I am thinking there will be problem of Cross join if I dont have datain all views about a person.Or the best way is to write query for each view and have all of them ina stored procedure ?Any help will be appreciatedThanksBofo

View 1 Replies View Related

Data Parsing In SQL Server Views

Jul 23, 2005

If column1 in SQL Server column is text: 19980701What is the syntax in the select statement to convert it to a datelike: 07/01/1998Thanks for any helpRbollinger

View 1 Replies View Related

Using Views/Stored Procs In One Db, Data In Another

Jan 24, 2007

I am moving an app from Access 2003 to C#/SQL Server 2005. The Access app has one front end exe and two back end databases. One back end db is for UK users, one for US users. The tables and structures are identical, but the data is different. UK users link to the UK back end, US users to the US backend. (The queries are in the front end)

In SQL Server, the view and stored procs will be in one database (KCom), the US data tables in another database (KUS), and the UK data tables in another (KUK). All databases are on the same server.

My question is how to let the views and stored procs in KCom know whether to pull the data from KUK or KUS.

In the front end app, I use ADO.Net to deal with the SQL Server databases.

I have not been able to find a model for this, but it must be somewhat common.

I willl have a lost of nested views and stored procs, but as a simple example, say I have a view in KCom which is just "Select * From Invoice Where InvDate > '01/01/2007'. The ADO request would come from the front end app which would know whether it wanted the data from KUK or KUS. How would I get the view to get the data from one as opposed to the other (KUK vs KUS) ?

Is there some other strategy for this situation, say use of connection strings? If anyone has an idea, or knows of an explanation somewhere on the net I'd greatly appreciate it.

Many thanks
Mike Thomas

View 5 Replies View Related

View That Would Output Data From Two Views

Aug 8, 2007

OK,

I have two data tables where depending on the time line item it is, it needs a different join.

So, it's like this:

Table Credit Card
Table Memo

If Credit Card is VISA, join on column A
If Credit Card is MA, join on column B

So, I created two views. One view has all the info joined on column A. The other view has all the info joined on column B.

How do I create a third view that will output all the data from View A and View B without making it into a cartesian product?

I can't change the table structure due to legacy application/data issues.

Thanks!

View 3 Replies View Related

Adding New Data Fiels And Inserting Data

Sep 17, 2004

I have some website work lined up and it involves some simple modifications to a MS SQL 2000 server. What I'll need to do is add some new data fields and insert some data.

I have some experience with databases - MS Access and MySQL, but I have never used or seen MS SQL 2000. My question is, is this a relatively simple thing to do for someone who hasn't used it before? I can do these things quite simply in Access or MySQL, so is MS SQL 2000 going to be any different?

Also, does anyone know of any free tutorials online that would help me out?

Thanks

View 1 Replies View Related

SQL 2012 :: Should Use Views Or Create A Data Mart

Oct 9, 2015

our group is debating whether we should use views or data marts. WE have some huge queries that can have many joins up to 20 in some cases. One part of our group wants to use views to pull this data and another thinks we should create a data mart off an SSIS package and run it early every morning and then have the users access the data directly from there.

I am not really sure how a view would speed things up. If I have 20 users and they all call a view the view is created 20 times is that not correct? Since a view is basically just a stored sql statement (not a stored proc) I am not seeing how this is any more efficient.

View 8 Replies View Related

Recovery :: How To Backup Raw Data Only With Just Views And Tables

Sep 23, 2015

My client has on a physical server (A), the following:

1. MS SQL Server 2008R2
2. MS SQL Server (Reporting Server)

The data base is backed up fully daily to another physical server (B).

What the client would like to do is:

1. Backup just the Raw SQL Data with Tables and Views to Server B every 10 mins

Point to be noted is, there isn't any dedicated storage (NAS or SAN) just local disk storage on the server.

The reason for this is they want to run reports against this data every 10-15 mins...

How and what do I need to do to facilitate this?

View 15 Replies View Related

Packages And Data Source Views Do Not Work?

Jun 16, 2006

Hi,

doing my first steps in SSIS I wanted to copy data from 2 different SQL 2000 database servers to a SQL 2005 Data warehouse. For not having to deploy additional views and procedures to the individual systems I chose to create a Data Source View to create an abstract view on the different data sources. I found out that I can have named queries pointing to the two different data sources in the same view.

1 Project, 2 Data Sources, 1 Data Source View with 3 Named Queries

When I now add a Data Flow Task to the Control Flow how can I specify my DSV as Source for Transformations? I even added both OLEDB Connections to the Connection Manager but the Named Queries from my DSV do not appear at all. I even tried "SELECT from [myNamedQueryFromDSV]" but without success.

The description available at http://msdn2.microsoft.com/en-us/ms403395.aspx is bullshit. There is nothing to expand about the "Connection Manager" in the Data Flow Window. I can add a OLEDB Source as described in the above HOWTO and double click it. But the dropdown field for Connection Manager does offer only the two OLEDB Connections and nothing more. Among the items of the access mode "Tables and Views" the named queries not appear. It does not even work with a homogeneous Data Source View.

How can I make it work? Ain't there a better (working) HOWTO out there on how to enable DSV als Data Flow Task data sources? Do I have to wait for SP2 to solve the problem or is it not possible by intention?

Cheers,
Frank

View 5 Replies View Related

How To Migrate Data From Sybase Views Into Tables

Oct 8, 2015

Is it possible to get SQL Server Migration Assistant to read data from a Sybase view and store it in a SQL table.  My problem is that I have a legacy sybase application that is being decomissioned and I have been asked to migrate the data into SQL Server.  The problem I have is that:

The account I have been provided to connect to the Sybase database does not have select privileges on all the tablesI don't have the sa password for the Sybase database to alter the security. The vendor support contract has expired and it does not appear I have any way to get the sa password

The account I've been given has access to query data in several views even though it does not have access to the underlying tables that the view pulls data from.  Since this is a legacy application whose data is now static, I wonder if it's possible to read the data from the Sybase views and dump it into SQL tables.

View 2 Replies View Related

Data Source Views - Calculated Columns

Feb 7, 2007

Q: How do I use Calculated Columns from a Data Source View in an OLEDB Data Source Adapter.

I took the following steps:

- Created new SSIS project
- Added a Data Source connecting to a SQLServer2005 DB (MyDataSource)
- Added a Data Source View based on MyDataSource (MyDSV)
- Created a Calcualted field to Table Object MyTable (MyCalcField)
- Added a Connection Manager based on MyDSV
- Added Data Flow to Project
- Added OLEDB Source Adapter to Data Flow
- Attempting to Access Calculated Field MyCalcField to be used in Data Flow.

ISSUE: I can't seem to find a way to get the Calculated field to pass through. It's as though this metadata is not available to the Flow.

Anyone have any ideas?

Thanks - MikeyNero

View 6 Replies View Related

Export Data From Views To An Excel File . Help Required .

Apr 9, 2002

Hello everybody..

I have to copy data from a view of a database to an Excel file .
Is there any way of doing it ? Is there any way to import the data from the views to an Excel format ? We have SQL Server 7.0 .

Any information will be of great help to me .

Thank you very much.

Deepa.

View 2 Replies View Related

Tables And Underlying Views W/ Access Data Projects

Dec 3, 2001

I don't know if there is a fundamental problem with what I am trying to do, or am I just having problems setting it up correctly:

I have a SQL server multi-user database. I want my users to connect to this databsase via Access 2000 Data Project. No problem there. The database consists of one main table and several views (based on the office branch that the user works from). For example there is a Chicago view, an Atlanta view, etc. that all extract different records from the same underlying table. I need my users to have FULL ACCESS (select, update, delete) to their respective VIEWS, but they cannot have access to the underlying table. I've tried several configurations and I'm beginning to think that this may not be possible... is that the case?

If it is not possible to grant access to views but not the underlying table, then what are my other options? The objective is to have a multi-user table that each user "owns a piece of" without being able to see the tables or records belonging to their peers. Do I need to setup a table for every office, and somehow link those tables into one main table? How would I avoid duplicate records being entered into the separate tables? Any help would be GREATLY appreciated, as this problem has had me stumped for weeks.

View 2 Replies View Related

Avoid Cross Database Views In Data Warehouse

May 4, 2007

We have a relational database (rd) and a data warehouse (dw). This dw has a table (tw) with all key fields (dimension keys) and metric related (measures) fields. This table is populated with monthly data each month. The tw is joined to various look up views present in the dw to obtain name fields from rd. The DBA wants me to remove the look up views. I now have following 2 options that I can think of –

1)Further de-normalize the tw and store the name fields as well. However, there are two issues with this option –

a.The size of tw will grow tremendously.
b.We are storing monthly data and the values in the name fields may change after some time. Then we will have to put in additional views/objects to obtain the latest name.

2)Using ETL, obtain the copy of rd tables overnight in dw. We will then join tw with these tables and there will no longer be cross database joins. However, this will be a burden on maintenance and support.

As of now these are the possible options I can come up with. Which one would you suggest and why? If you have another option, please let me know.

Thank you all in advance,

sajmera

View 1 Replies View Related

Help With Partitioned Views Or Updating Data From Multiple Tables

Mar 16, 2008

Hi All,

My database's design is set out here. In summary, I'm trying to model a Stock Exchange for a Technical Analysis application written using Visual C++. In order to create the hierachy I'm using a Nested Set Model. I'm now trying to write code to add and delete equities (or, more generically, nodes) to the database using a form presented to the user in my application. I have example SQL code to create the necessary add and delete procedures that calculate the changes to the values in the lft and rgt columns, but these examples focus around a single table, where as my design aggregates rows from multiple tables using UNION ALL:




Code Snippet
CREATE VIEW vw_NSM_DBHierarchy -- Nested Set Model Database Hierarchy
AS
SELECT clmStockExchange, clmLeft, clmRight FROM tblStockExchange_
UNION ALL
SELECT clmMarkets, clmLeft, clmRight FROM tblMarkets_
UNION ALL
SELECT clmSectors, clmLeft, clmRight FROM tblSectors_
UNION ALL
SELECT clmEPIC, clmLeft, clmRight FROM tblEquities_




Essentially, I'm trying to create an updateable view but I receive the error "UNION ALL View is not updatable because a partitioning column was not found". I suspect that my design in wrong or lacks and this problem is highlighting the design flaws so any suggestions would be greatly appreciated.

View 9 Replies View Related

Large Views Vs Multiple Small Views

Sep 6, 2007

Which is more efficient? One large view that joins >=10 tables, or a few smaller views that join only the tables needed for individual pages?

View 1 Replies View Related

Adding Data To Db

May 30, 2006

Hi guys,

this is going to sound like a ridiculous question, but when you are first adding all your records, do you need to add all the foreign key data yourself so that it ties together?

eg. If studentid =1 in first table, then you need to add record for student id in bridging table so that studentid= 1:teacherid=1 and add teacher id=1 if it is not autoincrementing????

Thanks
Cm

View 5 Replies View Related

Using Cube Views As A Data Source To Build Mining Model

Nov 16, 2006

Hi all,

I am new to SQL Server 2005 Analysis Services and would like to use the OLAP Cubes as a datasource to build Mining Model . However i would like to use a particular view of the OLAP cube that i have generated to be used as the datasource for the mining model . I find that i am not able to save the Cube View while browsing the OLAP cube in Business Intelligence Studio. Is there a way i can acheive this requirement.

Any ideas regarding this will be really appreciated.

Thanks & Regards,

Satya

View 6 Replies View Related

Adding Data To More Than One Table

Jul 10, 2006

Hi there,I am currently setting up a registration system where customers can registers their details and the details of the product, using ASP.net and MS SQL.There is a column called customerID in the Custoemrs table, and a column of the same name in the Products table, so that I can have relationships between the tables.For obvious reasons (ie. people that quit half-way through), I want to hold all the information until the end. The ID in the Customer  table is unique, and auto-increasing, and therefore not assigned until the data enters the database.However, I wish to submit information to the Products table at the same time, but what shall I put in for the custoemrID (which hasn't yet been assigned)Thank you in advance for your help,Nathair

View 2 Replies View Related

Adding Data Into A Database

Jan 15, 2006

I'm new at this and wondering if someone would have the heart to help.I want to know how to add data into a database. Here's the details:I have a sqldatasource( sqldatasource1) attached to a database with a table named customers.The table(customers) has one field named 'Name' with datatype varchar(50)I have a textbox (textbox1) and a button (button1)I want to insert the text into textbox1 into my database. how can i do that?

View 3 Replies View Related

Adding Data To Tables?

Mar 6, 2014

I'm currently in an SQL internship, and am running into an issue with a project they've given me. Primarily, he's asking me to try to get a table containing student entry testing information to update with a new column that's supposed to contain the testing dates. This in mind, there is another table that contains testing data, and who's students are grouped by date, the data in each group all coming from the students table. Issue is, I don't know how to get the testing dates from the TestData table into the Students table. There's already a relationship set up between the TestID fields on the TestData table (PK) and the Students table (FK), so I don't think I can set up a new relationship to get it working.

View 1 Replies View Related

Adding Data To A String

Sep 13, 2007

Hi,

I'm not a programmer by trade, so please be gentle with me! I am trying to add or insert data to the beginning of an existing string of data. The string is in one field in a table, with various options seperated by [ ].
An example of the current data is:
[Eye Color:TEST][Hair Color:TEST]
and I would like to add the data [# Persons:1] to the beginning of the string so it looks like this:
[# Persons:1][Eye Color:TEST][Hair Color:TEST]

Can anyone help me with the best way to do this?

View 6 Replies View Related

Adding Data To Columns

May 11, 2006

Hi

I'm am using SQL Server 2005 Express on my home PC.

To practice some of the SQL skills I learned on a course I was recently on, I am trying to build a mini database which I can run some queries from.

I have created some tables and added columns to these tables. However, I cannot find how to add data to these columns.

I'm sure it's pretty simple but I just can't find it! Can anyone help??



Cheers!







View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved