Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Wednesday, March 28, 2012

Opening View does not reflect SQL statement

I am having trouble with a VIEW. I modify the view to add a sort criteria. I can Execute the SQL and get the results I am looking for. I save the VIEW. Then if I open the VIEW using the OPEN VIEW menu option(right clicking the VIEW name) the sort order I set does not work. Please help.

Using Microsoft SQL Server Management Studio Express to access the SQL Server 2005

Hi,

this is by design. SQL Server does not guarantee to give back ordered results in a view, unless you specify the TOP clause (e.g. TOP 100 PERCENT).

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

I am having trouble with this issue, too. When I use the TOP (100) clause, the sort order is reflected when I use Open View. When I use the TOP 100 PERCENT clause, I don't get the sort order. I need to display all of the records in the view and need the sort order. Any suggestions?

Thanks!

|||

I apply Service Pack 1 for microsoft SQL Server 2005

Version : 9.00.2047

and facing the same problem and the TOP 100 Percent doesn't resolve the problem. and the sorting option (ORDER BY) working fine in preview pane , but when Open the View the sorting option doesn't work.

the workaround for this is not using the View and write direct SQL statements with ORDER BY.

Thanks

|||

Hi Jens,

Sorry to say u that ur post was not helpfull, still same problem on using SELECT TOP 100 PERCENT

I have found one link where it was written if we use SELECT TOP (100) PERCENT it will work, actually it worked but

only for NUMBER and DATE.

Why not for STRING(varchar). I am working at tokyo and my database has japanese data. what about japanese sorting..

Please give us some solution or downloadable patch to overcome this BUG of SQL Server 2005 ?

RICz
Software Specialist
Tokyo,Japan
www.rajibul.com

|||

Yes, I found a funny way to fix the sorting problem of Character in SQL Server 2005.

--It's surprising that the SQL Server tools group didn't alter the query parser to replace TOP (100) Percent with TOP (2147483647). The group also should have fixed—or warned users about—the ambiguous presentation in the Results pane for views-

Please just use the SELECT TOP (2147483647) in the SQL to support sorting of ORDER BY

It will work until microsoft fix it to work automatically

Information from
http://oakleafblog.blogspot.com/2006/09/sql-server-2005-ordered-view-and.html

RICZ
www.rajibul.com

Opening View does not reflect SQL statement

I am having trouble with a VIEW. I modify the view to add a sort criteria. I can Execute the SQL and get the results I am looking for. I save the VIEW. Then if I open the VIEW using the OPEN VIEW menu option(right clicking the VIEW name) the sort order I set does not work. Please help.

Using Microsoft SQL Server Management Studio Express to access the SQL Server 2005

Hi,

this is by design. SQL Server does not guarantee to give back ordered results in a view, unless you specify the TOP clause (e.g. TOP 100 PERCENT).

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

I am having trouble with this issue, too. When I use the TOP (100) clause, the sort order is reflected when I use Open View. When I use the TOP 100 PERCENT clause, I don't get the sort order. I need to display all of the records in the view and need the sort order. Any suggestions?

Thanks!

|||

I apply Service Pack 1 for microsoft SQL Server 2005

Version : 9.00.2047

and facing the same problem and the TOP 100 Percent doesn't resolve the problem. and the sorting option (ORDER BY) working fine in preview pane , but when Open the View the sorting option doesn't work.

the workaround for this is not using the View and write direct SQL statements with ORDER BY.

Thanks

|||

Hi Jens,

Sorry to say u that ur post was not helpfull, still same problem on using SELECT TOP 100 PERCENT

I have found one link where it was written if we use SELECT TOP (100) PERCENT it will work, actually it worked but

only for NUMBER and DATE.

Why not for STRING(varchar). I am working at tokyo and my database has japanese data. what about japanese sorting..

Please give us some solution or downloadable patch to overcome this BUG of SQL Server 2005 ?

RICz
Software Specialist
Tokyo,Japan
www.rajibul.com

|||

Yes, I found a funny way to fix the sorting problem of Character in SQL Server 2005.

--It's surprising that the SQL Server tools group didn't alter the query parser to replace TOP (100) Percent with TOP (2147483647). The group also should have fixed—or warned users about—the ambiguous presentation in the Results pane for views-

Please just use the SELECT TOP (2147483647) in the SQL to support sorting of ORDER BY

It will work until microsoft fix it to work automatically

Information from
http://oakleafblog.blogspot.com/2006/09/sql-server-2005-ordered-view-and.html

RICZ
www.rajibul.com

Friday, March 23, 2012

OpenDataSource trouble with Advantage SQL

