SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Search & Update a record with in the table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tahseenm
Yak Posting Veteran

USA
62 Posts

Posted - 01/24/2013 :  10:08:02  Show Profile  Reply with Quote
How to do a quick search on a particular record with in a table. Let me know the details or the script to get to the record you are looking for out of 29,000 records I would like to go to this particular record in a table to change few things.

Table name is billing.acct and the fields names i am looking is as follows:

accountnumber,finalbillflag,credflag

Thanks and appreciate your quick response.

moetahsen

Edited by - tahseenm on 01/24/2013 12:12:35

James K
Flowing Fount of Yak Knowledge

3705 Posts

Posted - 01/24/2013 :  12:47:19  Show Profile  Reply with Quote
Something like shown below
-- see if the record exists in the table.
select * from billing.acct
where accountnumber = '1234' and finalbillflag = 'F' and credflag = 'N';

-- update columns in the record.
update billing.acct set 
	closeoutdate = '20121231',
	closedby = 'tahseenm'
where accountnumber = '1234' and finalbillflag = 'F' and credflag = 'N';
Go to Top of Page

tahseenm
Yak Posting Veteran

USA
62 Posts

Posted - 01/24/2013 :  15:02:45  Show Profile  Reply with Quote
So I use the second script to update or some changes on it. Let me know.

I need to update the record that has the accountnumber=56073-06, finalbilling=Y, credflag=Y.

Currently the record has finalbilling=N,credflag=N

Let me know. Thanks

moetahsen

Edited by - tahseenm on 01/24/2013 15:04:01
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/25/2013 :  01:32:48  Show Profile  Reply with Quote
quote:
Originally posted by tahseenm

So I use the second script to update or some changes on it. Let me know.

I need to update the record that has the accountnumber=56073-06, finalbilling=Y, credflag=Y.

Currently the record has finalbilling=N,credflag=N

Let me know. Thanks

moetahsen


try it first on test table
it should give you what you've asked for
once happy do it on actual table



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000