I am really lost understanding using SQL Server 2000 with ASP.net Webb apps. If you are dong windows apps, the form builder wizard will either build you a page with a grid for displaying multiple records, or a single record page with text boxes.
All well and good.
With ASP.net web apps, though, you only get the option for making the gred/multiple record page.
So I try to make a page with textboxes to use to update my table in Sequel Server. I do my data binding, and fill my adapter, and viola, the data from my first row appears in the text boxes.
Here is the problem. I have a "Next" button and a "Previous" button that I want to use to move forward or backward through the rows in the table. What code do I put behind the buttons?
I created a windows app and used the dataform wizard to make a single record form. The code it puts behind the "Next" button is
Private Sub btnNavNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNavNext.Click
We are using Microsoft SQL Server 2000 Service Pack 2 running on Windows 2000. We are planning to update service pack from to 2 to SP4...Is it okay? What are the requirements? Will there be side effects in our systems?
I would like to update a varchar field with an update statement that appends information to what is currently stored in the field, for example in the Statement field I may currently have a name (Mark) and I want to add a unique identifier to the end of the name so that it may look like, Markq1572, is there a way to do this in an update statement?
Hi All,I'm a relatively newbie to SQL Server 2000, having come from a MySQLbackground.I'm creating my first Trigger statement on a table, and I'd like toknow how I go about performing an update on the row that was changedwhen the trigger was fired.To explain, I have 2 columns, one which contains a member number, theother which contains a flag that is supposed to indicate whether ornot the member number in the row has changed since the last time thetable was processed for updates.So, whenever the value in the member number field [memnum] is updated,I want to set the flag [igproc] to true.The best I've been able to do is:CREATE TRIGGER [updateignoreprocflag] ON [dbo].[dd_testtable]FOR UPDATEASdeclare @key as intIF UPDATE (memnum)select @key = recid from insertedUPDATE dd_testtable set igproc=1 where recid=@keyThis seems to work, but I'd like to know if there's a better way ofretrieving the recid value of the changed row to pass to the UPDATEstatement? Also, I read somewhere in passing that using SELECTstatements and variable assignments within triggers can cause problemswhen called from other applications; in this case it will either be aweb site using ASP.or an application developed in FOXPRO. I can't findwhere I read this originally, so it's entirely possible I imagined itor misunderstood it, but I'd very much appreciate it if someone couldconfirm whether or not this is the case?Many, many thanks in advance!Much warmth,Murray
Hi allI just ranUPDATE dbo.tbl_forecastedSET update_ref = 0but it only updated the first 10000 records. I'm wondering if anyone cantell me why this is, and can I get around it.I have looked on google and found a few references, but nothing in too muchdetailsthanks in advanceAndy
Hi All, I have a Problem while updating one table data from another table's data using sql server 2000. I have 2 tables named TableA(PID,SID,MinForms) , TableB(PID,SID,MinForms) I need to update TableA with TableB's data using a single query that i have including in a stored procedure.
below is the query that is a part of a sproc .All table fields and values are ok. When the mentioned Sproc. is called in query analyzer it executes well and update all fields of the table used in UPDATE statement . UPDATE Emp_Schedule SET IOS = 0, HoursWorked = @WorkTime, COA =getdate() WHERE (Emp_Id = @EmpID) AND (S_Id = @ShiftId) AND (DT =@DayTime)
PROBLEM arises when i call this procedure from C# code all fields are updated Except the COA(DateTime) field.Whats the problem. SProc runs well both in debug mode and normal mode in query analyzer and do updates the values. But when i call in C# only datetime field COA is not Updated? Plz solve this. THNX IN Advance.
I have taken over the support over a database in sql 2000 that has 10+ remote users that synchronise each day. However it also has 30+ users who are directly updating the data in the live database on the server.
One of these users is entering data directly upon the database on the server but the new rows are being placed in the conflict table somehow!!
Does anybody have any ideas about how this could be happening ?
Is it ok to have users directly updating on the server and users synchronising ?
Hello.I've read many topics about this problem but i couldn't figure it out.I use form where user must insert 2 dates using texboxes.-One is required and other is optional.Sql 2000 is inserting either '20061105' or '2006.11.05' on insert update but select query returns 05.11.2006 on my report. Question 1.How do I insert or update dates from my form where date is entered dd.mm.yyyy to sql 2000 table?question 2. What to do if user left optional texbox date empty.I'm using SP and function with arguments (byval texbox1.text as date, byval texbox2.text as date)and parameters @date1, sqldbtype date =texbox1.text
I am very new to SQL Server 2005. I have created a package to load data from a flat delimited file to a database table. The initial load has worked. However, in the future, I will have flat files used to update the table. Some of the records will need to be inserted and some will need to update existing rows. I am trying to do this from SSIS. However, I am very lost as to how to do this.
i have sql 2005 installed on my personal machine, but our server has sql 2000 on it. the structure of my database was made on the server, but i'm not sure how to update the server copy from my local copy. when i try to export my data from my local machine to the server (or import from my local machine to the server), i get pre-execute errors.
roughly every other week, i'll need to be able to update the server version from my local version, so i'm trying to find the most efficient method. what is the best way to update a 2000 database from a 2005 database? it doesn't matter if i append or overwrite, but i do use identity fields. the error i get when trying to use the import/export wizard is:
- Pre-execute (Error)
Messages
Error 0xc0202009: Data Flow Task: An OLE DB error has occurred. Error code: 0x80040E21. An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". (SQL Server Import and Export Wizard)
Error 0xc0202025: Data Flow Task: Cannot create an OLE DB accessor. Verify that the column metadata is valid. (SQL Server Import and Export Wizard)
Error 0xc004701a: Data Flow Task: component "Destination 3 - ReleaseNotes" (202) failed the pre-execute phase and returned error code 0xC0202025. (SQL Server Import and Export Wizard)
We have oracle linked server created on one of the sql server 2008 standard , we are fetching data from oracle and updating some records in sql server . Previously its working fine but we are suddenly facing below issue.
Below error occurred during process .
OLE DB provider "OraOLEDB.Oracle" for linked server "<linkedservername>" returned message "". Msg 7346, Level 16, State 2, Line 1 Cannot get the data of the row from the OLE DB provider "OraOLEDB.Oracle" for linked server "<linked server name>".
I have an sql server table which serves as a criteria table for my sql server query.
i wish to update the sql server table from the excel worksheet. The intention is to allow the end user to change the values in a specific column in the sql server table via excel.
The table in question has the following fields
SELECT [Cluster] ,[Max_Break_btw] ,[RefD_Max_Break] ,[DischD_Max_Break] ,[MaxReviewPeriods] FROM [databseName].[dbo].[SpellClusterAssum]
I will like to change / update the values in the "[Max_Break_btw]" column.
Hello, i have a question that the sql server 2000 is install in window 2000 server. If i want to update to window 2003. Is that any problem in sql server 2000. I am worry about whether we will have problem after update. What i need to do? Many thanks.
I am in a fix where I cant seem to update my records. I am trying to follow a template for an Event calendar and cant seem to get the update page working correctly. basically the update on the server never occurs but the message is still returned. Very confused is it my stored procedure? Imports System.Data Imports System.Data.SqlClientPartial Class _Default Inherits System.Web.UI.PageProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Bind() End SubSub Bind()Using Conn As New SqlConnection("Data Source=WINSERV;Initial Catalog=EventCalendar;User ID=antonio;Password=xxxx;User Instance=False") Conn.Open()Dim cmd As New SqlCommand("sp_GetEvent", Conn) cmd.CommandType = Data.CommandType.StoredProcedure Dim ParameterID As New SqlParameter("@Event_ID", SqlDbType.Int, 4)ParameterID.Value = Request.QueryString("Event_ID") cmd.Parameters.Add(ParameterID)Dim myDataReader As SqlDataReader myDataReader = cmd.ExecuteReader myDataReader.Read()txtapeDate.Text = myDataReader.Item("apeDate") txtapEvent.Text = myDataReader.Item("apEvent")txtWho.Text = myDataReader.Item("Who") txt_type.Text = myDataReader.Item("_type")txtEvent_ID.Text = myDataReader.Item("Event_ID") myDataReader.Close() Conn.Close() End UsingEnd Sub Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click Dim APEvent As String = txtapEvent.Text Dim Who As String = txtWho.TextDim apeDate As String = txtapeDate.Text Dim Event_ID As Integer = txtEvent_ID.TextDim _type As Integer = txt_type.Text 'add it to the DBUsing Conn As New SqlConnection("Data Source=WINSERV;Initial Catalog=EventCalendar;User ID=antonio;Password=xxxx;User Instance=False") Conn.Open()Dim cmd As New SqlCommand("sp_editSingleEvent", Conn) cmd.CommandType = Data.CommandType.StoredProcedurecmd.Parameters.AddWithValue("@Who", Who) cmd.Parameters.AddWithValue("@apEvent", APEvent)cmd.Parameters.AddWithValue("@apeDate", apeDate) cmd.Parameters.AddWithValue("@_type", _type)cmd.Parameters.AddWithValue("@Event_ID", Event_ID) cmd.Parameters.Add(New SqlParameter("@message", SqlDbType.VarChar, 200))cmd.Parameters("@message").Direction = ParameterDirection.Output cmd.ExecuteNonQuery()Dim sMessage As String = Convert.ToString(cmd.Parameters("@message").Value) Conn.Close() lblMessage.Text = sMessage End Using End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Response.Redirect("MainEvent.aspx")End Sub End Class ===========Stored Procedure==========USE [EventCalendar] GO /****** Object: StoredProcedure [dbo].[sp_EditSingleEvent] Script Date: 06/13/2007 15:15:24 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GOALTER PROCEDURE [dbo].[sp_EditSingleEvent] -- Add the parameters for the stored procedure here @apeDate smalldatetime, @apEvent nvarchar(250), @who nvarchar (50), @Event_ID int, @message nvarchar (200)OUTPUT,@_type int AS Begin Set @Message = 'Hasnt added yet' UPDATE apEvent SET apeDate=@apeDate, apEvent=@apEvent, Who=@Who, _type=@_type WHERE Event_ID = @Event_ID Set @message = 'its added' END
I am trying to write a web application for a Karate Association TMADragons.com, that will allow instructors to log on, access data on their schools and update their files.
I have managed to get a handle on retreiving data and displaying fairly wel with data biding, but I am having a lot of trouble giving them an interface to update data.
What I would like to do is have a checkbox on the the grid, and a button to click to change selected records, then call a different page that displays and updates each selected record, one by one.
Right now, I would like to try anything that would allow remote update of the files through the internet. I have spent about $700 for a stack of manuals, but they all show you how to build an interface to retrieve data, not how to update it.
Can anyone point me to a pratical example I can look at?
There are 2 different SQL Servers, SQLSvr1 and SQLSvr2(both of them are SQL Server 7.0). On SQLSvr1, I have 3 tables and 1 stored procedure and on SQLSvr2, I have 1 table.
Now, I want to know is it possible for me to update table on SQLSvr2 using a stored procedure on SQLSvr1. Assuming I have all rights and permissions on both servers.
I'm reasonably new to MS SQL server, I've mostly been setting up databases and creating ASP Pages to look at them with.
However recently I've been given a fun job and I can't seem to find a way to do it.
The problem is we have 2 servers located on different sites, one is actually doing stuff the other just monitors some equipment and when status chages on the equipment a report is made to a table. The software doing this is bespoke and it would cost a fortune to have changed, what we want to do is have the monitoring server send a copy of the inserted row as they get inserted.
I've tried linking the servers via ODBC (in the linked servers part) but when a trigger i've put on the insert table fires it throws up an error about ANSI NULLS and WARNINGS and nothing happens.
After a look round on the internet I've found reference to using the 'set ANSI_NULLS' on command but this seems to be for stored procedures, even then when i try to execute the stored procedure as they show it still comes back with this error.
Can anyone suggest any other ways of copying the inserted row across?
Both servers are MS SQL but are not on a LAN so I have to refere to them as IP addresses.
Hello again!I think what I need to do should be simple, but it is proving difficult.I am displaying a page with data drawn from three different SQL Server tables. Most of the fields on the page correspond to fields in one of the three tables, and these fields can be updated by the user. I then want to propagate these updates to SQL Server, refill the DataSet, and rebind.What I'm currently doing is basically this. I've set up a separate SqlCommand for this update. I have a ParameterCollection defined for this SqlCommand that includes the key field to be used in my WHERE clause and all the fields I want to update.When the user clicks on the [Save Customer Review] button, I (1) set the values of the parameters to the values of the corresponding screen fields, in most instances using one of the Convert methods so the data being assigned to the parameter has the correct type; (2) open an SqlConnection; (3) do SqlCommand1.ExecuteNonQuery(); (4) close the SqlConnection; (5) fill the DataSet; (6) bind.I've experienced multiple kinds of failure in this process, but the primary kinds of failure I've experienced are these:- The one value I'm actually updating (a text field) doesn't get updated on the database. No other fields are touched.- Two fields with Int values (SQL Server shows them as length 4; does that correspond to Int32?) are set to NULL.- The ExecuteNonQuery complains that I'm not supplying a value for the one field that is type DateTime. (In the SQL Server database, this field is permitted to be NULL, and in the record I'm playing with, it is in fact NULL. However, since TextBox.Value is of type String, I'm having to set it to Nothing [Visual Basic] if the text box is blank.)One thing I don't like about this is that I can't see what values the parameters are taking on as I do my processing, even in the debugger. At least I don't know of any way to examine or watch them. One reason this bothers me is that I have a rather strong suspicion that there's something wrong with the way I've set up the parameters, but I can't tell what's happening to them to confirm that, and I also can't see the SQL that's being generated (or can I?).Any thoughts?Thanks,TimPS Be gentle, please -- this is my first Web application. :-)
Group, I have an ASP.NET web application using the default ASPNETDB that I did in VWD 2005, and deployed to a production server (IIS). I need to make a table addition to the production database (ASPNETDB). I'm trying to use SQL Management Studio to attache the database, but it keeps saying the database is locked by a process. I shut down all the services that would likely be using it, but it's still showing locked. What do I need to shut down to attach the database to make the change? Or is there a better way to do it?
I am relatively new to this platform and am trying to update a table of user information and passwords through a series of SQL commands. We import a new file of users every two hours and I would like to have three SQL statements:
- One to add new users not currently in Users table - One to delete users no longer in our source file - One to update every field (but one or two) for already existing users.
Any help on creating the SQL (as well as where to store it and how to automate it) is greatly appreciated!
I am using ASP.NET 2.0 WebForms and I was trying to use a DataSet to add rows programatically without adding the actual records to the MS SQL Server Databases. Is this possible or should I be doing this another way? DataSet myDS = new DataSet();DataTable myTable = new DataTable("table1");myTable.Columns.Add("col1", typeof(string));myDS.Tables.Add(myTable);myTable.Rows.Add("MyValue"); Thanks.
How do I update and retrieve data which is of type image into/from SQL Server database in Powerbuilder 4.0.06 scripts? I`ve tried using SELECTBLOB and UPDATEBLOB, but it doesn`t work. I wanted to use WRITETEXT, UPDATETEXT and READTEXT in stored procedure, but SQL Server doesn`t allow datatype image to be passed in as a parameter. I also tried using the WRITETEXT directly in Powerbuilder scripts as follows: WRITETEXT tablename.colname :ptr :graphics;
where ptr and graphics are local variables in PB scripts. ptr is supposed to be of type varbinary in SQL Server syntax. However, there is no equivalent datatype in PB. graphics is of type BLOB in PB scripts which is equivalent to image in SQL Server syntax.
Hi all, Please forgive me, but I'm new to MS SQL Server and I have few questions. First of all I'd like to know if there is a way to update one table with the data from another. Let's say I have 2 tables. TableA table contains the voucher numbers; TableB table contains the image numbers. Is there a way to merge Voucher numbers from TableA table to Image numbers in TableB table if we assume that there is a primary key Voucher Number in both tables? If yes- what would be the query structure for that? Please forgive me if you think that this question is silly, I have to say I'm not just new to SQL I'm VERY new to it Thank you in advance.
I had a SQL2000 Server with a simple database. I did an "in place" upgrade to SQL2005 expecting the DB Server and databases to upgrade. However, now when I run SQL Server Management Studio and enter the query:-
Hi,I have a website using a SQL Server database to store all of it's data.Retrieving data and writing basic data back is fine, however, when i goto update one table that has a text field in it the update fails ifthe amount of data being passed to the text field is too large.Is there a way around this or a particular update i should be using?Any information would be greatly appreciated.CheersBj
I'm taking over an SQL Serverdatabase which is often updatedwith data from an Access database.Knowing little about either, thissimple task has become a challenge.I'm told that the previous personused to type some simple SQLcommands and this would updatethe SQL server database but thecommands have been lost and theprevious person is unavailable.The Access database has exactlythe same column names as the SQL-server databaseand it is something simplelike:Control ID Phone Name Address1 Address2Does anyone know the SQL commandsto do this kind of SQL server database update from theabove mentioned Access database?The previous person left an app which connectsthe two databases and leaves a placewhere the SQL commands are to be typed.ThanksTAK
Need to be able to run update queries on DB2 on IBM MF from a Linked Server. Select and Insert queries work but Update and Delete queries don't. DB2 connect is installed and ODBC System dsn's are created for DEV and Production DB2 environments.
The ODBC drivers can be selected when running Imports/Exports but can't be specified through a linked server.
Hi All, I would like to know, how the datetime will be stored in the sqlserver datetime column. Because some time i am giving the date in dd/mm/yyyy and sometime mm/dd/yyyy. while give the date in mm/dd/yyyy works fine but not in the another case. and also while i execute a query on query analyser it shows the datetime in yyyy/mm/dd format. So anyone can please tell me how the dates will be stored in the datetime column of sqlserver database? Thanks in Advance. Regards, Dhanasekaran. G
I am currently running SQL Server 2000 Standard on my production system, and I am looking to upgrade the system to Windows 2000 Adv. Server. I would also like to upgrade SQL Server 2000 Standard to SQL Server 2000 Enterprise to utilize more than 2GB of memory. Can anyone tell me what is the best way to upgrade the system, and please provide some feedback on your experiences with the upgrade. Thanks in advance.
We are experiencing a problem with Sql Server 2000 linking to anAccess 97 file. We have two machines that link to this .mdb file, andwe recently upgraded one to newer hardware, SP3a, MDAC 2.8, etc. Thelink on this upgraded machine no longer works, giving this message:Server: Msg 7399, Level 16, State 1, Line 1OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.[OLE/DB provider returned message: Cannot open a database created witha previous version of your application.]OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'IDBInitialize::Initialize returned 0x80004005: ].The link on the older machine still works. We decided to tryconverting a copy of the file to Access 2000 to see if the newerpatches/drivers/whatever no longer supported 97. We set up a link onboth machines to this file, and they both work. However, on theupgraded machine, the following error is receievedServer: Msg 7399, Level 16, State 1, Line 1OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.[OLE/DB provider returned message: System resource exceeded.]OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'ICommandText::Execute returned 0x80004005: ].when making 1-3 connections to the the linked server, while the oldermachine supports at least 7 simultaneous queries connecting to thelinked server and still hasn't produced that error.Does anyone have any idea if there is a known issue with linking toAccess 97/2000 files under MDAC 2.8, Jet 4.0, etc? Any light anyonecan shine on this subject would be greatly appreciated.