[RESOLVED]Delete And Insert Into Table Using SP

Apr 23, 2007

hi,
how can I use stored proc to delete all rows from a table (table1) and insert new ones.
for instance.
my query is:
-------------------------------------
select field1, two, three
from table1 innerjoin table2 on etc...
where condition1 and condition2
-------------------------------------
I want to place the result in my table (table1) and everything I run the stored pro I want to delete the content and place the new dataset in the table1?


I hope I'm clear what I'm trying to do.
thank you very much in advance.
P.S please be detailed when explaining.

View 3 Replies


ADVERTISEMENT

Insert Into Table From Another Table RESOLVED

Mar 1, 2007

I want to step through each record in one table and extract a School number and concatenate it to a date and insert it in another table. I get an error abour duplicate keys when I run my sp though. each school number is unique. I want to end up with the key of my new table like this

01/03/07*2232
01/03/07*2253 etc

CREATE PROCEDURE spSM_AddWeeks
@dteWeekEnding nvarchar
as
INSERT INTO tblSM_Meals
(ML_Id)
select @dteWeekEnding +"'*'"SchoolNumber from tblSM_Schools
GO

View 8 Replies View Related

DELETE FROM Table Before INSERT XML

Feb 27, 2008

I like to empty my table before I insert a xml. How can this be done in SSIS?

View 1 Replies View Related

[Resolved] Change Column Value At Time Of Insert

Jan 29, 2008

