Howto: Delete Every Second Record If Duplicates
Hi.
I have a "union" table which results of a union of two tables.
Occasionally I could have duplicates, when the same PIN has been added
to both tables, albeit at different Datees/Times, such as:
PINNameAdded Date
100411A7/11/2007 10:12:58 AM
100411A7/17/2007 10:54:23 AM
100413B7/11/2007 10:13:28 AM
100413B7/17/2007 10:54:39 AM
104229C7/6/2007 2:34:13 PM
104231D7/6/2007 2:34:25 PM
104869E6/10/2007 11:59:12 AM
104869E6/22/2007 2:40:18 PM
The question is - how can I delete by queries the first occurence
(time-wise) of these duplicates - i.e. I would want to delete the
first occurence of 100411 (A), the first occurence of 100413 (B), and
the first occurence of 104869 (E) in the example above - records C and
D show only once, so they are fine.
Is there a MsAccess solution ? Is there a SQL-server solution ?
Thank you very much !
Alex
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Howto Add More Column Into Select Record?
hi, good day, i have try following to get the records of the existing folder using : insert into my_table exec xp_dirtree 'c: emp' for example , it give the result subdirectory depth -------------------- another 1 TEST 1 txtfiles 1 anotherSub 2 my question is , can i have add another column maindirectory into this existing result ? and my expected result would like to be as follow main directory subdirectory depth -------------------------------------- another another 1 TEST TEST 1 txtfiles txtfiles 1 TEST anotherSub 2 is it possible ? thanks for guidance
View Replies !
View Related
Delete Duplicates
I'm having trouble figuring out how to delete some _almost_ duplicaterecords in a look-up table. Here's the table:CREATE TABLE [user_fields] ([fKEY] [char] (16) NOT NULL ,[SEQUENCE] [char] (2) NOT NULL ,[FIELD_LABEL] [varchar] (20) NULL ,[FIELD_VALUE] [varchar] (50) NULL ,[EXPORT_DATE] [datetime] NULL ,CONSTRAINT [PK_user_fields] PRIMARY KEY CLUSTERED([fKEY],[SEQUENCE])CONSTRAINT [FK_USRFLD_INV_DOCID] FOREIGN KEY([fKEY]) REFERENCES [OTHER_TABLE] ([PKEY]))Some values:fKEY SEQUENCE FIELD_LABEL FIELD_VALUE----------------------------------------------------------8525645200692B8919Co. ID #8525645200692B8920Co. ID #8525645200692B8921Co. ID #8525645200692B8913Co/Div/Dept8525645200692B8914Co/Div/Dept8525645200692B8915Co/Div/Dept8525645200692B8916Division8525645200692B8917Division8525645200692B8918Division8525645200692B8910Group8525645200692B8911Group8525645200692B8912Group8525645200692B891 HR ContactJOHN NOVAK8525645200692B892 HR ContactJOHN NOVAK8525645200692B893 HR ContactJOHN NOVAK8525645200692B8924Job Location8525645200692B8922Job Location8525645200692B8923Job Location8525645200692B894 Manager8525645200692B895 Manager8525645200692B896 Manager8525645200692B897 Recruiter8525645200692B898 Recruiter8525645200692B899 Recruiter85256D740081C3A413Co. ID #85256D740081C3A414Co. ID #85256D740081C3A410Co/Div/Dept85256D740081C3A49 Co/Div/Dept85256D740081C3A411Division85256D740081C3A412Division85256D740081C3A48 Group85256D740081C3A47 Group85256D740081C3A42 HR ContactDiana Tarry85256D740081C3A41 HR ContactDiana Tarry85256D740081C3A415Job Location85256D740081C3A416Job Location85256D740081C3A43 Manager85256D740081C3A44 Manager85256D740081C3A45 Recruiter85256D740081C3A46 RecruiterNote that fKEY 8525645200692B89 has three of every FIELD_LABEL, andfKEY 85256D740081C3A4 has two. Both, however, should have only one.Unfortunately, when I do a slect ... having count(*) > 1, I have nearly900 different fKEYs with some variation of this problem.It's just not coming to me how to delete the duplicates (except forsequence). I don't care which of the sequence values I keep but as amatter of preference I tried to do something using max(sequence) but,so far, everything I've tried deletes all records for any given fKEY.Help?Thanks.Randy
View Replies !
View Related
Delete Duplicates
Hi i need a query to check a table and if any duplicates of the column called "MessageID" and if there are any duplicates then delete them leaving just the one unique MessageID so i have MessageID, Number, Text. 12,33333333333,hello 12,33333333333,hello - Delete this one 12,33333333333,hello - Delete this one 14,55555555555,new
View Replies !
View Related
Delete Duplicates
Some guy posted that the syntax: delete top 1 from some_table works for deleting duplicates. I am pretty sure that doesnt work but I wanted to check just in case it did because it would be a really easy to delete duplicates. The Yak Village Idiot
View Replies !
View Related
Optimizing A Query To Delete Duplicates
I have a DELETE statement that deletes duplicate data from a table. Ittakes a long time to execute, so I thought I'd seek advice here. Thestructure of the table is little funny. The following is NOT the table,but the representation of the data in the table:+-----------+| a | b |+-----+-----+| 123 | 234 || 345 | 456 || 123 | 123 |+-----+-----+As you can see, the data is tabular. This is how it is stored in the table:+-----+-----------+------------+| Row | FieldName | FieldValue |+-----+-----------+------------+| 1 | a | 123 || 1 | b | 234 || 2 | a | 345 || 2 | b | 456 || 3 | a | 123 || 3 | b | 234 |+-----+-----------+------------+What I need is to delete all records having the same "Row" when there existsthe same set of records with a different (smaller, to be precise) "Row".Using the example above, what I need to get is:+-----+-----------+------------+| Row | FieldName | FieldValue |+-----+-----------+------------+| 1 | a | 123 || 1 | b | 234 || 2 | a | 345 || 2 | b | 456 |+-----+-----------+------------+A slow way of doing this seem to be:DELETE FROM XWHERE Row IN(SELECT DISTINCT Row FROM X x1WHERE EXISTS(SELECT * FROM X x2WHERE x2.Row < x1.RowAND NOT EXISTS(SELECT * FROM X x3WHERE x3.Row = x2.RowAND x3.FieldName = x2.FieldNameAND x3.FieldValue <> x1.FieldValue)))Can this be done faster, better, and cheaper?
View Replies !
View Related
Help On Find Duplicates And Delete Procedure
Hi everybody I need help on finding duplicates and deleting the duplicate record depending on name and fname , deleting the duplicates and leaving only the first one. my PERSON table is this below: ID name fname ownerid id2 1 a b 2 c c 3 e f 4 a b 1 10 5 c c 2 11 I have this query below that returns records 1 and 4 and 2 and 5 since they have the same name and fname select * from ( Select name ,fname, count(1) as cnt from PERSON group by name,Fname ) where cnt > 1 ID name fname ownerid id2 1 a b 4 a b 1 10 2 c c 5 c c 2 11 With this result I need to delete the second record of each group but update the first records with the ownerid and id2 of the second record that would be deleted... I don't know how to proceed with this.. thanks alex
View Replies !
View Related
Delete Syntax To Delete A Record From One Table If A Matching Value Isn't Found In Another
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 Replies !
View Related
Delete Record Based On Existence Of Another Record In Same Table?
Hi All,I have a table in SQL Server 2000 that contains several million memberids. Some of these member ids are duplicated in the table, and eachrecord is tagged with a 1 or a 2 in [recsrc] to indicate where theycame from.I want to remove all member ids records from the table that have arecsrc of 1 where the same member id also exists in the table with arecsrc of 2.So, if the member id has a recsrc of 1, and no other record exists inthe table with the same member id and a recsrc of 2, I want it leftuntouched.So, in a theortetical dataset of member id and recsrc:0001, 10002, 20001, 20003, 10004, 2I am looking to only delete the first record, because it has a recsrcof 1 and there is another record in the table with the same member idand a recsrc of 2.I'd very much appreciate it if someone could help me achieve this!Much warmth,Murray
View Replies !
View Related
Delete Record From SS7
I accidently made a duplicate record and I am unable to delete it. Everytime I try to delete, it gives me an error message saying: Insufficient oe incorrect key coloumn information; too many rows affected by the update. I am unable to delete either records. Is there another way of accomplishing this task. Thanks for your help in advance. Bud
View Replies !
View Related
Delete A Record
Hi, How can i delete a record from a table . table contains approx 3 million data and when i execute a query for delete it give error message from transaction log space problem. Is there any way to stop the log in transaction log and delete the record. thanks
View Replies !
View Related
Cant Delete A Record
Hello i am new to MS SQL. Just moved in from MS Access. I used to program in VB6. mY Question is when i attemp to delete a record the followin error message displays "Key column information is insufficiant or incorrect.Too many rows were affected by the update." I have put the as code for the 'DELETE Record' command button in VB6 as follows. adomain.Recordset.Delete adAffectCurrent Please help me to safley delete a record from the SQL database using VB6.
View Replies !
View Related
Best Way To Delete A Parent Record
whats the best way to delete a parent record? for now what i am doing is to have a special delete page (means not DetailsView/GridView) just to delete parent records so user can see what child records will be deleted too. is the a better way?my code below: The T-SQL Stored ProcedureALTER PROCEDURE dbo.DeleteInventory ( @InventoryID int ) AS DELETE FROM Booking WHERE InventoryID = @InventoryID DELETE FROM Inventory WHERE InventoryID = @InventoryID The code in the Code Behind to execute when a button(delete) click Try Dim temp As Integer = SqlDataSource4.Delete If temp > 0 Then lblDeleteDtatus.ForeColor = Drawing.Color.Blue lblDeleteDtatus.Text = temp & " Records/Rows Deleted." Else lblDeleteDtatus.ForeColor = Drawing.Color.Orange lblDeleteDtatus.Text = "No records Deleted!" End If Catch ex As Exception lblDeleteDtatus.ForeColor = Drawing.Color.Red lblDeleteDtatus.Text = "An Error Occured.<br />" & ex.Message.ToString End Try any better methods anyone wants to share?
View Replies !
View Related
Can't Delete Single Record? HELP!
OK, This one is driving me nuts. I've issued a very simple statement to delete a single row from a table. It appears that when I execute it in SQL Query Analyzer the CPUTime spikes and holds one of the CPUs on the box pegged at 100%. I've let this thing run for over a day, and it's not deleting the one damn record. Any thoughts? :confused: :confused: Here's the command I'm executing: DELETE FROM Invoices WHERE InvoiceID = 153345 Running SELECT * FROM Invoices WHERE InvoiceID = 153345 returns only a single record as it should. InvoiceID is the PK in this table. Any and all help is greatly appreciated. I've rebooted the server, but to no avail. Same thing happens after a reboot. TIA
View Replies !
View Related
Left Only 1 Record... Delete The Others
Hi everyone... I have a problem on deleting a record. I accidentally duplicate the record. I need to delete other records and left only 1 record based on each date and employeenumber. supposing i have a table hrempshiftschedule i have 3 fields... empno, shiftdate, and shifttype sample data... empno shiftdate shifttype 1 1/1/2008 S1 1 1/1/2008 S1 2 1/1/2008 S2 2 1/1/2008 S2 2 1/1/2008 S2 2 1/2/2008 S2 2 1/2/2008 S2 2 1/3/2008 S3 3 1/1/2008 S3 4 1/4/2008 S4 4 1/5/2008 S5 expected output.... empno shiftdate shifttype 1 1/1/2008 S1 2 1/1/2008 S2 2 1/2/2008 S2 2 1/3/2008 S3 3 1/1/2008 S3 4 1/4/2008 S4 4 1/5/2008 S5 pls help and guide me.... thanks RON ________________________________________________________________________________________________ "I won't last a day without SQL"
View Replies !
View Related
Delete Duplicate Record
Hi , How can i delete the duplicate record from a table use Northwind create table Emp (Ecode char(2), Ename char(10)) Insert into Emp(Ecode, Ename) values('A1','A') Insert into Emp(Ecode, Ename) values('A1','A') Insert into Emp(Ecode, Ename) values('A2','B') Insert into Emp(Ecode, Ename) values('A2','B') Insert into Emp(Ecode, Ename) values('A3','C') Insert into Emp(Ecode, Ename) values('A3','C') Insert into Emp(Ecode, Ename) values('A4','D') Insert into Emp(Ecode, Ename) values('A4','D') select * from emp order by Ecode Thanks ASM
View Replies !
View Related
4011 When Trying To Delete Record From Sql Database
Hi i have a very annying problem that i cant seem to solve by myself. I have developed a content managment system for a webpage where people can manage the page. It's almost done except for the fact that i cant seem to delete records from my sql express database. To access the database i use an sql login in my code to delete witchever record is retrived from a querystring in the URL field. Below is a sample of my delete code when a button is pressed. protected void ButtonDelete_Click(object sender, EventArgs e) { string dID = Request.QueryString["dID"]; string myConnectionString = @"Data Source=SRVWEBSQLEXPRESS;Initial Catalog=se;User ID=xx;Password=xx"; SqlConnection myConnection = new SqlConnection(myConnectionString); string myDeleteQuery = "DELETE FROM drift WHERE dID = @dID"; SqlCommand myCommand = new SqlCommand(myDeleteQuery); myCommand.Parameters.AddWithValue("dID", dID); myCommand.Connection = myConnection; myConnection.Open(); myCommand.ExecuteNonQuery(); myCommand.Connection.Close(); Response.Redirect("list.aspx"); } When the i run the code on my development machine located at 10.12.0.80 and the server is located at 10.12.1.65 and this is where the databse is located. The strangest thing is that when i press my deletebutton while debugging in VS2008 on my devmachine the record is deleted! BUT when i run the code live on the server i get an error. See the below log file taken from the windows 2003 server application log. Event Type: InformationEvent Source: ASP.NET 2.0.50727.0Event Category: Web Event Event ID: 1314Date: 2008-04-07Time: 10:26:45User: N/AComputer: SRVWEBDescription:Event code: 4011 Event message: An unhandled access exception has occurred. Event time: 2008-04-07 10:26:45 Event time (UTC): 2008-04-07 08:26:45 Event ID: 8bdda96aeee44448b570891c593bdb3e Event sequence: 242 Event occurrence: 1 Event detail code: 0 Application information: Application domain: /LM/W3SVC/1015505475/Root-1-128520196339603398 Trust level: Full Application Virtual Path: / Application Path: C:wwwwebsite Machine name: SRVWEB Process information: Process ID: 5156 Process name: w3wp.exe Account name: NT AUTHORITYNETWORK SERVICE Request information: Request URL: http://website/cms/drift/editdrift.aspx?dID=19 Request path: /cms/drift/editdrift.aspx User host address: 10.12.1.1 User: webmaster Is authenticated: True Authentication Type: Forms Thread account name: NT AUTHORITYNETWORK SERVICE Could anyone help me solve this problem. Thanks.
View Replies !
View Related
SQL: UPDATE, DELETE Current Record Only
Well, I really messed up. Instead of changing the name of a current company record in a table I changed ALL the company names in the table. Me.CustomerDataSource.SelectCommand = "UPDATE tbl_customers SET company = '" & companyTextBox.Text & "'" So, I need to insert a WHERE clause to fix this. My problem is that I've been searching everywhere for this simple command structure and cannot find anything that specifically addresses a simple way to reference the current record. I tried...Me.CustomerDataSource.SelectCommand = "UPDATE tbl_customers SET company = '" & companyTextBox.Text & "' WHERE recno = @recno" But I get the error: Exception Details: System.Data.SqlClient.SqlException: Must declare the scalar variable "@recno". Can anyone provide this simple query clause?
View Replies !
View Related
Delete Record Selection Question
I'm having trouble with the below sql command. What I'm trying to do is to delete records from tblPhotoHeader table where there are no corresponding child records in tblPhoto. The select statement works correctly, I'm just not sure about how to apply the syntax to correctly select the records in the delete statement. Any help from the experts here would be helpful. Thanks Tom --------------------------------------------------------------------- DELETE FROM tblPhotoHeader WHERE Exists (SELECT tblPhotoHeader.photoid, photoOrderID, tblPhoto.photoType FROM tblPhotoHeader LEFT OUTER JOIN tblPhoto ON tblPhotoHeader.photoID = tblPhoto.photoID WHERE (tblPhotoHeader.photoOrderID = 143) AND (tblPhoto.photoType IS NULL))
View Replies !
View Related
Why Can't I Delete A Record With A Variable In The Querystring?
If I script the SQL statement with a constant, deleting the record from the database works. If I script the SQL statement to delete based on the WHERE clause being a variable name, it will not delete the record. The value being compared in the WHERE clause comes directly from the Sequel database. I have a dropdown box that is filled from the database. The dropdown1.selecteditem.text is placed in a variable. The script is to delete a record from the database where the table.name in the database equals the item name selected from the dropdown box. This querystring does not delete the record from the database: dim queryString As String = "DELETE FROM [Table1] WHERE ([Table1].[name] = 'variableCompareText')" This querystring does delete the recrod from the database: dim queryString As String = "DELETE FROM [Table1] WHERE ([Table1].[name] = 'John')" Why can't I delete a record with a variable in the querystring? Otherwise, you would have to always know in advance which record to specify rather than being deleted dynamically.
View Replies !
View Related
Multiple Record Delete Via Join
Hi, I have a table with a large number of records that I need to delete, before attempt to perform the delete I also archived the records to another table. So I need to delete all of these selected records stored in the archive table from the main table. I can now reference all the records that qualify for the delete in the main table by performing a join on the archive table like so: select * from my_main_table a join my_archive_table b on a.distinct_id=b.distinct_id and a.surrogate_key=b.surrogate_key and a.identifier=b.indentifier So all the records check out to be the ones I'd like to perform a delete on but I just can't figure out how to perform a delete of the records with little or no change to the existing query. Obviously something like this won't work: delete from my_main_table a join my_archive_table b on a.distinct_id=b.distinct_id and a.surrogate_key=b.surrogate_key and a.identifier=b.indentifier Though it would be nice if it did.:D So my question is how would I use the existing query with some modification to delete only the records that this query returns. I've tried selection of records in the main table based on the existing records in the archive table but it can return a higher number of records than what I know is expected. I actually need the join specified to be in place to do it. Can anyone render any assistance on this one??? I would certainly appreciate it. Thanks.
View Replies !
View Related
Why I Can Not Delete Record Rows With OLE DB Interface?
In a C++ project, I implement a component of accessing database with programming in ole db com interface. I delete many rows in following style: IRowsets::RestartPosition( NULL ); IRowsets::MoveNext( ) do { IRowsetsChange :: DeleteRows( DB_NULL_HCHAPTER, 1, &(m_hRow), &nStatus ); }while( IRowSet::MoveNext( 0 ) ); The Problem: In this style, I only delete two records. while use ' IRowSet::MoveNext( 0 ) ' to get the third records, the result is END_OF_RECORDSET. Why I only delete two rows? Why I do not get the third row? Thank you!
View Replies !
View Related
Ms Sql 2005 Delete Record Problem
I'm facing problem when delete a record in the ms sql 2005 . The error message i got is stated below: No rows were deleted A problem occured attempting to delete row 1304. Error: .Net Sql Clint Data Provider Error Message: Possible index corruption detected. Run DBCC CHECKDB. Correct the errors and atempt to delete the row again or press ESC to cancel the changes. just certain record i can not delete and face this problem. i detach the database and attached in the ms sql 2000, and select the same record to delete. there is no problem at all. i wander is it ms sql 2005 bugs? can anyone tell me how to fix it .. how to to use the DBCC CHECKDB ?? thanks alot.... P/s : if i posted at the wrong section just let me know, I'm beginner in this forum here ... thanks...
View Replies !
View Related
Single Statement To Delete Record Into More Tables
Hi , I little question for you ... is it possibile to write a SQL statement to delete records in several tables at the same time? For example if I've two tables involved by join DELETE <...> from Customers A INNER JOIN CustomerProperties B ON A.CustomerID=B.CustomerID I Must use two statement to remove records from both the tables? Thx
View Replies !
View Related
Create Trigger Which Wil Do Event Before Delete A Record..
Hi There, I have created a trigger which supposingly will do event before delete the record from its own table.unfortunately when i try delete the record to test it whether it will do the event (inserting some records to another table), i found that it was not doing the event like i wanted to be. :(the trigger is as below :=======================CREATE TRIGGER TG_D_AGENT ON dbo.AgentFOR DELETEASbegindeclare @vAgentID as numeric,@vAgency as varchar(50),@vUnit as varchar(50),@vAgentCode as varchar(50),@vName as varchar(50),@vIC as varchar(14),@vAddress as varchar(100),@vContactNumber as varchar(50),@vDownlink as varchar(50),@vGSM as varchar(10),@vAM as varchar(10),@vDeleted_date as datetime set @vDeleted_date = convert(datetime, convert(varchar(10) , getdate(),103),103)declare cur_policy_rec CURSOR forselect AgentID,Agency,Unit,AgentCode,[Name],IC,Address,ContactNumber,Downlink,GSM,AM from insertedopen cur_policy_recfetch from cur_policy_rec into @vAgentID,@vAgency,@vUnit,@vAgentCode,@vName,@vIC, @vAddress,@vContactNumber,@vDownlink,@vGSM,@vAM WHILE @@FETCH_STATUS=0BEGIN INSERT INTO [Agent_history] (AgentID,Agency,Unit,AgentCode,Name,IC,Address,Con tactNumber,Downlink,GSM,AM,Deleted_date) VALUES(@vAgentID,@vAgency,@vUnit,@vAgentCode,@vNam e,@vIC,@vAddress,@vContactNumber,@vDownlink,@vGSM, @vAM,@vDeleted_date)fetch from cur_policy_rec into @vAgentID,@vAgency,@vUnit,@vAgentCode,@vName,@vIC, @vAddress,@vContactNumber,@vDownlink,@vGSM,@vAM enddeallocate cur_policy_recend===============================in oracle , i normallly can do something like this...====================================CREATE TRIGGER TG_D_AGENT ON dbo.AgentBEFORE DELETE ON dbo.Agent FOR EACH ROWbeginIs that such thing function like 'BEFORE' in MS SQL SERVER 2000, coz in sql server im not sure they do have or not. Plz someone help me on this...realy appreciated if can!
View Replies !
View Related
-1.#IND Value In A Foat. Unable To Alter Or Delete Record
Somehow I got the value -1.#IND into several records in a table in SQL 2000 DB. I assume that it is a kind of €œNot A Number€?? The problem I am facing now, is that I can not modify the value to a legal value. Nor can I delete the record that holds the number. I get the error message: €œAnother user has modified the contents of this table or view, the database row you are modifying no longer exists in the database. Database error: €˜[Microsoft][ODBS SQL Server Driver][SQL Server] A floating point exception occurred in the user process. Current transaction is cancelled.€? Any suggestions or comments?
View Replies !
View Related
Slective Duplicate Record Delete/Identify Question
HI, I have a table similiar to this: Division Type Section Location ModificationDate ------- ----- ------- -------- --------------- 3 4 2 Los Angeles 2/1/05 3 4 2 New York 2/4/05 4 5 1 Los Angeles 2/4/05 3 4 2 Seattle 2/7/05 4 5 1 Dallas 2/6/05 3 4 4 London 2/3/05 I need to remove duplicate records that have the same division,type,section pair by slected the most recent modification date and keeping the data in the rest of the columns. The results of what I want to do would look like: Division Type Section Location ModificationDate ------- ----- ------- -------- --------------- 3 4 2 Seattle 2/7/05 3 4 4 London 2/3/05 4 5 1 Dallas 2/6/05 Does anyone have idea how I would do something like this? Thanks.
View Replies !
View Related
Delete Record From Table A That Is Not In Table B
I have two tables; Table A id, name 101, jones 102, smith 103, williams 104, johnson 105, brown 106, green 107, anderson Table B id, name, city, state 101, jones, des moine, Idaho 103, williams, Corvallis, Oregon 104, johnson, Grand Forks, North Dakota 105, brown, Phoenix, Arizona 107, anderson, New York, New York I need to delete records from Table A that are not in Table B. My front end is writen in .net and I am using Data Access Layer along with a Business Logic Layer for data interaction. I have tried at least seven variations of joining, right outer join, left outer join resulting in wiping our the entire table or nothing at all; not to mention deleting the record that ought to remain and keeping the record that needs to be deleted! In my BLL I tried to capture the rowsAffected for the deletion by using-without success. Dim rowsAffected As Integer = Adapter.ID_Deletion(ID) If rowsAffected = 1 Then Exit Function Else Return rowsAffected = 1 End If Please help. MsMe.
View Replies !
View Related
Howto Get The Count Value?
Hello!I have a question about the SqlDataSource object.If i make an SqlDataSource with the following sql statement: "SELECT COUNT(id) AS recordCount FROM tblCategory"How do i get the recordCount value to a Variable.Im writing in C#.<asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT COUNT(id) AS recordCount FROM [tblCategory]"></asp:SqlDataSource>
View Replies !
View Related
No Logs - Howto ?
Hello, I would like to avoid any logs. Meaning that logs are cleared ones transactions are executed successfully. Is there any way to achieve this? Thanks for any feedback! Regards, Fabian my favorit hoster is ASPnix : www.aspnix.com !
View Replies !
View Related
HowTo Add ASPNET User?
The objective is to configure on a dev machine. Selecting New Database User is the easy part as the ***ASPNET user can be selected from the drop down listbox. What follows and what to do next is a myriad of choices. What needs to be done next? Is there a step-by-step document somewhere that you can refer?
View Replies !
View Related
Howto Use Joins Instead Of Subqueries?
Hi,Trying to get a grip on the "join" thing :)Up until now, I allways used this kinda method:"(select t1.a from t1 where t1.b in (select t2.ab from t2 where t2.b=0))"How can this be accomplished using joins? And if you have the time pleaseexplain the "bits" :)Thank you.--?TH
View Replies !
View Related
Howto-replication (on Sql Server 2k)
This is my problem: i need to transfer some tables from a db to a laptop; in order to use these tables on the laptop to take an inventory on furniture and equipment in the offices out side the company's building. when taking inventory, at the end i need to verify what was alredy in the tables and what is new (verify changes) and generate a report. later, when the laptop is connected again to the server, update these tables in the server. I've found over Internet about replication, but, don't understand how to use it. Anyway, if someone could show me the way... i'll aprecciate this. :) And sorry for my english...
View Replies !
View Related
Howto Reduce Tempdb
Hello. Can anybody help me with this? I have a sql server 7.0, where tempdb database has a size of 21 Gb and space available is 2Mb less than 21 Gb. How can I shrink, reduce, compact ... it? I have just tried with Backups and truncate log, but nothing Bye, JuanSa.
View Replies !
View Related
HowTo? @ChildObj From @Obj Sp_oacreate
I use sp_oacreate to login I want to use that same object as... VBS: Set obj = CreateObject("MyComAPI.Application") TSQL: exec sp_oacreate 'MyComAPI.Application' @obj output ,1 a bunch of sp_oasetproperty @obj 'e:myfolder..' and sp_oamethod @obj 'login' Then I create a new container to hold the name/value pairs to use the MyComAPI business rules and create or update records. In TSQL, "How to?" do this next step creating a new child container from the first? VBS: set obj2 = obj.newContainer obj2.add "contact", "Test Contact" obj2.add "Address", "123 Any Street" obj.Execute "NewContact" ,obj2 TIA JeffP... cross posted in ms.pub.sqlserver.programming
View Replies !
View Related
|