显示标签为“query”的博文。显示所有博文
显示标签为“query”的博文。显示所有博文

2012年3月27日星期二

float and money Data conversion between ado com and ado dotnet not the same with sqlserve

I am running the same query through the traditional ado com interface and
through dotnet ado. The query is a FOR XML EXPLICIT and in ado com I am
using the streaming capability to retrieve the xml and in dotnet the
ExecuteXmlreader command.
The result for ado com is :
<results><motor.cycle id="177496" ver="1" sum.insured="100000"
model="25089700" cover.type.id="0" make="546" capacity="1000" .....
The result for ado .net and in sql analyzer is :
<motor.cycle id="177496" ver="1" sum.insured="100000.0000" model="25089700"
cover.type.id="0" make="546" capacity="1.000000000000000e+003".....
It is clear that the money fields(sum..insured) and float fields(capacity)
gets converted(implicitly by SQL?) in different ways.
Does anyone know why it is not the same and how to get it the same?
This is most likely an artefact of the XML serialization of the typed values
being done differently by the two providers (for some providers and FOR XML
queries, we are sending binary data over that then gets converted to strings
in the providers).
The ADO.Net serialization is consistent with the server-side serialization:
select cast(1000 as float) as x for XML raw, type
select Cast((select cast(1000 as float) as x for XML raw, type) as
nvarchar(max))
Note that management studio also uses ADO.Net.
If this is problematic, please let me know. Note that I am not sure however,
that we can change it now...
Best regards
Michael
"Eben" <eben@.fspsolutions.com> wrote in message
news:eGKV5vF5FHA.1956@.TK2MSFTNGP09.phx.gbl...
>I am running the same query through the traditional ado com interface and
>through dotnet ado. The query is a FOR XML EXPLICIT and in ado com I am
>using the streaming capability to retrieve the xml and in dotnet the
>ExecuteXmlreader command.
> The result for ado com is :
> <results><motor.cycle id="177496" ver="1" sum.insured="100000"
> model="25089700" cover.type.id="0" make="546" capacity="1000" .....
> The result for ado .net and in sql analyzer is :
> <motor.cycle id="177496" ver="1" sum.insured="100000.0000"
> model="25089700" cover.type.id="0" make="546"
> capacity="1.000000000000000e+003".....
> It is clear that the money fields(sum..insured) and float fields(capacity)
> gets converted(implicitly by SQL?) in different ways.
>
> Does anyone know why it is not the same and how to get it the same?
>

float and money Data conversion between ado com and ado dotnet not the same with sql

I am running the same query through the traditional ado com interface and
through dotnet ado. The query is a FOR XML EXPLICIT and in ado com I am
using the streaming capability to retrieve the xml and in dotnet the
ExecuteXmlreader command.
The result for ado com is :
<results><motor.cycle id="177496" ver="1" sum.insured="100000"
model="25089700" cover.type.id="0" make="546" capacity="1000" .....
The result for ado .net and in sql analyzer is :
<motor.cycle id="177496" ver="1" sum.insured="100000.0000" model="25089700"
cover.type.id="0" make="546" capacity="1.000000000000000e+003".....
It is clear that the money fields(sum..insured) and float fields(capacity)
gets converted(implicitly by SQL?) in different ways.
Does anyone know why it is not the same and how to get it the same?This is most likely an artefact of the XML serialization of the typed values
being done differently by the two providers (for some providers and FOR XML
queries, we are sending binary data over that then gets converted to strings
in the providers).
The ADO.Net serialization is consistent with the server-side serialization:
select cast(1000 as float) as x for XML raw, type
select Cast((select cast(1000 as float) as x for XML raw, type) as
nvarchar(max))
Note that management studio also uses ADO.Net.
If this is problematic, please let me know. Note that I am not sure however,
that we can change it now...
Best regards
Michael
"Eben" <eben@.fspsolutions.com> wrote in message
news:eGKV5vF5FHA.1956@.TK2MSFTNGP09.phx.gbl...
>I am running the same query through the traditional ado com interface and
>through dotnet ado. The query is a FOR XML EXPLICIT and in ado com I am
>using the streaming capability to retrieve the xml and in dotnet the
>ExecuteXmlreader command.
> The result for ado com is :
> <results><motor.cycle id="177496" ver="1" sum.insured="100000"
> model="25089700" cover.type.id="0" make="546" capacity="1000" .....
> The result for ado .net and in sql analyzer is :
> <motor.cycle id="177496" ver="1" sum.insured="100000.0000"
> model="25089700" cover.type.id="0" make="546"
> capacity="1.000000000000000e+003".....
> It is clear that the money fields(sum..insured) and float fields(capacity)
> gets converted(implicitly by SQL?) in different ways.
>
> Does anyone know why it is not the same and how to get it the same?
>