Prior to insert (into #JobListTable) I need to change the value of the 't2.plant_id' column (from #EquentialJobListTable). This column will have a value of 110, 300 or 320. If 110 then value should be SBGB2, if 300 then values should be RGWP and if 320 value should be RGWP. Is this possible to do?

INSERT#JobListTable
(
job_date,
job_number,
job_phase,
qty_received,
plant_id
)
SELECTt2.job_date,
t2.job_number,
t2.job_phase,
t2.qty_received,
t2.plant_id
FROM#EquentialJobListTable AS t2
LEFT JOIN#JobListTable AS t1 ON t1.job_date = t2.job_date
AND t1.job_number = t2.job_number
AND t1.job_phase = t2.job_phase
WHEREt1.job_date IS NULL

View 2 Replies View Related

Lookup Table Insert, Update, And Delete...

Jan 4, 2005

All,

Just wondering if anyone is aware of a SQL server shareware utility that places a front end on a table to manage insert, update, and delete of rows on a lookup table.

We can certainly write this but before reinventing the wheel I figure I'd ask and see.

Many Thanks,

Isaac

View 14 Replies View Related

Identifying A Table Update / Insert / Delete

Jul 28, 2006

How to find out that a table has changed. For example if a table has 50K rows, and if any update, insert, or delete was made it should be captured without using any trigger. Is it possible to get such information from any of the system table or DMVs?

View 13 Replies View Related

SQL Server 2008 :: Why CDC Returning Insert / Delete When UPDATE A Row In Table

Mar 15, 2013

I am experimenting with using CDC to track user changes in our application database. So far I've done the following:

-- ENABLE CDC ON DV_WRP_TEST
USE dv_wrp_test
GO
EXEC sys.sp_cdc_enable_db
GO

-- ENABLE CDC TRACKING ON THE AVA TABLE IN DV_WRP_TEST
USE dv_wrp_test

[Code] ....

The results shown above are what I expect to see. My problem occurs when I use our application to update the same column in the same table. The vb.net application passes a Table Valued Parameter to a stored procedure which updates the table. Below is the creation script for the stored proc:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

if exists (select * from sysobjects where id = object_id('dbo.spdv_AVAUpdate') and sysstat & 0xf = 4)
drop procedure dbo.spdv_AVAUpdate

[Code] ....

When I look at the results of CDC, instead of operations 3 and 4, I see 1 (DELETE) and 2 (INSERT) for the change that was initiated from the stored procedure:

-- GET CDC RESULTS FOR CHANGES TO AVA TABLE
USE dv_wrp_test
GO
SELECT *
FROM cdc.dbo_AVA_CT
GO

--RESULTS SHOW OPERATION 1 (DELETE) AND 2 (INSERT) INSTEAD OF 3 AND 4
--__$start_lsn__$end_lsn__$seqval__$operation__$update_maskAvaKeyAvaDescAvaArrKeyAvaSAPAppellationID
--0x0031E84F000000740008NULL0x0031E84F00000074000230x02119Test26NULL
--0x0031E84F000000740008NULL0x0031E84F00000074000240x02119Test36NULL
--0x0031E84F00000098000ANULL0x0031E84F00000098000310x0F119Test36NULL
--0x0031E84F00000098000ANULL0x0031E84F00000098000420x0F119Test46NULL

Why this might be happening, and if so, what can be done to correct it? Also, is there any way to get the user id associated with the CDC?

View 7 Replies View Related

RESOLVED RESOLVED An Attempt To Attach An Auto-named Database For File &&<file String&&> Failed &&>&&>&&> But ONLY After SSE Reinstall

Sep 16, 2007

RESOLVED RESOLVED RESOLVED

DOH! When I rebuilt the OS, I changed the data partition ID's, and didn't remember to change them in the connetion strings

Not great, but better than continuing to bang head against wall.

Would like to say to MS appreciators that the VS2005 reinstall actually went quite well, considering.

===========================================================================





I built an app, works fine. Had the development environment working fine (VS2005 (SP0) and SQL Server Express). It had been stable for months, no problem.


Then I had to reinstall XP Pro...(finally threw too many conflicting programs into it, I guess...)


I managed to get VS2005 reinstalled ok. However, when I opened and compiled my existing app in VS2005, using Cassini, I got the dreaded error:

An attempt to attach an auto-named database for file <file string> failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

I also get this error for the compiled copy of the app on the same machine, running on IIS. (Where it also previously worked fine).


The Connection strings are all of the form

connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=(specific file string).MDF;Integrated Security=True;User Instance=True"


I appreciate that there are zillions of posts on this issue. I'm hoping that someone might know why this should happen in this particular case.


The thing that's different about this case is that the app was working fine; I have the app deployed on a demo machine and also on a remote server as well as on the development machine.


The only thing that changed is that there was this fresh install of SQL Server Express.


I tried using >> sp_configure user instances enabled','1';RECONFIGURE <<< in SSMSEE, which took, but didn't help.


So something is different in SSE. Since the app is stable everywhere else, I REALLY don't want to go through and adjust the connection strings...MUCH better to figure out what SSE needs to be happy with the existing connection strings...as it was before.

Any suggestions would be appreciated.

Thanks!

EDIT----TRIED SOME THINGS:




Changed folder and file permissions to allow ASPNET full access to the .mdf's and log files (though never had to do this before on the development machine.) No change...

Can see the table contents within the .mdf through SSMSE, and also through Server Explorer in VS2005.

So because the problem happens with both IIS and Cassini, I'm assuming it's got to be an issue between ASPNET and SSE.

EDIT --- TRIED SOME MORE THINGS:

I dimly remember that when I had this problem before, it was that the error message was too "dumb". It wasn't my file that had the permissions problems, it was that the SSE System Databases had to have permissions with respect to ASPNET.

I tried to set that up but I'm a complete newb on this area, so I don't know if I did it right. In SSMSE I created a Login for MyComputer/ASPNET, and gave it all permissions and roles, and then made it an owner for the four system databases...but no joy.

Any pointers on this last piece would be helpful.

EDIT - MORE INFO

The error details

[SqlException (0x80131904): An attempt to attach an auto-named database for file <filestring>.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +170
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +349
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181

View 1 Replies View Related

[Resolved] Update Table W. Data From Another Table

Jan 28, 2008

I have a sp where I have 2 tables. I have already populated ecah table with data.

Now I need to update Table1 with data from Table2.

Key fields between the 2 tables are job_date, job_number and job_phase.

If the record exists in Table1 (reading Table2) need to update record in Table1 with qty_received from Table2.

If record does not exists in Table1, need to insert record into Table1 with job_date, job_number, job_phase and qty_received from Table2

I am very new to sql and wonder if someone would be so kind to help me out? Thank you.


Table1 ie Target
job_date datetime,
job_number char(15),
job_phase char(15),
qty_delivered decimal(8,2)
qty_received decimal (8,2)

Table2 ie Source
job_date datetime,
job_number char(15),
job_phase char(15),
qty_received decimal(8,2)

View 8 Replies View Related

Problems Using SQL Table In Access RESOLVED

Feb 13, 2007

I have a SQL table where most of the fields are numeric. I have tried to run a query in Access to either make a new Access table or insert the records into an empty Access table. However, it changes some of the numeric fields to text fields. Also if I view the design of the SQL table in Access some of the numeric fields appear as text. If I view it in SQL they are numeric. It is a linked table in the Access database.

View 1 Replies View Related

[Resolved] Drop Table But It's Still In Sysobjects

Dec 26, 2007

Hey all,

Not sure how I did this, but I dropped a table and it still shows up in sysobjects. This breaks a job that rebuilds indexes because the table doesn't exist. I tried recreating and dropping the table, but the extra entry is still there. Would it be okay to just delete the row from sysobjects? This has happened in a 2000 and 2005 db at the same time.

Thanks for any advice.

View 6 Replies View Related

Soft Delete In Table, Why Merge Agent Report Hards Delete On Table ?

Feb 1, 2007

Hi seniors

there are two tables involve in replication let say table1 and replicated table is also rep.table1.

we are not deleting records physically in table1 so only a bit in table1 has true when u want to delete a record but the strange thing is that replication agaent report that this is hard delete operation on table1 so download and report hard delete operation and delete the record in replicated table which is very crucial.

plz let me know where am i wrong and how i put it into right way.

there is no triggers on published tables and noother trigger is created on published table.

regards

Ahmad Drshen

View 6 Replies View Related

Copy And Delete Table With Foreign Key References(...,...) On Delete Cascade?

Oct 23, 2004

Hello:
Need some serious help with this one...

Background:
Am working on completing an ORM that can not only handles CRUD actions -- but that can also updates the structure of a table transparently when the class defs change. Reason for this is that I can't get the SQL scripts that would work for updating a software on SqlServer to be portable to other DBMS systems. Doing it by code, rather than SQL batch has a chance of making cross-platform, updateable, software...

Anyway, because it needs to be cross-DBMS capable, the constraints are that the system used must work for the lowest common denominator....ie, a 'recipe' of steps that will work on all DBMS's.

The Problem:
There might be simpler ways to do this with SqlServer (all ears :-) - just in case I can't make it cross platform right now) but, with simplistic DBMS's (SqlLite, etc) there is no way to ALTER table once formed: one has to COPY the Table to a new TMP name, adding a Column in the process, then delete the original, then rename the TMP to the original name.

This appears possible in SqlServer too --...as long as there are no CASCADE operations.
Truncate table doesn't seem to be the solution, nor drop, as they all seem to trigger a Cascade delete in the Foreign Table.

So -- please correct me if I am wrong here -- it appears that the operations would be
along the lines of:
a) Remove the Foreign Key references
b) Copy the table structure, and make a new temp table, adding the column
c) Copy the data over
d) Add the FK relations, that used to be in the first table, to the new table
e) Delete the original
f) Done?