Hi folks.
I'm trying to connect to a Medisoft Advantage SQL db through SQL Server
using OpenDataSource or OpenRowSet. I have general connections to the db
working fine, but not with OpenDataSource or OpenRowSet.

I've tried variations on:

select * from
OpenDataSource(
'Advantage OLE DB Provider',
'Data Source=C:\MediData\Tutor\mwddf.add;
User ID=user;Password=password;
Advantage Server Type=ADS_LOCAL_SERVER;
Initial Catalog=mwddf.add;')...MWPAT

Which gives:
OLE DB error trace [OLE/DB Provider 'Advantage OLE DB Provider'
IColumnsInfo::MapColumnIDs returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG
ORDINAL=-1], [COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1], [COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID
ORDINAL=-1]].

I've also tried:

select * from
Openrowset(
'Advantage OLE DB Provider',
'Data Source=C:\MediData\Tutor\mwddf.add;User
ID=user;Password=password;Initial Catalog=mwddf.add;Advantage Server
Type=ADS_REMOTE_SERVER',
MWPAT)
and 'Select * from MWPAT'.
These last yield:

[OLE/DB provider returned message: No Data Source specified]

which seems closer.

Can anyone help? I think this is all Advantage-specific. I've posted on
their boards, but their not very active...

Thanks.

DavidHi David,

what is the version of database you are using. 6, 7.0, 7.1 or 8

thanks
vaddi

Quote:

Originally Posted by David Horowitz

Hi folks.
I'm trying to connect to a Medisoft Advantage SQL db through SQL Server
using OpenDataSource or OpenRowSet. I have general connections to the db
working fine, but not with OpenDataSource or OpenRowSet.

I've tried variations on:

select * from
OpenDataSource(
'Advantage OLE DB Provider',
'Data Source=C:\MediData\Tutor\mwddf.add;
User ID=user;Password=password;
Advantage Server Type=ADS_LOCAL_SERVER;
Initial Catalog=mwddf.add;')...MWPAT

Which gives:
OLE DB error trace [OLE/DB Provider 'Advantage OLE DB Provider'
IColumnsInfo::MapColumnIDs returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG
ORDINAL=-1], [COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1], [COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID
ORDINAL=-1]].

I've also tried:

select * from
Openrowset(
'Advantage OLE DB Provider',
'Data Source=C:\MediData\Tutor\mwddf.add;User
ID=user;Password=password;Initial Catalog=mwddf.add;Advantage Server
Type=ADS_REMOTE_SERVER',
MWPAT)
and 'Select * from MWPAT'.
These last yield:

[OLE/DB provider returned message: No Data Source specified]

which seems closer.

Can anyone help? I think this is all Advantage-specific. I've posted on
their boards, but their not very active...

Thanks.

David

Wednesday, March 7, 2012

Only seeing data from last row in dataset

