|
I don't think I made myself completely clear. I do not have a table in my database with the statistics in them. I have a large query that is building these stats up as I go, for each row. What I want to do is average up these created values once the row is has all but finished. This should be the final column.
The code your provided does the correc thing but I need to know how to get the values from the row I am creating, rather than from a table in the database?
Any ideas?
Thanks
|
|
|
|
|
If you insert you original select statement where I indicated then you will find the the resultset contains all of your columns (thats the A.* bit), followed by your new average.
|
|
|
|
|
i am trying to install sql server 2000 standard Edition on Windows server 2003 but at the configuration time during the installation, Configration error message is shown pointing to "C:\windows\sqlstp.log". when I open this file it contains the following messages in the bottom. and setup exits.
Sql Server Log
##############################################################################
Starting Service ...
SQL_Latin1_General_CP1_CI_AS
-m -Q -T4022 -T3659
Connecting to Server ...
driver={sql server};server=NICOPDB;UID=sa;PWD=;database=master
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
driver={sql server};server=NICOPDB;UID=sa;PWD=;database=master
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
driver={sql server};server=NICOPDB;UID=sa;PWD=;database=master
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
SQL Server configuration failed.
###############################################################################
|
|
|
|
|
Install MDAC 2.8 and then install SQL Server...
Regards,
Smart Boy
Mumbai,
(INDIA)
|
|
|
|
|
Thank You for reply. I will try it out
|
|
|
|
|
hi,
i want to insert few values in a table of which some should be null.
how can i assign the null value at the code level itsellf?
example i have few variables and one of the variable should be a null value and this variable will be later passed as a input parameter to a sp
Gautham
|
|
|
|
|
|
for example i have parameter name param1 for a sp and now normally we have to assign a value to this param1 like param1.value="some value" here i want to give a null value
Hope iam clear!!
Gautham
|
|
|
|
|
Use DBNull.Value in .NET to pass NULL to the database.
|
|
|
|
|
Thanks!
Gautham
|
|
|
|
|
SELECT ProductID,(@BestSpeed / (SELECT AVG(Finalised) FROM Leads WHERE Finalised IS NOT NULL AND ProductID = P.ProductID) * 100) As [Speed],<br />
FROM Products P
The following code retrieves an integer, Product ID, and another field, Speed. How do I know what datatype speed is and how can i change it? It returns a percentage value but currently I am getting, for example :45.5621301775148. Presumably this is a float. I would prefer say Decimal(18,2)
Thanks
|
|
|
|
|
can us Convert function
SELECT ProductID, CONVERT(decimal(18, 2), (@BestSpeed / (SELECT AVG(Finalised) FROM Leads WHERE Finalised IS NOT NULL AND ProductID = P.ProductID) * 100)) As [Speed],
FROM Products P
i've used same on strings for converting to number / date
but not for numeric
|
|
|
|
|
CONVERT(decimal(18, 2), @BestAPR / (SELECT AVG(APR) FROM Leads WHERE APR IS NOT NULL AND ProductID = P.ProductID) * 100) As [APR]
The following seems to work fine. Thanks
|
|
|
|
|
hi ,
well thats what JIT says everytime i run an sql server 05 express sample on my pc.Somehow the code that i write for the dbs i've made runs fine. But every sample ive got , including samples from MSDN give me that error.
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
Could someone perhaps tell me how to enable remote connections!? I'm quite a newbie with sqlserver.
thanks
Gideon
|
|
|
|
|
giddy_guitarist wrote: well thats what JIT says everytime i run an sql server 05 express sample on my pc
If you refer to the SQL Server using some form of network naming convention it will attempt to connect with TCP/IP which is, for security, turned off by default.
e.g. The connection string says: Server=localhost it will attempt to connect via IP address 127.0.0.1 (the loopback adapter)
Try Server=(local) as that will attempt to use a (I think) shared memory connection which doesn't go through any network adapter.
|
|
|
|
|
Take a look at SQL-Server's "Surface Area Configuration" tool. By default SQL-Server 2005 doesn't allow connections from remote machines. You need to explitely change this setting.
|
|
|
|
|
He says he is running "an sql server 05 express sample on my [his] pc". Thus he does not need to open anything to the outside world as all parts are running on the one PC. The question appears to be a false lead, driven by the error message.
|
|
|
|
|
|
giddy_guitarist wrote: This is the connection string in the config file:
connectionString="Data Source=ONTEORA-PH0OA8I;Initial Catalog=Northwind;Integrated Security=True"
I added Server=localhost and Server=(local). Nothing.
Data Source and Server are synonyms. Pick either Data Source or Server and stick with it. I suspect Data Source trumps Server , and because you are referring to your PC by name it is attempting to use a network connection.
|
|
|
|
|
i got the sample working.
Could you just help me out with the following:
I now need a connection string that loads a database thats in the same directory as the .dll , .exe
When i connect to my database in the server explorer and check the property window , the connection string reads:Data Source=.\SQLEXPRESS;AttachDbFilename="E:\Gid\Hotel Management Studio\HotelManager.Core\DataServices\HTLDATA.mdf";Integrated Security=True;User Instance=True
Now , if i use this in SqlConnection() it works fine. Now if i change AttachDbFilename=HTLDATA.mdf. . .and then copy the .exe and the DB into another location . .it doesnt work saying "A dbase with the same name exists or the file cant be open" . So i cant copy my database and use it on the same pc? but then VS itself copies my database from the Project folder into the bin.
I found this site:http://www.connectionstrings.com/?carrier=sqlserver2005
The last section has .NET connection strings , i tried:
Attach a database file on connect to a local SQL Server Express instance
Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;
But this doesnt work too. Whats dbname? I tried HTLDATA(.mdf)
What sring should i use?
|
|
|
|
|
Hi!
I have three Columns. Category, Type and Item. How would I write a stored Procedure to take values in those three columns and combine them into one column?
So instead of having Category = Test, Type = Test and Item = Test, you will have one column with all the values like: Test / Test / Test.
Thanks!
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
SQL Server usage
SELECT category + '/' + type + '/' + item AS colname FROM tblA
will return a "/" seperated string.
|
|
|
|
|
Hallo frends,
I want to take result from stored procedure into my Crystal report but cnt see strored procs
into my database expert of Crystal Report.
I m using vb.net & mysql 5.0 & using ODBC for connection on report which includes DSN that i made already on my machine.
But though i m check on "Show Stored procedure" under database exper->options->DataExplorer.
But not showing any stored proc yet only tables.
How should i call my stored proc in crystal RPt.
Please Tell me soon.
Thanks.
-Regards Priya.
"The Difficult i can do it now...
The Impossible will take a little longer."
|
|
|
|
|
Hi Priya,
Please tell me which version of .Net (2003 or 2005) and Crystal Report version (9 or 10) are you using??
I am currently working .Net 2005 with SQL 2000 as backend. I am not sure the same should work on MySQL.
NOTE 1 point: When adding Stored Procedure in Crystal Report, you should have only one SQL Query.
For example.
CREATE PROCEDURE Sql1
AS
BEGIN
Select * from Table1
-- Select * from Table2 (Note -- this should be commented)
END
Hope you are getting the above example. If not, please reply. I will explain in detail.
- Harini
|
|
|
|
|
Hi,
I am using the sql server for creating the database. I want to create the database which is having userid and password. This I require since I wanted to restrict acces to database and also only authorise user to database can use the userid and password created at time of creation of database.
So how can I create the database which is having userid and password?
Thanks in advance..
MikeRT
|
|
|
|