The questions are:
a) How does one alter a table to REMOVE the Foreign Key References part, if it has no 'name'.
b) Anyone know of a good clean way to get, and save these constraints to reapply them to the new table. Hopefully with some cross platform ADO.NET solution? GetSchema etc appears to me to be very dbms dependant?
c) ANY and all tips on things I might run into later that I have not mentioned, are also greatly appreciated.

Thanks!
Sky

View 1 Replies View Related

Delete Syntax To Delete A Record From One Table If A Matching Value Isn't Found In Another

Nov 17, 2006

I'm trying to clean up a database design and I'm in a situation to where two tables need a FK but since it didn't exist before there are orphaned records.

Tables are:

Brokers and it's PK is BID

The 2nd table is Broker_Rates which also has a BID table.

I'm trying to figure out a t-sql statement that will parse through all the recrods in the Broker_Rates table and delete the record if there isn't a match for the BID record in the brokers table.

I know this isn't correct syntax but should hopefully clear up what I'm asking

DELETE FROM Broker_Rates

WHERE (Broker_Rates.BID <> Broker.BID)

Thanks

View 6 Replies View Related

Allow Single Row Delete From A Table But Not Bulk Delete

Sep 16, 2013

The requirement is: I should allow single row delete from a table but not bulk delete. An audit table should get updated if there is any single delete or single update. So I wrote the triggers as follows: for single and bulk delete

