|
If the new values can be expressed by expressions, then you can use an update query to update multiple records and multiple fields.
For example,
Update MyTable Set Price=Price*1.05, ItemVolume=ItemVolume+100 Where Category='Electronics';
Hope this helps. Happy programming!
|
|
|
|
|
What language are you using for your front end? Some languages will support this.
For example, Java supports batch updates so you can loop through all the entries setting the update parameters for each in turn, then do an executeBatch to do the lot in one go. (OK, before anyone points this out, not all JDBC drivers support this.)
C# has something similar, although I've never used it myself. And if you can do it in C#, you can probably do it in VB.NET as well.
|
|
|
|
|
If using T-SQL you can use a join to populate the table with the information.
|
|
|
|
|
|
I want to run a software developed in C# using SQL Server 2005 express.I want to run this program in a different mechine which don't have Visual studio but it has SQL server express.Please help me.
|
|
|
|
|
Create one installer application. You can go for InstallShild or Setup Deployment Project directly from Visual studio. Add the .NET framework in the setup and build the application.
Install the application through your installer. You might ask for configuration data elements(such as username / pass for database) while you install.
|
|
|
|
|
Thank you Abhishek Sur.
I can understand what you are saying.But how can I include SQL srever 2005 express? It is essential to run the application.Some one says that changing the connection string configuration file I can run the application but I want to know the total process in details.
modified on Wednesday, January 6, 2010 1:14 AM
|
|
|
|
|
You are talking about 2 different things, C# is the client you have written and you need to write an installer to deploy that application to the CLIENT.
SQL Server is SERVER software and as such is designed to run on a SERVER unless you are using sql express as an embedded/single user database. A quick search[^] will give you plenty of resources to help with that
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All, I have two tables. I want to avg both number from table A and table B from the same cell.
2 3 4 3 4
Table A
1 2 5 3 1
Table B
I have two tables like above. I want to average from table one cell one and table two cell one then average both number and put into a third table or get the data and use it.
For example,
1.5 2.5 4.5 3 2.5
How do I do this in sql statement .
|
|
|
|
|
You would need a common key column as some SQL programs do not keep the order of the table.
|
|
|
|
|
djj55 wrote: You would need a common key column as some SQL programs do not keep the order of the table.
I am not sure what are you saying.but I do have a column that is comon for for both tables.
|
|
|
|
|
You may need to explain the terminology here because I have no idea what "cell one" means in your question.
If you use the term "field", "record", etc., you can make your question more understandable by others.
As for your question, you can make a query on the union of the two tables to find the averages.
|
|
|
|
|
Sory for the confusion. I should tell you that I am really very very beginer about database.
I will find out how to do union and query it.
thanks.
|
|
|
|
|
Hello, I am looking for a way to find what tables are used within a stored procedure. I have around 300 stored procedures that I would like to know what if any tables are used.
I can script the stored procedures to a file that can be investigated.
Thank you for any leads
djj
|
|
|
|
|
djj55 wrote: I have around 300 stored procedures that I would like to know what if any tables are used.
If it's Sql2005, then you could use the sp_depends [^] procedure to list all the dependencies. It's replaced in Sql2008 with something new, but it would probably still work.
Hope this helps
I are Troll
|
|
|
|
|
Thank you for the reply.
As I am currently working with 2000 sp_depends is the ticket. The problem is getting the output into a table.
Thank you again,
djj
|
|
|
|
|
You're welcome
There are no 'real' options to get the multiple result-tables into a temptable under Sql 2000 that I'm aware of. In Sql2005, you could try using a CLR sproc.
As a hack, perhaps you could execute a DOS-command from SQL? If you can execute isql.exe, then you can pipe the result of the command to a textfile. It would get real messy if you try to parse the resulting textfile using SQL, so it might be easier to execute a small console application that parses it and writes it to the database.
I are Troll
|
|
|
|
|
Thank you, I will look into the "DOS" solution tomorrow. Sometime in the next three months we are upgrading to 2008.
|
|
|
|
|
Hi frd's
I am using windows server 2003 and oracle 10g Express Edition.
Unlike SQL server oracle 10g service is not starting at system start up
Can anybody suggest me a solution for this.
Thanks & Regards,
Anil Chelasani
|
|
|
|
|
Can you check the path "ORACLE_BASE\ORACLE_HOME\database"? There could be an error-log for ORADIM there.
I are Troll
|
|
|
|
|
Hi!
I have a table that contains a Date and Minutes. I want to create a query to group the entries by Date so that instead of seeing more than one entry on a day, you will only see one entry date with the total minutes?
Can anyone shed some light on this issue?
Thank you!!
Illegal Operation
|
|
|
|
|
Try this
Sample Data
declare @t table(dt date, tm int)
insert into @t
select '2010-01-05',15 union all
select '2010-01-05',16 union all
select '2010-01-05',18 union all
select '2010-01-05',36 union all
select '2010-01-05',59 union all
select '2010-01-06',01 union all
select '2010-01-06',20 union all
select '2010-01-07',30 union all
select '2009-12-21',34 union all
select '2009-12-22',12
Query
select dt,CntMins = COUNT(tm),TotalMins = SUM(tm) from @t
group by dt
--order by SUM(tm) desc --[Incase you want to see the result in Descending Order]
Output
dt CntMins TotalMins
2009-12-21 1 34
2009-12-22 1 12
2010-01-05 5 144
2010-01-06 2 21
2010-01-07 1 30
Niladri Biswas
|
|
|
|
|
Group by only the date part of the datetime, modified being the datetime field
GROUP BY CONVERT(DATETIME,Modified,103)
[edit] the above does not work, if you are usiong 2008 the following will work using the new DATE data type.
SELECT COUNT(*)
FROM EquityCounter
GROUP BY CONVERT(DATE,Modified)
If you are using 2005 I would suggest chopping up the string daettime like so:
GROUP BY CONVERT(DATETIME,LEFT(CONVERT(VARCHAR(50),Modified),11))
[/edit]
Still gotta be better than a temp table!
Never underestimate the power of human stupidity
RAH
modified on Tuesday, January 5, 2010 1:16 AM
|
|
|
|
|
Mycroft Holmes wrote: Still gotta be better than a temp table!
The temp table in the answer above was only to provide example data methinks!
|
|
|
|
|
Me didn't look at the details of the answer, just looked at the complexity and shook the head. I don't think Nilandri answered the question which was to group by the date only in a datetime field that has the time component in it.
Never underestimate the power of human stupidity
RAH
|
|
|
|