|
Dear all,
Pls help me solve this.
select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code,vessel_desc from D4A_RAW_BLP where vessel_code<>'') order by vessel_code
when i execute this query error occour as below
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Thanks and best regards
|
|
|
|
|
The sub query returns 2 columns but in where clause only one column. The query should be like
select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code from D4A_RAW_BLP where vessel_code<>'') order by vessel_code
|
|
|
|
|
I had to read that twice before it sank in what you are doing. Besides trying to compare 1 field to 2 fields in the subselect (which is only allowed to return 1 field) have you looked at the where clause.
select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code <> ''
This should achieve the same thing without the sub select.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
try this query..........
select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code from D4A_RAW_BLP where vessel_code is not null)
order by vessel_code
Regards:
Ganu Sharma
|
|
|
|
|
Dear All,
I am doing a project where it needs a mechanism as Replication does in Sql 2k or Sql 2k5 where i have to do in some programming language. I am searching for technical aspect of replication.
I would appreciate to have your ideas or any reference which i should be able to get an idea about technical part in replication.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Abdul Rahman Hamidy wrote: any reference
Here[^] it is
I are Troll
|
|
|
|
|
Good Day All
maybe i am missing something here. I have Database A and Database B. These two database have a Stored procedure called "sp_OOPS" and in all the databases the Stored Procedure is Difference. Without any any third party software , is there a way to use Generate Script Wizard to Sync Database B with Database A.
basically when i use this wizard, it can do the if exists and all other nice sql futures, but if the sp definations are not the same it does not alter. Why i am trying to understand , is does the Wizard do that ?
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
A couple of things, do not prefix your procedures with sp_ SQL Server uses this prefix for system procedures and your procs are now being included in that set. If you must prefix I suggest usp
I'm not going to be able to help with the wizard, I very rarely use them as they tend to be limited (have you ever tried writing a wizard). However you can get at the contents of the procedures using the system views. This is what 3rd party software does.
Your expectations are a little unrealistic. The reason 3rd party software exists is because the built in tools are limited. I use SQL Compare to do this.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Good Day Holmes
Thank you for your kind reply. I don't prefix my procedures with sp, this was only an example. i know red-gate SQL Compare can do that.I was just trying to make sure if the SQL Wizard can generate a Alter when the objects have different code.
Thank you once more
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
We are about to change our configuration.
From:
32 bit Server application running on Win 2000 32 bit server
32 bit MS SQL Server 2000 running on Win 2000 32 bit server
To:
32 bit Server application running on virtual (VMWare) Win 2003 64 bit server
64 bit MS SQL Server 2008 running on Win 2008 64 bit server
Furthermore, network resources are upgraded and are, according to tests, showing improved throughput.
The new servers are equipped with 32 GB of RAM, as opposed to the old setup with 3 GB.
But, allthough queries are performed aproximately 4 times faster, fetches are considerably slower. The overall performance of our system is now roughly the same as on the old servers. In fact, they seem to perform a bit slower.
I have narrowed the problem down to fetch time. As mentioned earlier, the network seems to perform much better, so logically I should be able to take that out of the equation. Number crunching is also way faster on the new servers. Disk access on the application server is at least as fast as on the old configuration.
Now I am totally out of reasonable ideas, does any of you guys know any issues about this configuration?
"God doesn't play dice" - Albert Einstein
"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
|
|
|
|
|
Perhaps there is a buffer size issue with the fetch operations. If the buffers are too small, then many fetches will occur and this could slow things down. I'd first look at how the client side software is buffering any fetch operations.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
Too bad then that our client application is Microsoft Axapta 3.0, which means that the client side is sealed from tampering
"God doesn't play dice" - Albert Einstein
"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
|
|
|
|
|
It doesn't allow for any type of configuration at all? That's odd and not exactly customer friendly.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
Well, the idea is to encapsulate database handling to ease change of DBMS (Axapta is not originally created at Microsoft, so it actually supports Oracle too ).
There are some options that the Damgaard/Naviosion/Microsoft guys are exposing though. But the only promising field that I can find, is one labeled "ODBC options" which I presume is meant for additional options to a connection string. I haven't been able to find any documentation on valid ODBC options to SQL Server 2008 though...
"God doesn't play dice" - Albert Einstein
"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
|
|
|
|
|
hi all,
can any one tell me what is an identity column and what is the use of this column in sql table...
Regards,
S.Inayat basha.
|
|
|
|
|
Try using Google: Identity column[^]. This was the first result.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
|
identity automatically increment your column values from seed property specified in identify clause.
exam
create table tbl
( i int
identity(1000,1), name varchar(100))
output
1000
1001
1002
Ganu Sharma
|
|
|
|
|
identity automatically increment your column values from seed property specified in identify clause.
exam
create table tbl
( i int
identity(1000,1), name varchar(100))
output as
1000 table1
1001 table2
1002 table3
Ganu Sharma
|
|
|
|
|
Hi all, I am trying to load data from a array to dataset or any other ways to display the data in a datagridview. if you can please help me in this regard.
thanks
|
|
|
|
|
You didn't say anything about what type of data or whether you need a DataSet for other reasons, but assuming you just want to display the data and nothing else, just run through a loop and add DataGridView rows and put your data in a cell. Simple, but the details of how you do it depend on what language you are using.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Hello Walt Fair,What I want to do is that I have an array of string, how do I put the array data in a grid view by column and row.
thanks
|
|
|
|
|
You need to loop through your array of strings and add a new row to your dataset and populate the fields of your new row with your data from the array
Example (VB.NET)
For idx As Integer = 0 To myArray.Length -1
Dim row as DataRow = myDataSet.Table(0).NewRow
row(0) = myArray(idx)
myDataSet.Rows.Add(row)
Next
Steve Jowett
-------------------------
Real programmers don't use PL/1. PL/1 is for insecure momma's boys who can't choose between COBOL and Fortran.
|
|
|
|
|
Hi guys,
I am doing a FULLTEXT search as shown below
Select t.*,k.[Rank]
From table1 t
Join Containstable(table1, column3, 'abcd|efgh|ijkl|mnop') As k On t.Id = k.[Key]
Order By k.[Rank] DESC
But I want the results to be ranked distinctly. Currently my results are listed something like the below
column1 column2 column3 Rank
1 asdc abcd|efgh|ijkl|mnop 99
2 asdad abcd|efgh|ijkl 99
3 cdsdfc abcd 80
4 efsef abcd|efgh 30
5 asasda abcd|efgh|ijkl 30
6 dsas abcd|efgh|ijkl|mnop 30
Also please note that row1 and row6 are having same values for column3 but the ranks are 99 and 30 respectively.
Thanks in Advance
Jophin
jophin
|
|
|
|
|
I'm not quite sure what you want.
If you want row 6 just below row 1 and so on,
just add another order filter:
Order By t.column3 [DESC/ASC], k.[Rank] DESC
|
|
|
|