ALTER TRIGGER [dbo].[TRG_Delete_Bulk_tbl_attendance]
ON [dbo].[tbl_attendance]
AFTER DELETE
AS

[code]...

When I try to run the website, the database error I am getting is:Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1.

View 3 Replies View Related

Delete Table And Immediately Crate Table, Error Occur Table Already Exist

May 29, 2008

'****************************************************************************

Cmd.CommandText = "Drop Table Raj"



Cmd.ExecuteNonQuery()


Cmd.CommandText = "Select * Into Raj From XXX"



Cmd.ExecuteNonQuery()

'**************************************************************************



This generates error that Table already exist.

If Wait 1 sec then execute statement then it works fine.



Thanks in Advance

Piyush Verma

View 1 Replies View Related

Delete After Insert

Jun 24, 2008

Using OrderRebate Table.

Have two records getting inserted. All fields are identical except for cd_tp.

If 2 records are inserted I would like the record with cd_tp 3 deleted.

Code below doesn't seem to be working


delete orderrebate
FROM OrderRebate inner join inserted on inserted.ord_type = OrderRebate.ord_type and
inserted.ord_no = OrderRebate.ord_no and inserted.line_seq_no = OrderRebate.line_seq_no
where inserted.ord_type = OrderRebate.ord_type and inserted.ord_no = OrderRebate.ord_no
and inserted.line_seq_no = OrderRebate.line_seq_no and inserted.cd_tp = '3'
END

View 1 Replies View Related

Delete And Insert In The Same Sp

Nov 15, 2005

Here's my sp. Before I insert my new values I want to delete the existing records from the table. Can I do this in the same sp ? If so, could someone tell me the syntax please.

CREATE PROCEDURE [spRB_AddBlockBookingDateRef]

** here Delete * from tblRB_BlockBookingDates

@strBookingDateRef nvarchar(100),
@strRoomRef nvarchar (50),
@strDateRequired datetime

AS

INSERT INTO tblRB_BlockBookingDates(
BB_BookingDateRef,
BB_RoomRef,
BB_DateRequired)


VALUES
(@strBookingDateRef,
@strRoomRef,
@strdateRequired
)
GO

View 5 Replies View Related

Update Or Delete With Insert?

Dec 13, 2007

Hi All,
I have this project I'm working on it's Product Content Management System rewrite. I got to the point of updating the Product By Sku and not sure if I should use UPDATE statement or I should DELETE sections assosiated with the ProductContentID and then re-insert them again? I'm not sure which is more afficient?
I can really do both and it's really not that complicated, the only problem I see with DELETE then INSERT is the ProductContentSectionId in the Sections table is going to grow very fast and I'm a bit concerned about it.
We use SQL Server 2000 and we have about 4 bound tables where we keep the data. The one I'm talking about is the sections table where we keep the actual types of product content like a BoxShot, Description, Key Features and so on...
Thank you in advance!
Tatyana Hughes
 