Flattening SQL Query result?

Hey all,

I have two different databases that store the same info. Sometimes the data doesn't match, and I have been asked to come up with a query to find the decrepencies.

That data is an employees payrates for StraightTime OverTime and Double time. The problem is they store the data differently.

System 1 stores it

EmployeeID - Name - StraightTime - OverTime - Doubletime

System 2 Stores it

EmployeeTable:

EmployeeID - Name

RateTable

EmployeeID - Rate - RateType

Id like to return the data in a single row:

EmployeeID - Name - System1StraightTime - System2StraightTime- System1OverTime - System2OverTime ...

I tried Left Joining the System2.RateTable 3x, but it will only return the first join's records, and then the second and third join's records appear ONLY if the the record if also wrong with the first joins rows.

Is there a way to do this in SQL, of do I need to bit the bullet, and run the query 3x, and then assemble them in code with a loop?

Thanks

Eric Wild

You might want to try a FULL JOIN on the System 1 table and the RateTable and then LEFT JOIN that combination to the Employee table ON COALESCE(system1Table.EmployeeID, RateTable.EmployeeID) = EmployeeTable.EmployeeID.

2012年3月22日星期四

Flat file return NULL value

Hi,
I am facing problem while extracting data from flat file through query.

It return NULL value for the column EmpID for the 3rd row ('x')

i have a flat file for eg:

EmpID, EmpName, ParentEmpID
1,test1,10
2,test2,13
x,text3,15

Below mentioned two type of query I tried

1)

SELECT * FROM OPENROWSET('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=C:\','select * from test.txt')


2)

SELECT * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:\;Extended Properties="text;FMT=Delimited"')...test#txt

Pls help me out this issue

If you don't specify a schema.ini file providing mapping of fields and data types then the provider will try to determine the data type based on sampling the data file. Since the first column of two rows have numeric values the provider will treat that column as numeric. This might result in the 3rd row having NULL value in first column because 'x' is invalid. Check out the provider documentation for more details and you can also learn about schema.ini file. Using a schema.ini file you should be able to specify the first column as character or string.|||

Thanks for your reply

my requirement is that from a perticular path i have to read the flat files and insert into a temporary table. In the path contain more than one file and file have no predefined format or order.From the temp table i have to do some process. so i have to read the file as it is.

so through schema.ini is it possible or can you suggest me how to do the same

Thanks
Sunil

|||Man,
If the file don't have predefined format or order, give a dummy order in the ini file & you can have different sections in that, which specifies the which sections belongs to which flat file name.
as in my previous reply, now you may have your .ini file as
"SCHEMA.INI"

[test.txt]
ColNameHeader=True
Format=CSVDelimited
CharacterSet=ANSI
Col1=EmpID Char Width 20
Col2=EmpName Char Width 20
col3=ParentEmpID Char Width 20

[test1.txt]
ColNameHeader=True
Format=CSVDelimited
CharacterSet=ANSI
Col1=EmpID1 Char Width 20
Col2=EmpName1 Char Width 20
col3=ParentEmpID1 Char Width 20

[test2.txt]

ColNameHeader=True

Format=CSVDelimited

CharacterSet=ANSI

Col1=EmpID2 Char Width 20

Col2=EmpName2 Char Width 20

col3=ParentEmpID2 Char Width 20



this file contains the example of three flat file named test.txt , text1.txt. &text2.txt.

Hope this may help you little.