I have a master detail report that I'm having trouble
with, I have the report layed out and populating fields in
the master report with data, my report uses fields from the
master report and passes it as parameters to the subreport, that's all
working well, the problem is I only get data for the last
record in the master dataset... It's not displaying a new
page for each records in the master dataset... None of my
fields use the First function... My grouping in my query
is setup correctly, is there any other place to setup
grouping in the report designer...? What am I doing
wrong...? In the wizard it asks me how I would like to scope my fields
either Page, Group or Details, where can I access this functionality outside
the wizard, I created all of my reports without the wizard...I am not sure but it sounds like you need to put either a table or rectangle
onto the report that you can tie back to you dataset. If you just create a
report and put textboxes on the blank page you will only get the last row of
data.
"Alien2_51" wrote:
> I have a master detail report that I'm having trouble
> with, I have the report layed out and populating fields in
> the master report with data, my report uses fields from the
> master report and passes it as parameters to the subreport, that's all
> working well, the problem is I only get data for the last
> record in the master dataset... It's not displaying a new
> page for each records in the master dataset... None of my
> fields use the First function... My grouping in my query
> is setup correctly, is there any other place to setup
> grouping in the report designer...? What am I doing
> wrong...? In the wizard it asks me how I would like to scope my fields
> either Page, Group or Details, where can I access this functionality outside
> the wizard, I created all of my reports without the wizard...
>|||Hi John,
I'm pretty confident we're on to something here, I'm certain I'm just using
a report with text boxes on it, which is most definately why I'm seeing only
the last row of data. I put my data elements in a rectangle which seemed more
appropriate because I'm displaying header or master data in the "top" report,
so I want a new page for every row in the master dataset. I noticed in the
property pages for the rectangle that there is a drop down list thats labeled
Data region, the description reads: Type or select the data region with which
to repeat the rectangle on every page that the data region appears. My
question is this; Could you define the term "Data region" and how do I create
one in the designer. I typed in the field from the dataset but got an error.
In your post you had mentioned that I can tie it back to the dataset, what
did you mean by that...?
Thanks for your help!!!
Dan
"johnE" wrote:
> I am not sure but it sounds like you need to put either a table or rectangle
> onto the report that you can tie back to you dataset. If you just create a
> report and put textboxes on the blank page you will only get the last row of
> data.
> "Alien2_51" wrote:
> > I have a master detail report that I'm having trouble
> > with, I have the report layed out and populating fields in
> > the master report with data, my report uses fields from the
> > master report and passes it as parameters to the subreport, that's all
> > working well, the problem is I only get data for the last
> > record in the master dataset... It's not displaying a new
> > page for each records in the master dataset... None of my
> > fields use the First function... My grouping in my query
> > is setup correctly, is there any other place to setup
> > grouping in the report designer...? What am I doing
> > wrong...? In the wizard it asks me how I would like to scope my fields
> > either Page, Group or Details, where can I access this functionality outside
> > the wizard, I created all of my reports without the wizard...
> >|||Why do you have two datasets? As far as I know you cannot join two seperate
datasets in a report. I may be wrong. What might be easier is to join the
datsets in your query. When you do that you create a table and create a
group by the changing rows of the master data set. If that won't work then
use a subreport rather than two different datasets. the subreport will bring
in the detail. When you do it this way you put the rectangle on the report
for the master dataset. After you add the rectangle right click on it and
select properties. On the general tab there will be an option to tie it to a
data set. Then inside the main rectangle you add another one and add the
subreport to that. Let me know which way you decide to go and I can help you
with this.
"Alien2_51" wrote:
> Hi John,
> I'm pretty confident we're on to something here, I'm certain I'm just using
> a report with text boxes on it, which is most definately why I'm seeing only
> the last row of data. I put my data elements in a rectangle which seemed more
> appropriate because I'm displaying header or master data in the "top" report,
> so I want a new page for every row in the master dataset. I noticed in the
> property pages for the rectangle that there is a drop down list thats labeled
> Data region, the description reads: Type or select the data region with which
> to repeat the rectangle on every page that the data region appears. My
> question is this; Could you define the term "Data region" and how do I create
> one in the designer. I typed in the field from the dataset but got an error.
> In your post you had mentioned that I can tie it back to the dataset, what
> did you mean by that...?
> Thanks for your help!!!
> Dan
> "johnE" wrote:
> > I am not sure but it sounds like you need to put either a table or rectangle
> > onto the report that you can tie back to you dataset. If you just create a
> > report and put textboxes on the blank page you will only get the last row of
> > data.
> >
> > "Alien2_51" wrote:
> >
> > > I have a master detail report that I'm having trouble
> > > with, I have the report layed out and populating fields in
> > > the master report with data, my report uses fields from the
> > > master report and passes it as parameters to the subreport, that's all
> > > working well, the problem is I only get data for the last
> > > record in the master dataset... It's not displaying a new
> > > page for each records in the master dataset... None of my
> > > fields use the First function... My grouping in my query
> > > is setup correctly, is there any other place to setup
> > > grouping in the report designer...? What am I doing
> > > wrong...? In the wizard it asks me how I would like to scope my fields
> > > either Page, Group or Details, where can I access this functionality outside
> > > the wizard, I created all of my reports without the wizard...
> > >|||I don't have two datasets, I'm using a subreport, the subreports parameters
are tied to fields in my master dataset using the parameters collection in
the subreport, I don't see the option in the general tab to "tie it back to
the dataset" Are you talking about the "Data region"...? How do I create one
in the designer...? I typed in the field from the dataset I'm grouping on but
got an error. In your post you had mentioned that I can tie it back to the
dataset, what did you mean by that...?
I appreciate your help...
"johnE" wrote:
> Why do you have two datasets? As far as I know you cannot join two seperate
> datasets in a report. I may be wrong. What might be easier is to join the
> datsets in your query. When you do that you create a table and create a
> group by the changing rows of the master data set. If that won't work then
> use a subreport rather than two different datasets. the subreport will bring
> in the detail. When you do it this way you put the rectangle on the report
> for the master dataset. After you add the rectangle right click on it and
> select properties. On the general tab there will be an option to tie it to a
> data set. Then inside the main rectangle you add another one and add the
> subreport to that. Let me know which way you decide to go and I can help you
> with this.
> "Alien2_51" wrote:
> > Hi John,
> >
> > I'm pretty confident we're on to something here, I'm certain I'm just using
> > a report with text boxes on it, which is most definately why I'm seeing only
> > the last row of data. I put my data elements in a rectangle which seemed more
> > appropriate because I'm displaying header or master data in the "top" report,
> > so I want a new page for every row in the master dataset. I noticed in the
> > property pages for the rectangle that there is a drop down list thats labeled
> > Data region, the description reads: Type or select the data region with which
> > to repeat the rectangle on every page that the data region appears. My
> > question is this; Could you define the term "Data region" and how do I create
> > one in the designer. I typed in the field from the dataset but got an error.
> > In your post you had mentioned that I can tie it back to the dataset, what
> > did you mean by that...?
> >
> > Thanks for your help!!!
> >
> > Dan
> >
> > "johnE" wrote:
> >
> > > I am not sure but it sounds like you need to put either a table or rectangle
> > > onto the report that you can tie back to you dataset. If you just create a
> > > report and put textboxes on the blank page you will only get the last row of
> > > data.
> > >
> > > "Alien2_51" wrote:
> > >
> > > > I have a master detail report that I'm having trouble
> > > > with, I have the report layed out and populating fields in
> > > > the master report with data, my report uses fields from the
> > > > master report and passes it as parameters to the subreport, that's all
> > > > working well, the problem is I only get data for the last
> > > > record in the master dataset... It's not displaying a new
> > > > page for each records in the master dataset... None of my
> > > > fields use the First function... My grouping in my query
> > > > is setup correctly, is there any other place to setup
> > > > grouping in the report designer...? What am I doing
> > > > wrong...? In the wizard it asks me how I would like to scope my fields
> > > > either Page, Group or Details, where can I access this functionality outside
> > > > the wizard, I created all of my reports without the wizard...
> > > >|||click on the rectangle you drew. Go to the properties tab. One of the
properties is dataset name. there should be a drop down list that allows you
to select the dataset. After you select the data set insert the subreport.
Pass the fieild you want to use as a parameter. On the properties tab for
the sub report set the Page break after to True.
"Alien2_51" wrote:
> I don't have two datasets, I'm using a subreport, the subreports parameters
> are tied to fields in my master dataset using the parameters collection in
> the subreport, I don't see the option in the general tab to "tie it back to
> the dataset" Are you talking about the "Data region"...? How do I create one
> in the designer...? I typed in the field from the dataset I'm grouping on but
> got an error. In your post you had mentioned that I can tie it back to the
> dataset, what did you mean by that...?
> I appreciate your help...
>
> "johnE" wrote:
> > Why do you have two datasets? As far as I know you cannot join two seperate
> > datasets in a report. I may be wrong. What might be easier is to join the
> > datsets in your query. When you do that you create a table and create a
> > group by the changing rows of the master data set. If that won't work then
> > use a subreport rather than two different datasets. the subreport will bring
> > in the detail. When you do it this way you put the rectangle on the report
> > for the master dataset. After you add the rectangle right click on it and
> > select properties. On the general tab there will be an option to tie it to a
> > data set. Then inside the main rectangle you add another one and add the
> > subreport to that. Let me know which way you decide to go and I can help you
> > with this.
> >
> > "Alien2_51" wrote:
> >
> > > Hi John,
> > >
> > > I'm pretty confident we're on to something here, I'm certain I'm just using
> > > a report with text boxes on it, which is most definately why I'm seeing only
> > > the last row of data. I put my data elements in a rectangle which seemed more
> > > appropriate because I'm displaying header or master data in the "top" report,
> > > so I want a new page for every row in the master dataset. I noticed in the
> > > property pages for the rectangle that there is a drop down list thats labeled
> > > Data region, the description reads: Type or select the data region with which
> > > to repeat the rectangle on every page that the data region appears. My
> > > question is this; Could you define the term "Data region" and how do I create
> > > one in the designer. I typed in the field from the dataset but got an error.
> > > In your post you had mentioned that I can tie it back to the dataset, what
> > > did you mean by that...?
> > >
> > > Thanks for your help!!!
> > >
> > > Dan
> > >
> > > "johnE" wrote:
> > >
> > > > I am not sure but it sounds like you need to put either a table or rectangle
> > > > onto the report that you can tie back to you dataset. If you just create a
> > > > report and put textboxes on the blank page you will only get the last row of
> > > > data.
> > > >
> > > > "Alien2_51" wrote:
> > > >
> > > > > I have a master detail report that I'm having trouble
> > > > > with, I have the report layed out and populating fields in
> > > > > the master report with data, my report uses fields from the
> > > > > master report and passes it as parameters to the subreport, that's all
> > > > > working well, the problem is I only get data for the last
> > > > > record in the master dataset... It's not displaying a new
> > > > > page for each records in the master dataset... None of my
> > > > > fields use the First function... My grouping in my query
> > > > > is setup correctly, is there any other place to setup
> > > > > grouping in the report designer...? What am I doing
> > > > > wrong...? In the wizard it asks me how I would like to scope my fields
> > > > > either Page, Group or Details, where can I access this functionality outside
> > > > > the wizard, I created all of my reports without the wizard...
> > > > >|||Hi John,
Sorry man, we must be using different versions of the report designer or
something, I'm just not seeing the "dataset name" property you're talking
about... I've looked both on the property tab in the VS IDE and the property
pages accessed from the context menu... If you send me email at
dan.billow@.re.mo.ve.this.monacocoach.com, I'll send you some screen captures
of my property pages, I don't know what else to do.
"johnE" wrote:
> click on the rectangle you drew. Go to the properties tab. One of the
> properties is dataset name. there should be a drop down list that allows you
> to select the dataset. After you select the data set insert the subreport.
> Pass the fieild you want to use as a parameter. On the properties tab for
> the sub report set the Page break after to True.
> "Alien2_51" wrote:
> > I don't have two datasets, I'm using a subreport, the subreports parameters
> > are tied to fields in my master dataset using the parameters collection in
> > the subreport, I don't see the option in the general tab to "tie it back to
> > the dataset" Are you talking about the "Data region"...? How do I create one
> > in the designer...? I typed in the field from the dataset I'm grouping on but
> > got an error. In your post you had mentioned that I can tie it back to the
> > dataset, what did you mean by that...?
> >
> > I appreciate your help...
> >
> >
> > "johnE" wrote:
> >
> > > Why do you have two datasets? As far as I know you cannot join two seperate
> > > datasets in a report. I may be wrong. What might be easier is to join the
> > > datsets in your query. When you do that you create a table and create a
> > > group by the changing rows of the master data set. If that won't work then
> > > use a subreport rather than two different datasets. the subreport will bring
> > > in the detail. When you do it this way you put the rectangle on the report
> > > for the master dataset. After you add the rectangle right click on it and
> > > select properties. On the general tab there will be an option to tie it to a
> > > data set. Then inside the main rectangle you add another one and add the
> > > subreport to that. Let me know which way you decide to go and I can help you
> > > with this.
> > >
> > > "Alien2_51" wrote:
> > >
> > > > Hi John,
> > > >
> > > > I'm pretty confident we're on to something here, I'm certain I'm just using
> > > > a report with text boxes on it, which is most definately why I'm seeing only
> > > > the last row of data. I put my data elements in a rectangle which seemed more
> > > > appropriate because I'm displaying header or master data in the "top" report,
> > > > so I want a new page for every row in the master dataset. I noticed in the
> > > > property pages for the rectangle that there is a drop down list thats labeled
> > > > Data region, the description reads: Type or select the data region with which
> > > > to repeat the rectangle on every page that the data region appears. My
> > > > question is this; Could you define the term "Data region" and how do I create
> > > > one in the designer. I typed in the field from the dataset but got an error.
> > > > In your post you had mentioned that I can tie it back to the dataset, what
> > > > did you mean by that...?
> > > >
> > > > Thanks for your help!!!
> > > >
> > > > Dan
> > > >
> > > > "johnE" wrote:
> > > >
> > > > > I am not sure but it sounds like you need to put either a table or rectangle
> > > > > onto the report that you can tie back to you dataset. If you just create a
> > > > > report and put textboxes on the blank page you will only get the last row of
> > > > > data.
> > > > >
> > > > > "Alien2_51" wrote:
> > > > >
> > > > > > I have a master detail report that I'm having trouble
> > > > > > with, I have the report layed out and populating fields in
> > > > > > the master report with data, my report uses fields from the
> > > > > > master report and passes it as parameters to the subreport, that's all
> > > > > > working well, the problem is I only get data for the last
> > > > > > record in the master dataset... It's not displaying a new
> > > > > > page for each records in the master dataset... None of my
> > > > > > fields use the First function... My grouping in my query
> > > > > > is setup correctly, is there any other place to setup
> > > > > > grouping in the report designer...? What am I doing
> > > > > > wrong...? In the wizard it asks me how I would like to scope my fields
> > > > > > either Page, Group or Details, where can I access this functionality outside
> > > > > > the wizard, I created all of my reports without the wizard...
> > > > > >