View 3 Replies View Related

FeedBack After Insert Or Delete

Jan 6, 2008

 
hi all
iwant to make feedback after insert data or delet date Like( the data is sucssfuly way) or(data is delete sucssuse way)
but not alert iwant feedback
thank you

View 4 Replies View Related

Insert And Delete Problem

Feb 23, 2006

hello all i have a problem in deleting and updating records when i configuring my data source i click on advanced button in the configuration datasource and then i check the two boxes to generate insert and update and optimistic concurrency but the problem is these two choices are not active unless there was a primary key in the table i have some tables doesnt have a primary key how i can fix that what should i do to allow insert and delete in these tables.thanks in advance

View 4 Replies View Related

Update, Delete, Insert

Jan 8, 1999

I am trying to update a SQL database with data from a Wang system. The Wang data is dumped to a txt file. I then import it into an update table in SQL via Access. Some of the data is new and some of the data is updated records. At this point I have been trying to create a script to update and add data to a table via the query tool in SQL Then delete data from the update table.

I was able to get the UPDATE and DELETE to work but I have not figured out how to insert new records at the same time? Can I use an IF statement? I will apreciate any help or sample code, Thanks.

UPDATE MemberList
Set Name = NameUpd, Address1 = Address1Upd, Address2 = Address2Upd, City = CityUpd, State = StateUpd, ZipCode = ZipCodeUpd, MemberStatus = MemberstatusUpd
FROM MemberList, MemberListUpd
WHERE MemberList.MemberNumber = MemberListUpd.MemberNumberUpd

INSERT ?

DELETE MemberListUpd

View 2 Replies View Related

Insert And Delete In One Statement

Jan 2, 2007

i am creating an insert based on a select statement -- i need to delete the row from the select statment table after it has been inserted

something like

insert into table_insert(value1, value2)
(select table_exclude_id, value1, value2 from table exclude)
delete from table_exclude where table_exclude_id in "the select statement"

can you do this?

View 4 Replies View Related

Delete/insert Vs Update

Jan 22, 2008

Im trying to keep a mirror image of some data Im getting from Quickbooks.

As the records are inserted into the database I need to check if a record exists and either update or insert a new one.

it seems easier just to delete using the tnxid and reinsert vs updating

my question is if I go

begin

INSERT INTO QBInvoicesQue(100s of feilds)

end


begin

delete from QBInvoices where txnid = @TxnID

end

and there is not matching txnid to delete from will it cause any problems? before going to the insert statement?


begin

INSERT INTO QBInvoices(100s of feilds)

end

View 6 Replies View Related

Update = Delete &&amp; Insert?

Oct 16, 2007

I vaguely recall reading an article that I can no longer find that an update statement is executed as a combination of a Delete and an Insert by SQL server. Does anyone know if this a still a true statement in SQL Server 2005?

Thanks,

-shl

View 10 Replies View Related

Insert And Delete In Cursor

May 1, 2007

I want to do insert and delete in a cursour but it's not working for me can any one check the below code and help me out to solve the problem,



DECLARE @LINKID AS INT

DECLARE @INITCOUNT AS INT

DECLARE @NumberOfDuplicates AS INT

SELECT @InitCount = (SELECT COUNT(*) FROM [SSDTemp])

Declare DedupeDataInSSDTempTableNewCur Cursor For

SELECT LINKID FROM SSD WHERE LINKID IS NOT NULL

OPEN DedupeDataInSSDTempTableNewCur

FETCH NEXT FROM DedupeDataInSSDTempTableNewCur

into @LINKID

WHILE @@FETCH_STATUS = 0

BEGIN

DECLARE @CNT AS INT

SELECT @CNT = COUNT(LINKID) FROM SSD WHERE LINKID=@LINKID

