|
using System.Data.OleDb;
string conString =@"Provider=Microsoft.JET.OLEDB.4.0;"
+ @"data source=c:\data\Northwind.mdb";
Learning is not a spectator sport. - D. Blocher
|
|
|
|
|
thanks allot every one... done successfully.
|
|
|
|
|
i have 6000 fields that i have to search, the Fields have different attributes, one of the Column is "Attribute_Code" it consist of 6 pairs of numbers ## ## ## ## ## ##, i dont want to tember with the first 5 pairs, but i want to Edit the last pair to All the 6000 receords.
Please Help
Vuyiswa
|
|
|
|
|
If you know the length, which is seems you do, then use substring
So your code would be something like:
update yourtable set attribute_code = substring(attribute_code,1,10)+'put your new number here'
Make sure you do some good testing before you update the whole table. It might be a good idea to make a copy of the table you are planning on updating.
You can check your update by doing something like:
select substring(attribute_code,1,10)+'put your new number here' from yourtable
Hope that helps.
Ben
|
|
|
|
|
Thank you kubben you are a star, your idea realy worked
Vuyiswa
|
|
|
|
|
How to Resize the Identity column values after delete the Row and Insert the New Row.
Mohan Balal
|
|
|
|
|
what do you mean by Resizing Identity column value?
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
If you are asking about reseting the table identity once you have deleted all the rows, then use DBCC CHECKIDENT to reseed or reset Identity column.
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
|
Can anyone tell me having known the table name, how can I get the column names and their datatype?
I am using the ojdbc14 driver to connect to my Oracle10g database.
My table name is 'orders' and I want to know how many columns it has and of what type.
Is there any query for this?
|
|
|
|
|
to know the column names:
select COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ='orders'
all the related information would be present when you use
select * from information_schema.columns
try it out!!
Gautham
|
|
|
|
|
Good !!!!
Pavan Pareta
|
|
|
|
|
Dear All,
I am basically new as far as SQl server 2005 concern.
I want to try out reporting services provided by sql server 2005.
That is make report using sql server 2005 and call that report from web or window application.
Please guide me in doing so or give me some useful link.
Thanks
regards
imran khan
|
|
|
|
|
select distinct(ps.pax_id),ps.barcode_no,ps.modified_date,ps.passport_no,pd.pax_fname+' '+pd.pax_mname+' '+pd.pax_lname as pax_name,ps.fromBranch,ps.passport_status,ps.toBranch,ps.consulate,pv.travel_date,pv.tour_code,ps.entered_date,ps.branch_id,ps.status_type,bm.branch_name from passport_status_tran ps,pass_branch_mst bm,passport_details pd,pax_visarequirments pv where bm.branch_id=pd.branch_id and bm.branch_id='9' and ps.fromBranch='5' and ps.barcode_no=pd.barcode_no and pd.pax_id=pv.pax_id and ps.passport_status='out' and ps.entered_date between '03/24/2007' and '03/27/2007' order by ps.entered_date
This query is running but giving double entry.
Passport No Consulate
XYZ Belgium
XYZ Belgium
|
|
|
|
|
try following,
SELECT distinct * from (
select distinct(ps.pax_id),ps.barcode_no,ps.modified_date,ps.passport_no,pd.pax_fname+' '+pd.pax_mname+' '+pd.pax_lname as pax_name,ps.fromBranch,ps.passport_status,ps.toBranch,ps.consulate,pv.travel_date,pv.tour_code,ps.entered_date,ps.branch_id,ps.status_type,bm.branch_name from passport_status_tran ps,pass_branch_mst bm,passport_details pd,pax_visarequirments pv where bm.branch_id=pd.branch_id and bm.branch_id='9' and ps.fromBranch='5' and ps.barcode_no=pd.barcode_no and pd.pax_id=pv.pax_id and ps.passport_status='out' and ps.entered_date between '03/24/2007' and '03/27/2007')ttemp
order by ttemp.entered_date
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
can anyone tell me why the hell do I get up site down question marks when I try to save Arabic text in Oracle?? it's a simple database application created using VS 2005 wizard.
Please help guyz, I'm desperate
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
declare @query nvarchar(4000)
declare @orderids varchar(50)
declare @mainofficeid int
declare @ordersourceid int
set @orderids='109,110,111'
set @query = 'select' + convert(nvarchar(10),@mainofficeid)+'=lccofficeid from tblorders where orderid in (' + @OrderIds +')' + 'group by lccofficeid, ordersource'
print @query
However, no result is being displayed!
The motto is to execute the query and the result should be copied to a variable!
Gautham
|
|
|
|
|
What exaclty you want to achieve ? What shud the @query expects to hold?
try and explain your problem rather then telling the moto
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
Mubashir,
I have to execute a query and the query would get a value from the from end i.e. a string of ids, using this ids i would form a query and execute it, the outcome would be one row with 2 columns.
Now the values which resulted on the execution of the query should be assigned to two seperate variables
Hope you got my point?
Gautham
|
|
|
|
|
Got it,
use the following as a sample
<br />
declare @val1 varchar(10)<br />
declare @val2 varchar(10)<br />
<br />
select @val1 = YourCOL1, @val2 = YOURCOL2 from YourTable<br />
WHERE ....<br />
YourCOL1 and YOURCol2 are the columns from YourTable. This query will be executed and the reselt from the YourCOL1 will be assigned to @val1 and so on.
Hope it helps
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
I know that but the problem rises when iam trying to form a dynamic query for the same!
i.e. i have a condition to check and that value to be checked is a dynamic value!
Gautham
|
|
|
|
|
as per the code written, should display the select query as it is.
for getting the result by fetching data from table.
set @query = (select convert(nvarchar(10),@mainofficeid) from tblorders where orderid in (109, 110, 111) group by lccofficeid, ordersource)
Regards
KP
|
|
|
|
|
while i am trying to connect a database table in SQL server 2005. i get this Exception.
Under defaul settings SQL server 2005 doesnot allow remote connections.
|
|
|
|
|
Go to the "SQL Server Configuration Manager" and ensure that TCP/IP is turned on for your SQL Server in "SQL Server 2005 Network Configuration"
|
|
|
|
|
do it require administrator previlege to enable TCP/IP
|
|
|
|