Gurpreet S. Gill|||

Hi Gurpreet,

thanks a lot.
my situation is like i don't know the colname (because flat file is generating daily), in that situation how can we include Col1="colname" Char width 20?
or any other way to do the same

Pls help me..

|||Hi SUNIL
if you do not know the ColName then just follow this

[test.txt]
ColNameHeader=false
Format=CSVDelimited
CharacterSet=ANSI

This will make the column name automatically (in my case it is F1, F2 & F3, may be different in your case, may be you need to set the first line as blank in the flat file).

But please note that if you use the this ini file, it will again leads to the problem of NULL, so some where, i think, you need to make compromise(either the null or make the column name with width).
I will again suggest you to count the number of columns & have the dummy name & set the width for each.
Read more at
http://www.devx.com/tips/Tip/12566
to create quick Schema.ini file.

Gurpreet S. Gill

2012年3月19日星期一

FK Position

Does it make any difference where we define the FKs in a table? I mean, do I speed up the query if I define it as the second field or the last one? What about the other fields, the ones that are not FKs, but are used as filters in a query?

Raul:

In general, none of this makes much practical difference to speed of execution. The two things that do matter are (1) do you have indexes on the foreign table in place that correspond to your foreign key and (2) does use of that index with a specific query also require a bookmark lookup for that specific query. If the foreign key has a correspondence to the clustered index of the other table -- and that is often the case -- then no bookmark lookup is necessary. If the foreign key has correspondence to a non-clustered index of the other table but there are fields in the other table that are referenced and are not part of the non-clustered index then a bookmark lookup will be necessary.

If a query references only a short list of records then the non-clustered index will often get used to optimize the query. However, if the query references a very large number of records in the foreign table the optimizer may "decide" that the cost of performing the random reads necessary to support bookmark lookups is too high. In these circumstances the optimizer will often opt to perform a table scan of the foreign table instead of of an index seek.

Bleah. Somebody please say this in a better way.

|||

Column position is virtually meaningless in defining PK's.

Column position is virtually menaingless except:

1. In UNIQUE and PRIMARY key constraints, and all indexes, order of columns has meaning.

2. In relatively rare cases, order of column conditions in a WHERE clause is involved (and only when the criteria is so large as to make it impossible for SQL Server to check all possible uses in a timely manner)

The position of a column in a table has no little if any bearing on performance, as it is just a representation of what is physically implemented in bits and bytes down in the physical table. If it were advantageous to reorganize the data on the page, the data could be reorganized by the storage engine without you knowing. So rest easy, it should make no difference at all.

2012年3月11日星期日

Fixed position of table at bottom of report problem...

I have a table that just contains text at the bottom, but depending on
the query, it might land anywhere. it always needs to be one inch from
the bottom.
Any help is appreciated.
trinttrint wrote:
> I have a table that just contains text at the bottom, but depending on
> the query, it might land anywhere. it always needs to be one inch
> from the bottom.
> Any help is appreciated.
You can set the location for the absolute position of the table relative to
the position of its container!
You know your page-size...so fill the top- and left-coordinates with the
right values
regards
Frank|||Ok,
That works...but I can't get the top to go higher than one inch from
the top
Frank Matthiesen wrote:
> trint wrote:
> > I have a table that just contains text at the bottom, but depending
on
> > the query, it might land anywhere. it always needs to be one inch
> > from the bottom.
> > Any help is appreciated.
> You can set the location for the absolute position of the table
relative to
> the position of its container!
> You know your page-size...so fill the top- and left-coordinates with
the
> right values
> regards
> Frank|||trint wrote:
> Ok,
> That works...but I can't get the top to go higher than one inch from
> the top
You can set the top margin / lower margin in report-settings for the whole
report to 0
regards
Frank|||I have a similar issue with absolute positioning. I have a table and a text
box in a report. The textbox should be at the bottom always. The table can
span any number of pages. In this case, fixing the left and top locations is
not working. Can you please suggest me a solution.

2012年3月9日星期五

Fix legacy data - Missing primary key + duplication record + large table

