|
|
|
Hi, download bob tubor learning videos from microsoft(c#+sql).
Search something like absolute beginners lessons, download as most as you can, they are free and very helpful.
nelsonpaixao@yahoo.com.br
|
|
|
|
|
Hi All
Im using sql 2000, when im execute the Stored Procedure its gives Cannot resolve collation conflict for concatenation operation but this occur not my local database, when im execute in different server this will occur, my sp is as follows and error comes when im update the table
CREATE procedure dbo.CreateMyTest
(
@ID int output,
@Text varchar(50)=null,
@Description varchar(50)=null
)
as
begin
insert into MyTest
(
Mt_Text,
Mt_Description
)
values
(
@Text,
@Description
)
select @ID = @@identity
end
declare @Timestamp timestamp
select @Timestamp= DateModified from MyTest where Mt_ID=@ID
--Select top 10 cast(Mt_ID as varchar) + master.dbo.fn_varbintohexstr(@Timestamp) from MyTest
update MyTest
set Mt_UniqueText=cast(Mt_ID as varchar) + master.dbo.fn_varbintohexstr(@Timestamp)
where Mt_ID=@ID
Thx
|
|
|
|
|
Hi,
I would guess that your master databes uses different collation than your database. To solve this try to use COLLATE keyword in update statement.
Mika
|
|
|
|
|
Hello
I'm reading an excel file, Now the problem is that when reading it make some cells blanks.
THe reason is that if the first column value is of type text ("0.98ad") then it'll show only data like this format
or when it is numeric (0.8) then it shows only numeric values.
Any idea about it?
Thanks
Syed Shahid Hussain
|
|
|
|
|
The Excel driver determines type of a the column by scanning first few rows. Later it ignores all data not matching this type. I don't now a workaround for this other that preparing the excel file before (convert all data in the workbook to strings) or use an application code to import data (automating Excel or using a component like Aspose.Cells)
Pavel
|
|
|
|
|
Hi.
I am having oracle 9i client in W3k Server, and i like to connect Oracle 7.3 DB server, While connecting from PL/SQL it is showing some error like
ORA-03134: Connections to this server version are no longer supported
But same time i am able to connect from TOAD Software ..
is there any way to open OLEDB connection to that server?
actually i need to move my customer data from Oracle server to SQL server in scheduled manner, for this, i installed Oracle Client 9.2 and SQL server 2k5 Std edition.. While selecting datasource from inport/export wizard as a oracleclient i am getting "OraOledbpus.dll could not be found"
Remaining all .... TOAD is connecting .. that y i am getting confusion .. how is TOAD able to connect .. to the server if .. orcale client is not supporting ? more offen toad is also using same oracle home .
Regards
ranganad kodali ...
Kodali
|
|
|
|
|
Hi,
I would guess that you have multiple Oracle homes installed. The one that TOAD uses is different than the one that OLEDB uses. Check:
- your PATH environment variable to see which home is the first in search order
- your registry settings under HKEY_LOCALMACHINE/Software/Oracle
- ORACE_HOME environment variable
These should give you a clear picture, what client versions are installed. Oracle 7 client uses a different approach in selecting active home than newer clients and this can be confusing sometimes.
Hope this helps,
Mika
|
|
|
|
|
Hi all,
I maintained my database into back up(ex:name.bak),that back up database i do want to read in excel or xml or pdf any format .Is it possible ,if yes what is the steps for it plz help with a quick valuable response.
modified on Wednesday, September 24, 2008 5:20 AM
|
|
|
|
|
Doubtful. It would help if yuou told us what type of database though.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I have six columns.
I want to perform sorting on two columns.
For 1st column I want to perform Ascending and for another column descending.
Believe Yourself™ ™
|
|
|
|
|
select * from TableName order by Column1 asc,Column2 desc
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
This is not working mannn!!!!
It affects only one column.
It consider only 1st order not for another.....
there is no efect for 2nd column...
Believe Yourself™ ™
|
|
|
|
|
Check this[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hi Blue
I have already checked this one this states the same as you told early.
This is not working mannn... it takes for 1st order only.
Believe Yourself™ ™
|
|
|
|
|
Thanks Blue You were correct, I was making mistake at some point.
Actually It is two time sorting.
I m trying on this. If not worked then will ask you.
Thanks for soln.
Believe Yourself™ ™
|
|
|
|
|
Gandalf - The White wrote: If not worked then will ask you.
You are welcome
Gandalf - The White wrote: Thanks for soln.
You are welcome
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
While I don't like to contradict, I have yet to come across a database that doesn't sort as specified. Obviously the records will be sorted by the second column within the order of the first.
SELECT id, lastName, title, age
from #employee ORDER BY
title DESC, age ASC;
gives
id lastName title age
3 Pandit Web Designer 24
4 Anchor Web Designer 27
14 Gibson System Administrator 31
13 Lewis System Administrator 32
so lets start at the beginning. What database are you using? Where is your query and the results?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thanks Bob.
Your answer is correct but I have to go for more sorting on this result.
I m using SQl server 2005.
I have to make sorting on the result I got from this query and that I had to do with single query.
Believe Yourself™ ™
|
|
|
|
|
Sorry, I don't understand what you are trying to do. If you could post some sample data and the result you want maybe I can help further.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
I would like to be able to copy the data in a table from an old version of a sqlce database into the current version of the sqlce database. The datatable must be replaced ie the row ID numbers must remain the same.
I thought that writing the old datatable to to an xml file and then reading that data back in would do the trick but I can't get it to work.
Has anyone achieved what I wish and if so, how did they go about it as I've tried a few alternatives without any luck.
Thanks,
Glen Harvy
|
|
|
|
|
Glen Harvy wrote: The datatable must be replaced ie the row ID numbers must remain the same.
Is the RowID an identity column? If so, disable Identity by setting SET IDENTITY INSERT [Table Name] ON and import the data from the older database.
Glen Harvy wrote: I thought that writing the old datatable to to an xml file and then reading that data back in would do the trick but I can't get it to work.
That statement is devoid of any useful information. Is there any particular error you face?
|
|
|
|
|
Thanks for your help.
Your suggestion would seem to resolve my problem however I am not aware of a way to achieve my end result without using datasets and datatables as in the following code:
string tempDBLocation = MainForm.dataDirectory + @"Temp\";
string tempXMLFile = tempDBLocation + @"tempData.xml";
File.Copy(MainForm.dataDirectory + "my.sdf", MainForm.dataDirectory + "my_org.sdf", true);
File.Copy(tempDBLocation + "my.sdf", MainForm.dataDirectory + "my.sdf", true);
this.configTableAdapter1.Fill(this.adminDataSet1.Config);
this.adminDataSet1.Config.WriteXml(tempXMLFile, XmlWriteMode.WriteSchema);
File.Copy(MainForm.dataDirectory + "my_org.sdf", MainForm.dataDirectory + "my.sdf", true);
File.Delete(tempDBLocation + "my.sdf");
File.Delete(MainForm.dataDirectory + "my_org.sdf");
this.configTableAdapter1.Fill(this.adminDataSet1.Config);
for (int i = 0; i < this.adminDataSet1.Config.Rows.Count; i++)
{
this.adminDataSet1.Config.Rows[i].Delete();
}
this.configTableAdapter1.Update(this.adminDataSet1.Config);
this.adminDataSet1.AcceptChanges();
this.adminDataSet1.Config.ReadXmlSchema(tempXMLFile);
this.adminDataSet1.Config.ReadXml(tempXMLFile);
this.configTableAdapter1.Update(this.adminDataSet1.Config);
this.adminDataSet1.AcceptChanges();
I would prefer not to use ado.net but am unable to locate how to achieve what I want without it.
It seems I have a lot more research to do.
Thanks for your assistance.
Glen Harvy
|
|
|
|
|
Here's my latest effort:
string tempDBLocation = MainForm.dataDirectory + @"Temp\";
string tempXMLFile = tempDBLocation + @"tempData.xml";
string conString = "Data Source=" + tempDBLocation + "my.sdf;Persist Security Info=False";
SqlCeConnection conn = new SqlCeConnection(conString);
SqlCeCommand command = conn.CreateCommand();
conn.Open();
string tableName = "Config";
SqlCeDataAdapter mySqlCeDataAdapter = new SqlCeDataAdapter("select * from " + tableName, conn);
DataTable myDT = new DataTable(tableName);
mySqlCeDataAdapter.Fill(myDT);
myDT.WriteXml(tempXMLFile,XmlWriteMode.WriteSchema);
conn.Close();
conString = Properties.Settings.Default.mycourtsConnectionString.ToString();
SqlCeConnection conn2 = new SqlCeConnection(conString);
SqlCeCommand command2 = conn2.CreateCommand();
conn2.Open();
SqlCeDataAdapter mySqlCeDataAdapter2 = new SqlCeDataAdapter("select * from " + tableName, conn2);
DataTable myDT2 = new DataTable(tableName);
mySqlCeDataAdapter2.Fill(myDT2);
SqlCeCommandBuilder ccmdBuilder = new SqlCeCommandBuilder(mySqlCeDataAdapter2);
for (int i = 0; i < myDT2.Rows.Count; i++)
{
myDT2.Rows[i].Delete();
}
myDT2.ReadXmlSchema(tempXMLFile);
myDT2.ReadXml(tempXMLFile);
command2.CommandText = "SET IDENTITY_INSERT " +tableName + " ON";
command2.ExecuteScalar();
mySqlCeDataAdapter2.Update(myDT2);
conn2.Close();
And of course the Update command now generates this error:
The column cannot contain null values. [ Column name = ID,Table name = Config ]
It makes sense of course but how do I get around this - or must I generate an insert command and do it that way.
Glen Harvy
|
|
|
|