if (@cnt =1) begin

INSERT INTO SSD (

[CallID],

[LinkID], [FirstName], [MiddleInit], [LastName],

[Suffix], [DateOfBirth], [SSN], [PhoneNumber],

[Addr1], [Addr2], [City], [State], [Zip] )

SELECT top 1

[CallID], [LinkID], [FirstName], [MiddleInit],

[LastName], [Suffix], [DateOfBirth], [SSN],

[PhoneNumber], [Addr1], [Addr2], [City], [State], [Zip] from SSDTemp

where linkid = @LINKID



DELETE top 1 from ssdtemp where linkid=@LINKID

end

if (@cnt =0) begin

INSERT INTO SSD (

[CallID],

[LinkID], [FirstName], [MiddleInit], [LastName],

[Suffix], [DateOfBirth], [SSN], [PhoneNumber],

[Addr1], [Addr2], [City], [State], [Zip] )

SELECT top 2

[CallID], [LinkID], [FirstName], [MiddleInit],

[LastName], [Suffix], [DateOfBirth], [SSN],

[PhoneNumber], [Addr1], [Addr2], [City], [State], [Zip] from SSDTemp

where linkid = @LINKID

DELETE top 2 from ssdtemp where linkid=@LINKID of DedupeDataInSSDTempTableNewCur

End

SELECT @NumberOfDuplicates = @InitCount - (SELECT COUNT(*) FROM [SSDTemp])



FETCH NEXT FROM DedupeDataInSSDTempTableNewCur

INTO @LINKID

END

CLOSE DedupeDataInSSDTempTableNewCur

DEALLOCATE DedupeDataInSSDTempTableNewCur

View 2 Replies View Related

Best Practices For Insert/Update/Delete

Jul 24, 2007

 for now, doing a small school project, i find doing SPs for Insert useful, like checking for existing data and not inserting, that might not be the best method, i had advice from here i can use unique constraints instead, then what about update and delete? SPs also? the pros make SPs for everything? currently use dynamically generated SQL from SqlDataSources. for Update / delete. some delete are SPs too...

View 2 Replies View Related

Can't Update, Insert, Or Delete Rows

Oct 20, 2007

I have recently started an ASP.Net application and am having some issues updating, inserting and deleting rows. When I started working with it, I was getting errors because it could not find any update command. Eventually, I figured out how to automatically generate the commands, by configuring my SQLDataSource control and clicking the "advanced" button. Right now though, I have generated the commands, but I still can not insert, update or delete rows. When I attempt to update anything, I recieve an error that says "The data types text and nvarchar are incompatible in the equal to operator." Nowhere in my table do I have any rows that use the datatype "nvarchar", only "text" and "int". I tried switching all of my text columns to "nvarchar(500)", which did not help. I am led to believe that the auto generated SQL procedures are trying to do something behind the scenes that is making my database act up, because even when I delete rows, I get the same exception, so the datatypes cannot be messed up there, because all that the datasource is doing is deleting rows, therefore there is no need to worry about data types. I only get the error when I check the "Use optimistic concurrency" box. When I do not use optimistic concurrency, I can delete, insert, and update rows... but nothing happens. There are no errors, but nothing is deleted, updated or inserted either. Upon postback, nothing has changed. I may upload a copy of the exact exception page, if someone thinks that it may help. Here is the update command that was generated: UPDATE [Record Information] SET [Speed] = @Speed, [Recording Company] = @Recording_Company, [Year] = @Year, [Artist] = @Artist, [Side 1 Track Title] = @Side_1_Track_Title, [Side 1 Track Duration] = @Side_1_Track_Duration, [Side 2 Track Title] = @Side_2_Track_Title, [Side 2 Track Duration] = @Side_2_Track_Duration, [Sleeve Description] = @Sleeve_Description WHERE [Record Database ID] = @original_Record_Database_ID
Apparently no stored procedures exist for any of these operations, and I am unsure why. The "Record Database ID" is my identity column, and is the only field that is (and is supposed to be) uneditable.