We have a large table which is very old and not much ppl take care about, recently there is a performance problem from the report need to query to this table. Eventally we find that this table have primary key missing and there is duplicate data which make "alter table add primary key" don't work

Besides the data size of this table require unacceptable time to execute something like "insert into new_table_with_pk from select distinct * from old table"

Do you have any recommendation of fixing this? As the application run on oracle , sybase and sql server, is that cross database approace will work?How big is ur table?.have u tried to create non clustered index on the field(s) of the tables which ur report using in filter condition.U have to do this modification when ur database have less load.|||How big is ur table?.have u tried to create non clustered index on the field(s) of the tables which ur report using in filter condition.U have to do this modification when ur database have less load.

It is about 2 millions rows. We haven't create non clustered index as we like to remove duplication and create primary key. So you mean first create index then do [insert into new_table from select distinct * from old_table]?|||first of all 2m records is not that big.distinct keyword is the killer here,it will affect the perfomance of ur query
Some options are,

change ur database option to 'true' for 'select into/bulkcopy' before u doing select * into.

exec sp_dboption 'urdatabase','select into/bulkcopy',true

this will improve the perfomance of the query 'select into' .

u should try checksum function in sql to remove duplicate.
before that add new column in exist table with identity,primary key

alter table urtable add [id] int identity(1,1)
CONSTRAINT id_pk PRIMARY KEY

-- select checksumvalues
eg:count duplicate in city,state,zip,contract in authors table.And delete duplicates

use pubs
go
delete authors from (
select max(au_id) as au_id,checksumvalue from
(
select au_id,au_lname,checksum(city,state,zip,contract) as checksumvalue from authors
) as t group by checksumvalue
having count(*)>1
) as t1 where authors.au_id=t1.au_id and authors.au_lname=t1.au_lname
--Note u should compare atleast one column from duplicate columns in where --clause(because checksum functiont is not 100% acuurate) as u can see , I --used 'au_lname' field in the above query

Same way u should compare with ur new [id] column which u created.



finally u have to build index on that table for better perfomance.

come back to me,if have doubts on how to remove duplicates using checksum function. try to put tables DDL also.


NB: dont forgot change back database option to,

exec sp_dboption 'urdatabase','select into/bulkcopy',false

after finish this job.

2012年3月7日星期三

