|
Now it works.
I found a sql command for creating user which works with IP and localhost.
Thanks
|
|
|
|
|
Hi Friends I have a problems
I have a table Employee
two fields Name, Age
Name Datatype is varchar()
Age Datatype is Int()
the table look likes this
Name.........Age
Ram.............23
Steve............22
when i swap this two fields using this query"update Employee set Age = Ename,Ename=Age;'
then the error occured
error is "Syntax error converting the varchar value 'Ram' to a column of data type int."
If i changed the datatype of Age is "Int" to "Varchar" then the query runs.
My question is if i don't changed the datatype then how i swap the two fields
Plz help me....
|
|
|
|
|
It seems to me you don't understand the difference between a varchar column versus an int column. A varchar column is used to store text while an int column is used to store numbers.
You cannot do what you are trying do, becuase you cannot put Text into an Integer column, which is why you get the error message 'Syntax error converting the varchar value 'Ram' to a column of data type int'.
Further, I don't see any reason why you would ever want to do this, as it just doesn't make any sense.
Mike Lasseter
|
|
|
|
|
"cast age as varchar" convert data type for select caluse,dot know update
|
|
|
|
|
how about 'Cast age as varchar', not sure
|
|
|
|
|
hi want to find the out puts
There are 2 fields namely name,mark
The following are the values in the field
name....mark
A...........10
A...........10
B...........20
C...........15
C............5
my output should be in the form :-----
name...........mark
A................20
B................20
C................10
Please write a query for this ???
|
|
|
|
|
Parameswar Mal wrote: Please write a query for this ???
Please specify the route between the input and output. It is not obvious.
A seems to add the marks
C substracts one from the other. What are the rules for this? Given that a SQL works on SET based operations with no intrinsic order how do you work out which number should be subtracted from the other.
I don't know what B does as there is only one of them.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Are you trying to find the average or sum?
If C's mark is wrong, then
select A,sum(mark) from tblName group by name order by name
If A's mark is wrong, then
select A,avg(mark) from tblName group by name order by name
Regards,
Arun Kumar.A
|
|
|
|
|
Hi there,
In SQL Server, is there anyway to check other open connections (who else currently connected to the database)?
Thanks.
|
|
|
|
|
sp_who reports all current connections.
The procedure takes its data from the sysprocesses view (SQL Server 2000) or the sys.dm_exec_connections dynamic management view in SQL Server 2005.
|
|
|
|
|
I want to document sql server express database.
Is there any free tool available to document sql server express database?
Could you people provide me link or something?
X
|
|
|
|
|
Here's what I do:
strProcName = name of the query in access that works fine in access itself.
using (OdbcConnection cnn = new OdbcConnection("Dsn=LclPMedicHist;"))
{
using (OdbcCommand cmd = new OdbcCommand (strProcName, cnn))
{
cmd.CommandType = CommandType.StoredProcedure;
OdbcParameter prm;
prm = new OdbcParameter("szName", OdbcType.NText, 50);
prm.Value = Name;
cmd.Parameters.Add(prm);
....
cnn.Open();
cmd.ExecuteNonQuery();
}
}
ExecuteNonQuery() throws an exception:
An unhandled exception of type 'System.Data.Odbc.OdbcException' occurred in System.Data.dll
Additional information: ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Invalid SQL
statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.
I've even tried to use "?" as parameters names, or put "PROCEDURE " directly before query name. It didn't work. Can any one help me please? I'm really a newbie in C# and .Net.
|
|
|
|
|
Hamed Mosavi wrote: cmd.CommandType = CommandType.StoredProcedure;
have you tried using CommandType.Text ? Access only has queries, no stored procs (unless it is an Access Database App that ties in with SQL Server).
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Paul Conrad wrote: have you tried using CommandType.Text?
Yes. No difference. I don't know. perhaps Ado .Net does not support it
I transfered queries into my C# code
I'm still wondering what exactly others use in place of mdb files, when the customer can not afford SQL Server or even does not need that at all(Small databases that has not many users).
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
I have two customer and order table how can i return all customer has no orders.
Thank you
hoho
|
|
|
|
|
i didn't get the clear picture.give the condition by using 'where'
PPK
|
|
|
|
|
your question is not clear. can you please provide table structure and sample data. which will help us in solving your query.
Regards
KP
|
|
|
|
|
Thank you for you reply.
I have customer table and Customer order and there is a PK in the customer table and FK in the order table i need to get all coustomer has no record in the order tables
Thank you
|
|
|
|
|
this can be done using two methods
1. outer join
2. not exists
you can choose one on these two.
Regards
KP
|
|
|
|
|
Hi,
I am writing a program in VB.NET (VS2005 Pro) that essentially simulates an neurology experiment. This program's data shoould consiste of 8 independent tables, each having 13 columns and up to 100,000 rows in each table. To make it simpler, all data will be in string format.
Other requirments:
1. The tables needs to be sortable like a dictioanry where 1 column will act as a key.
2. The user needs to be able to see the data in a tabular format.
3. The data must be held on the user's local machine, not a server and not remotley.
4. Needs to easily be readable by Excel, doesn't matter how. It can convert to an XML file and then somehow be automatically converted to xls.
I am thinking of using a databse becasue I would like to eventually create a login screen to link previous experiment values to a user, but that is not essential. I used dynamic multi-dimensiaonal arrays but find it difficult to work with, and extremley difficult to sort.
I was looking at the idea of using an XML database which will probbaly solve any issues of excel compatability as well as provide support for displaying the information on a website sometime in the future. I can't figure out how this all works.
Can anyone recommend a way to display a large amounts of generated data on a local computer, and almo make it save-able. I also like Oracle's 10g Express thing, but don't know if it would work for my specific problem becasue the cusotmer support people at Oracle don't speak English very well.
Thank You,
Maksim
UCLA, Neurology
|
|
|
|
|
My Best Suggestion is go with XMl.
Regards,
Satips.
|
|
|
|
|
I think performance wise a database would be alot faster. You can sort by column in multiple ways as well as only pull the data you want by using queries. Even if speed isn't a factor, I think you'll find working with databases easier.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
How would it work with ym clients, do they need to install a database software? I want something that is embedded into my aplication that won't require the user to do anything more than install the application.
|
|
|
|
|
Hi ,
As you all know, in sql server, the program must be connected to a server to work properly(execute db, etc.). How can I make my pc work like a server, then connect to it in sql server 2005.
thanks !
|
|
|
|
|
I don't understand the question. Do you mean how do you make you computer a SQL Server? Simple. Install SQL Server.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|