View 1 Replies View Related

Advanced (insert, Delete ..) Option Not Available

Feb 18, 2008

Hi,
i want to create a sqldatasource in VWD also with advanced (insert, delete, update) option.
This works fine for 'normal' tables, but when i try to do that with e.g. aspnet_roles table (indicated as vw_aspnet_Roles in dropdownlist of VWD), or aspnet_users table, that advanced option is not available, even when i select all fields.
Why, and how can i solve that?
Thanks
Tartuffe
 

View 1 Replies View Related

SQL Update/Insert/Delete Problem

Nov 13, 2005

Hi,I just upgraded my ASP.NET 2.0 BETA 2 environment to the final release of ASP.NET 2.0 VWD.Once the update was finished, I could open my website without any problems..... Now, I noticed that in the final release, some modifications have been included in the Membership Stored Procedure and other stored procedures. So I created a new database (SQL Express) and added my data again.After re-creating my SQLDataSources, I tryed to enable the Editing and Deleting option in VWD and once I run my web application, it seems when selecting editing and then update, it doesn't work anymore....This is my code :
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IMMOASPNETDBConnectionString %>"
DeleteCommand="DELETE FROM aspnet_test WHERE (testID = @Original_testID)" SelectCommand="SELECT BuyID, BuyNL, BuyFR, Lastupdated FROM aspnet_Buy"
UpdateCommand="UPDATE aspnet_Buy SET BuyNL = @BuyNL, BuyFR = @BuyFR WHERE (BuyNL = @original_BuyID)">
<DeleteParameters>
<asp:Parameter Name="Original_testID" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="BuyNL" />
<asp:Parameter Name="BuyFR" />
<asp:Parameter Name="original_BuyID" />
</UpdateParameters>
</asp:SqlDataSource>
&nbsp;<br />
&nbsp;<br />
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataKeyNames="BuyID" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="BuyID" HeaderText="BuyID" InsertVisible="False" ReadOnly="True"
SortExpression="BuyID" />
<asp:BoundField DataField="BuyNL" HeaderText="BuyNL" SortExpression="BuyNL" />
<asp:BoundField DataField="BuyFR" HeaderText="BuyFR" SortExpression="BuyFR" />
<asp:BoundField DataField="Lastupdated" HeaderText="Lastupdated" SortExpression="Lastupdated" />
</Columns>
</asp:GridView>Can someone help me with this ? What is wrong with the Update command ?Thanks to all,Bart

View 3 Replies View Related

SqlDataSource: Insert, Update And Delete Not Available

Jan 3, 2006

Hello Guys,
 
I’m trying to create a sqlDataSource using the wizard, I can get the select statement, the here clause and the order by clause but when I click on the Advanced button the options to generate the insert, update and delete statements are not available. Does anyone know what am I doing wrong?

View 4 Replies View Related

Insert, Select, Update And Delete

Apr 7, 2006

I've got four pages with in the first page a insert, in the second a select, in the thirth a update and in the fourth a delete statement. First the values of a textbox will be inserted in the database, then the values will be shown in labels and than it is possible to edit or delete the values inserted. Every inserted item belonging to each other has one ID. The follwing values has a second ID etc.
How can I make that possible?? I think that I should pass the ID's between the pages so I'm sure that I edit or delete the values that I want. So insert value 1 in page 1, show with select value 1 in page 2, edit or delete value 1 in page 3 and 4.
Maybe I didn't explain it good enough for you, please tell me then!!
Thanks!!

View 3 Replies View Related

Granting Insert, Delete Permissions

Sep 15, 2000

When granting INSERT, DELETE permissions, is this done for
the logon-id OR for the user associated with the logon-id?

I know you can do this for roles.

View 2 Replies View Related







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