First(), Last(0 function

Hello,
I have this query in access and I woul like to convert it to SQL.
--
SELECT KEYC.ProvID, Last(DIMAGE.ID) AS LastOfID
FROM DIMAGE INNER JOIN KEYC
ON DIMAGE.ProvID = KEYC.ProvID
WHERE (((KEYC.PlanID)=10072 Or (KEYC.PlanID)=10125) AND
((DIMAGE.Type)="ATT" Or (DIMAGE.Type)="A00" Or (DIMAGE.Type)="ATTST"))
GROUP BY KEYC.ProvID;
--
the problem here is the Last function. I am running SQL 7 and it returns
with "'Last' is not a known function."
Any sugestions?
-ScottScott,
Try MIN() and MAX().
HTH
Jerry
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:u29xm06vFHA.2556@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I have this query in access and I woul like to convert it to SQL.
> --
> SELECT KEYC.ProvID, Last(DIMAGE.ID) AS LastOfID
> FROM DIMAGE INNER JOIN KEYC
> ON DIMAGE.ProvID = KEYC.ProvID
> WHERE (((KEYC.PlanID)=10072 Or (KEYC.PlanID)=10125) AND
> ((DIMAGE.Type)="ATT" Or (DIMAGE.Type)="A00" Or (DIMAGE.Type)="ATTST"))
> GROUP BY KEYC.ProvID;
> --
> the problem here is the Last function. I am running SQL 7 and it returns
> with "'Last' is not a known function."
> Any sugestions?
> --
> -Scott
>|||Excellent...That worked
Thanks
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:%23fY9216vFHA.464@.TK2MSFTNGP15.phx.gbl...
> Scott,
> Try MIN() and MAX().
> HTH
> Jerry
> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> news:u29xm06vFHA.2556@.TK2MSFTNGP15.phx.gbl...
returns[vbcol=seagreen]
>|||Be aware that although you can use MAX or MIN to avoid the syntax error, you
might not get the same behavior as the original Access query. MAX/MIN will
suffice if your intent is to get an arbitrary value from the grouping.
However, since FIRST and LAST aggregate functions return values based on the
chronological order if insertion, you'll need a datetime or identity column
along with a subquery to emulate those functions in Transact-SQL.
Hope this helps.
Dan Guzman
SQL Server MVP
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:O%23kYnJ7vFHA.3860@.TK2MSFTNGP09.phx.gbl...
> Excellent...That worked
> Thanks
> "Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
> news:%23fY9216vFHA.464@.TK2MSFTNGP15.phx.gbl...
> returns
>

First(), Last(0 function

Hello,
I have this query in access and I woul like to convert it to SQL.
SELECT KEYC.ProvID, Last(DIMAGE.ID) AS LastOfID
FROM DIMAGE INNER JOIN KEYC
ON DIMAGE.ProvID = KEYC.ProvID
WHERE (((KEYC.PlanID)=10072 Or (KEYC.PlanID)=10125) AND
((DIMAGE.Type)="ATT" Or (DIMAGE.Type)="A00" Or (DIMAGE.Type)="ATTST"))
GROUP BY KEYC.ProvID;
the problem here is the Last function. I am running SQL 7 and it returns
with "'Last' is not a known function."
Any sugestions?
-Scott
Scott,
Try MIN() and MAX().
HTH
Jerry
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:u29xm06vFHA.2556@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I have this query in access and I woul like to convert it to SQL.
> --
> SELECT KEYC.ProvID, Last(DIMAGE.ID) AS LastOfID
> FROM DIMAGE INNER JOIN KEYC
> ON DIMAGE.ProvID = KEYC.ProvID
> WHERE (((KEYC.PlanID)=10072 Or (KEYC.PlanID)=10125) AND
> ((DIMAGE.Type)="ATT" Or (DIMAGE.Type)="A00" Or (DIMAGE.Type)="ATTST"))
> GROUP BY KEYC.ProvID;
> --
> the problem here is the Last function. I am running SQL 7 and it returns
> with "'Last' is not a known function."
> Any sugestions?
> --
> -Scott
>
|||Excellent...That worked
Thanks
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:%23fY9216vFHA.464@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
> Scott,
> Try MIN() and MAX().
> HTH
> Jerry
> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> news:u29xm06vFHA.2556@.TK2MSFTNGP15.phx.gbl...
returns
>
|||Be aware that although you can use MAX or MIN to avoid the syntax error, you
might not get the same behavior as the original Access query. MAX/MIN will
suffice if your intent is to get an arbitrary value from the grouping.
However, since FIRST and LAST aggregate functions return values based on the
chronological order if insertion, you'll need a datetime or identity column
along with a subquery to emulate those functions in Transact-SQL.
Hope this helps.
Dan Guzman
SQL Server MVP
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:O%23kYnJ7vFHA.3860@.TK2MSFTNGP09.phx.gbl...
> Excellent...That worked
> Thanks
> "Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
> news:%23fY9216vFHA.464@.TK2MSFTNGP15.phx.gbl...
> returns
>

First(), Last(0 function

Hello,
I have this query in access and I woul like to convert it to SQL.
--
SELECT KEYC.ProvID, Last(DIMAGE.ID) AS LastOfID
FROM DIMAGE INNER JOIN KEYC
ON DIMAGE.ProvID = KEYC.ProvID
WHERE (((KEYC.PlanID)=10072 Or (KEYC.PlanID)=10125) AND
((DIMAGE.Type)="ATT" Or (DIMAGE.Type)="A00" Or (DIMAGE.Type)="ATTST"))
GROUP BY KEYC.ProvID;
--
the problem here is the Last function. I am running SQL 7 and it returns
with "'Last' is not a known function."
Any sugestions?
--
-ScottScott,
Try MIN() and MAX().
HTH
Jerry
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:u29xm06vFHA.2556@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I have this query in access and I woul like to convert it to SQL.
> --
> SELECT KEYC.ProvID, Last(DIMAGE.ID) AS LastOfID
> FROM DIMAGE INNER JOIN KEYC
> ON DIMAGE.ProvID = KEYC.ProvID
> WHERE (((KEYC.PlanID)=10072 Or (KEYC.PlanID)=10125) AND
> ((DIMAGE.Type)="ATT" Or (DIMAGE.Type)="A00" Or (DIMAGE.Type)="ATTST"))
> GROUP BY KEYC.ProvID;
> --
> the problem here is the Last function. I am running SQL 7 and it returns
> with "'Last' is not a known function."
> Any sugestions?
> --
> -Scott
>|||Excellent...That worked
Thanks
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:%23fY9216vFHA.464@.TK2MSFTNGP15.phx.gbl...
> Scott,
> Try MIN() and MAX().
> HTH
> Jerry
> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> news:u29xm06vFHA.2556@.TK2MSFTNGP15.phx.gbl...
> > Hello,
> > I have this query in access and I woul like to convert it to SQL.
> > --
> > SELECT KEYC.ProvID, Last(DIMAGE.ID) AS LastOfID
> > FROM DIMAGE INNER JOIN KEYC
> > ON DIMAGE.ProvID = KEYC.ProvID
> > WHERE (((KEYC.PlanID)=10072 Or (KEYC.PlanID)=10125) AND
> > ((DIMAGE.Type)="ATT" Or (DIMAGE.Type)="A00" Or (DIMAGE.Type)="ATTST"))
> > GROUP BY KEYC.ProvID;
> > --
> >
> > the problem here is the Last function. I am running SQL 7 and it
returns
> > with "'Last' is not a known function."
> > Any sugestions?
> >
> > --
> > -Scott
> >
> >
>|||Be aware that although you can use MAX or MIN to avoid the syntax error, you
might not get the same behavior as the original Access query. MAX/MIN will
suffice if your intent is to get an arbitrary value from the grouping.
However, since FIRST and LAST aggregate functions return values based on the
chronological order if insertion, you'll need a datetime or identity column
along with a subquery to emulate those functions in Transact-SQL.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:O%23kYnJ7vFHA.3860@.TK2MSFTNGP09.phx.gbl...
> Excellent...That worked
> Thanks
> "Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
> news:%23fY9216vFHA.464@.TK2MSFTNGP15.phx.gbl...
>> Scott,
>> Try MIN() and MAX().
>> HTH
>> Jerry
>> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
>> news:u29xm06vFHA.2556@.TK2MSFTNGP15.phx.gbl...
>> > Hello,
>> > I have this query in access and I woul like to convert it to SQL.
>> > --
>> > SELECT KEYC.ProvID, Last(DIMAGE.ID) AS LastOfID
>> > FROM DIMAGE INNER JOIN KEYC
>> > ON DIMAGE.ProvID = KEYC.ProvID
>> > WHERE (((KEYC.PlanID)=10072 Or (KEYC.PlanID)=10125) AND
>> > ((DIMAGE.Type)="ATT" Or (DIMAGE.Type)="A00" Or (DIMAGE.Type)="ATTST"))
>> > GROUP BY KEYC.ProvID;
>> > --
>> >
>> > the problem here is the Last function. I am running SQL 7 and it
> returns
>> > with "'Last' is not a known function."
>> > Any sugestions?
>> >
>> > --
>> > -Scott
>> >
>> >
>>
>

first()

Hi all

I'm trying to do some calculations using java.....when I execute my query and want to ensure that I am at the first row I'm using ResultSet.first()...but that gives me an "Unsupported method"-error.

I've tried ResultSet.absolute(1) as well - with the same result unfortunately :(

Does anybody know what I'm doing wrong ??

Thanks

KimDid you make your resultset scrollable ?|||That looks more like vb than java...

http://java.sun.com/docs/books/tutorial/index.html|||Nope - its java.

2012年2月26日星期日

First Occurence of the record

Can any one let me know as how can I query the first occurence of a record. I need to select all distinct Order Types from a table. If there is more than one record with the same Order Type, then I need to get the first record.
It would be a great help to me.
Thanks,
JohnHow do you determine which one is the first record ?|||I mean any randon first record. I used min (rowid) but it did not work.

Please help me out.

John|||Did you try to use Top 1 * with Order By RowID (a primary key)|||john, what's the primary key of this table?

First CTP and spatial

I just download and install first CTP. When I execute query

Code Snippet

select * from sys.types

i don't see any spatial data types?

May be i do something wrong? Or spatial unsupported in first CTP?

Spatial data feature is not included in the June CTP. The demo at Tech-Ed is based on a non-CTP build.

Hope this helps!

Changqing|||

>>Or spatial unsupported in first CTP?

No, this is not available in the first CTP. For a list of features in the CTP, open Books Online and search for " What's New". There's a What's New (Database Engine), What's New (Reporting Services), etc. topic for each SQL Server component that describes the new features available in the CTP with links to the relevant topics.

Regards,

Gail

|||Can you give us a time estimate when this WILL be included ;-)|||I've seen a similar question here already, and the correct answer is: When it's finished. Microsoft develop using a different strategy now, they include features when they seem to be ready for the market, so as far as I've understood the situation no new features are officially scheduled for a specific release or a specific date.|||

The spatial functionality I demo'ed at TechEd is not part of CTP3 or the upcoming CTP4. We cannot give an official delivery date yet, but we hope to have it available after CTP4. ;-)

Best regards

Michael

First CTP and spatial

I just download and install first CTP. When I execute query

Code Snippet

select * from sys.types

i don't see any spatial data types?

May be i do something wrong? Or spatial unsupported in first CTP?

Spatial data feature is not included in the June CTP. The demo at Tech-Ed is based on a non-CTP build.

Hope this helps!

Changqing|||

>>Or spatial unsupported in first CTP?

No, this is not available in the first CTP. For a list of features in the CTP, open Books Online and search for " What's New". There's a What's New (Database Engine), What's New (Reporting Services), etc. topic for each SQL Server component that describes the new features available in the CTP with links to the relevant topics.

Regards,

Gail

|||Can you give us a time estimate when this WILL be included ;-)|||I've seen a similar question here already, and the correct answer is: When it's finished. Microsoft develop using a different strategy now, they include features when they seem to be ready for the market, so as far as I've understood the situation no new features are officially scheduled for a specific release or a specific date.|||

The spatial functionality I demo'ed at TechEd is not part of CTP3 or the upcoming CTP4. We cannot give an official delivery date yet, but we hope to have it available after CTP4. ;-)

Best regards

Michael

2012年2月24日星期五

Firewall Problem

I have opened port 1433 on my firewall, but I am still not able to get
remote clients to connect via query analyser, or enterprise manager.
Are there other ports required to be opened ?Have you checked your remote clients to make sure TCP/IP sockets is the
default protocol? You may have to go SQL Client Network Utility or run
through a SQL Server ODBC System DSN (Control Panel | ODBC Data Sources) and
verify that on the user login credential page that the Client Configuration
that it says TCP/IP sockets.
I did look in SQL Server books online in the Network Libraries topic, and
read this
SQL Server uses UDP port 1434 to establish connections from SQL Server 2000
clients. This socket number is also reserved for SQL Server by Internet
Assigned Number Authority (IANA).
You can download SQL Server books online for free from MS
http://www.microsoft.com/sql/techin.../2000/books.asp
****************************************
***************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.NOMORESPAM.yahoo.com
Please remove NOMORESPAM before replying.
Always keep your antivirus and Microsoft software
up to date with the latest definitions and product updates.
Be suspicious of every email attachment, I will never send
or post anything other than the text of a http:// link nor
post the link directly to a file for downloading.
This posting is provided "as is" with no warranties
and confers no rights.
****************************************
***************************
"AussieRules" <someone@.nowhere.com> wrote in message
news:upbiLWY6DHA.3288@.TK2MSFTNGP11.phx.gbl...
quote:

> I have opened port 1433 on my firewall, but I am still not able to get
> remote clients to connect via query analyser, or enterprise manager.
> Are there other ports required to be opened ?
>
>