Showing posts with label ole. Show all posts
Showing posts with label ole. Show all posts

Wednesday, March 21, 2012

OLEDB versus ODBC

HI,

I'm using a reporting tool for retrieving information from a sqlsrv 2005 env. using OLE DB for my connection.
When i've created a metric and whilst refreshing it i get the message 'object was open'. Changing the connection into ODBC everything went well.

By looking at the log file it's trying to write the metric record in the DB but it simply cannot (OLEDB) but using ODBC is all went fine...

Is something not properly installed on the server side?

anyone?

E10

Are you using a 3rd-party reporting tools? It looks like they do not use OleDb in a proper way. Better check with the reporting tools' vendor.

oledb source issues with parameters

Hi,

I been having issues trying to use the OLE DB Source in the DataFlowTask. If I use the SQL Command to build a SQL Statement, i.e. "select * from tablea a join tableb b on a.column1 = b.column1 where column2 = ?", I can't get the query to parse and it won't allow me to set a value to the parameter. It seems to be a bug as the only way I can see to get around it is to use a variable to place my sql statement into and use the "SQLCommand with Variable" option in the OLEDB Source. This seems pretty clunky to me as I should be able to just put my select statement in the SQL Command window, right? Is this going to be fixed in SP1?

Here's the error message I get:
Parameters cannot be extracted from the SQL command. The provider might not help to parse parameter information from the command. In that case, use the "SQL command from variable" access mode, in which the entire SQL command is stored in a variable.

Any insight would be appreciated.
Thanks,
AndyAndy,
There are some "funnies" involved with using parameters which are all due to your choice of OLE DB Provider. Kirk has more info here: http://www.sqljunkies.com/WebLog/knight_reign/archive/2005/10/05/17016.aspx

However...don't do that. Use "SQLCommand from variable" option. This is not clunky, it is far far better. It lets you build your SQL statement dynamically and cannot fall victim to the vagaries of OLE DB Providers.

-Jamie|||You won't be able to parse a query with parameters. That is a known bug. But you should be able to map the parameters if you click on the Parameters button. For this kind of select query, specify the parameters name as 0, 1, 2 etc, and map them to your variables.|||ok, thanks guys. It's just hard to see your query in the variable. If I want to go see what my query is, I have to go and copy it out of the variable and put in a bunch of carriage returns to see my query. It would be nice if I could just use regular parameters. Oh well.|||Andy,
I agree - its annoying. SP1 will contain functionality that will make it easier to do this (i.e. Build your expression using the expression editor that you see in other places).

You can use the watch window to look at the value of your variables at debugtime as shown here: http://blogs.conchango.com/jamiethomson/archive/2005/12/05/2462.aspx

-Jamie|||In case your query is actually a stored proc returning a recordset, and not a select .... statement, the parameter name mappings must mach names used in the stored proc definition, at least that was my experience...|||Looking forward to SP1!! Thanks for the info.sql

oledb source issues with parameters

Hi,

I been having issues trying to use the OLE DB Source in the DataFlowTask. If I use the SQL Command to build a SQL Statement, i.e. "select * from tablea a join tableb b on a.column1 = b.column1 where column2 = ?", I can't get the query to parse and it won't allow me to set a value to the parameter. It seems to be a bug as the only way I can see to get around it is to use a variable to place my sql statement into and use the "SQLCommand with Variable" option in the OLEDB Source. This seems pretty clunky to me as I should be able to just put my select statement in the SQL Command window, right? Is this going to be fixed in SP1?

Here's the error message I get:
Parameters cannot be extracted from the SQL command. The provider might not help to parse parameter information from the command. In that case, use the "SQL command from variable" access mode, in which the entire SQL command is stored in a variable.

Any insight would be appreciated.
Thanks,
AndyAndy,
There are some "funnies" involved with using parameters which are all due to your choice of OLE DB Provider. Kirk has more info here: http://www.sqljunkies.com/WebLog/knight_reign/archive/2005/10/05/17016.aspx

However...don't do that. Use "SQLCommand from variable" option. This is not clunky, it is far far better. It lets you build your SQL statement dynamically and cannot fall victim to the vagaries of OLE DB Providers.

-Jamie|||You won't be able to parse a query with parameters. That is a known bug. But you should be able to map the parameters if you click on the Parameters button. For this kind of select query, specify the parameters name as 0, 1, 2 etc, and map them to your variables.|||ok, thanks guys. It's just hard to see your query in the variable. If I want to go see what my query is, I have to go and copy it out of the variable and put in a bunch of carriage returns to see my query. It would be nice if I could just use regular parameters. Oh well.|||Andy,
I agree - its annoying. SP1 will contain functionality that will make it easier to do this (i.e. Build your expression using the expression editor that you see in other places).

You can use the watch window to look at the value of your variables at debugtime as shown here: http://blogs.conchango.com/jamiethomson/archive/2005/12/05/2462.aspx

-Jamie|||In case your query is actually a stored proc returning a recordset, and not a select .... statement, the parameter name mappings must mach names used in the stored proc definition, at least that was my experience...|||Looking forward to SP1!! Thanks for the info.

Tuesday, March 20, 2012

OLEDB error while processing Analysis service database

Hi,
I migrated AS 2000 database to AS 2005 thorugh migration wizard and started processing the database. But I am getting error like "OLE DB error: OLE DB or ODBC error: Query (5, 19) Parser: The syntax for 'AS' is incorrect..". After migrating I didn't modified any settings.
If anybody having info, please share.
ThanksIt looks the SQL query sent by Analysis Services for processing is bad. You can examine the query in the processing dialog and see what's wrong (wrong syntax for AS clause?).

Monday, March 19, 2012

Oledb destination commit interval

Hi

How can commit interval for OLE DB destination be set when the data access mode is not "fast load".

What happens in oledb destination in case of a failure in package? How does the roll back happens. I mean how is the commit point set in oledb destination? I know about the transaction options which are at the package level.

Thanks,

Vipul

Vipul123 wrote:

Hi

How can commit interval for OLE DB destination be set when the data access mode is not "fast load".

What happens in oledb destination in case of a failure in package? How does the roll back happens. I mean how is the commit point set in oledb destination? I know about the transaction options which are at the package level.

Thanks,

Vipul

"Commit interval" when you're not using fastload is 1. Each row is an independent insert. If there is a failure in the destination, the row can be redirected, you can ignore it, or the component can fail as determined by the error disposition of the component. If you're using transactions, then the rollback is managed by the server using the transaction log, not the oledb destination. Committing a bulk load batch and committing a transaction are not the same thing.
|||

Vipul123 wrote:

Hi

How can commit interval for OLE DB destination be set when the data access mode is not "fast load".

It can't. Use fast load. And why are you against using fast load?

Vipul123 wrote:


What happens in oledb destination in case of a failure in package? How does the roll back happens. I mean how is the commit point set in oledb destination? I know about the transaction options which are at the package level.

Thanks,

Vipul

When you are not using fast load, your roll back option is limited to ONE row unless you've enrolled the entire data flow in its own transaction (BEGIN TRANSACTION) or are using DTC. When you are not using fast load, if one row fails, that one row gets rolled back, while the others are left untouched -- including future rows depending on how many errors you've configured the package to accept.

Monday, March 12, 2012

OleDB Connection Class in Custom Task?

I have OLE DB Connections set up in my connection manager (Native OLE DB\Microsoft OLE DB Provider for SQL Server). I would like to reference and query these connections from a custom task, written in C#. I currently reference it as follows:

using System.Data.OleDb;

...................................

OleDbConnection connection = (OleDbConnection) connections["MyConnection"].AcquireConnection(null);

What may be obvious to some (though wasn't to me, as I am new at this), when I run the task, I get an error saying that I cannot make this cast. After perusing the boards, I understand that this is because I am not making a cast to the right connection type. Well, that is where I am lost. What connection type (and corresponding library) do I need to reference? I want to continue to use the "Native OLE DB..." connection.

Thanks!

The OleDb connection manager is for tasks and data flow components that use unmanaged OleDb API.
Since you want managed connection object, use ADO.NET connection manager, select the same provider (Native OLE DB\Microsoft OLE DB Provider for SQL Server).

|||Makes sense. I don't know much about connection managers, but this helps. I'll give it a shot. Thanks!

OLEDB conn mgr change is not detected in BIDS/vs.net

I have changed the database name in an ole db connection manager. (The server name is identical)

When I run the package, it is still using the old db name.

I have tried restarting VS but it makes no difference.

How can I get it to stop caching the original name/update it to get the new name?restarting did fix the issue, but still it is ridiculous that you should have to take such an action

OLE/DB provider returned message: Invalid authorization specification

Hello,
I'm trying to import a table from a MSDE database (databaseB) into a SQL
server database (database A).
Using to following sql statement:
insert tableA
select a.*
from openrowset(sqloledb,'Provider=sqloledb;Password=pw d;User ID=usr;Initial
Catalog=databaseA;Data Source=server', select * from [dbo].[tableB]') as a
I'm getting the following error:
[OLE/DB provider returned message: Invalid authorization specification]
[OLE/DB provider returned message: Invalid connection string attribute]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IDBInitialize::Initialize
returned 0x80004005: ].
Everything runs fine if I use integrated security!? The used usr/pwd is a
MSDE login account.
A UDL file connection test directly to the MSDE database runs fine.
Thanx!
CHU! Eric
Hello Eric,
I have reproduced the issue on my side. Based on my research, the following
command works well:
insert into tableA
SELECT a.*
FROM OPENROWSET('SQLOLEDB','sophietest\msdeinstance';'s a';'password',
'SELECT * FROM test.dbo.tableB ') AS a
GO
or
insert into tableA
select a.*
from
openrowset('sqloledb','Provider=sqloledb;UID=sa;PW D=password;Database=test;S
erver=sophietest\msdeinstance', 'select * from [dbo].[tableB]') as a
Therefore, I recommend you perform the following commands:
1. Make sure the Authentication Mode of MSDE is mixed mode.
The following article is for your reference:
INFO: MSDE Security and Authentication
http://support.microsoft.com/default...en-us;325022#3
2. Run the following command to test:
insert into tableA
SELECT a.*
FROM OPENROWSET('SQLOLEDB','<your MSDE instance name> ';'sa';'password',
'SELECT * FROM databaseA.dbo.tableB ') AS a
GO
Or
insert into tableA
select a.*
from
openrowset('sqloledb','Provider=sqloledb;UID=sa;PW D=password;Database=databa
seA;Server=<your MSDE instance name>', 'select * from [dbo].[tableB]') as a
Note:
1. You need to replace the <your MSDE instance name> with your MSDE
instance name.
For more detailed information about OPENROWSET, please refer to the
OPENROWSET topic in SQL Books Online(BOL).
I hope the information is helpful.
Sophie Guo
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
================================================== ===
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Hello Sophie,
Thank you! It works fine now
"Sophie Guo [MSFT]" <v-sguo@.online.microsoft.com> wrote in message
news:n2c8bveKFHA.2876@.TK2MSFTNGXA02.phx.gbl...
> Hello Eric,
> I have reproduced the issue on my side. Based on my research, the
> following
> command works well:
>
> insert into tableA
> SELECT a.*
> FROM OPENROWSET('SQLOLEDB','sophietest\msdeinstance';'s a';'password',
> 'SELECT * FROM test.dbo.tableB ') AS a
> GO
> or
> insert into tableA
> select a.*
> from
> openrowset('sqloledb','Provider=sqloledb;UID=sa;PW D=password;Database=test;S
> erver=sophietest\msdeinstance', 'select * from [dbo].[tableB]') as a
>
> Therefore, I recommend you perform the following commands:
> 1. Make sure the Authentication Mode of MSDE is mixed mode.
> The following article is for your reference:
> INFO: MSDE Security and Authentication
> http://support.microsoft.com/default...en-us;325022#3
>
> 2. Run the following command to test:
> insert into tableA
> SELECT a.*
> FROM OPENROWSET('SQLOLEDB','<your MSDE instance name> ';'sa';'password',
> 'SELECT * FROM databaseA.dbo.tableB ') AS a
> GO
>
> Or
>
> insert into tableA
> select a.*
> from
> openrowset('sqloledb','Provider=sqloledb;UID=sa;PW D=password;Database=databa
> seA;Server=<your MSDE instance name>', 'select * from [dbo].[tableB]') as
> a
>
> Note:
> 1. You need to replace the <your MSDE instance name> with your MSDE
> instance name.
>
> For more detailed information about OPENROWSET, please refer to the
> OPENROWSET topic in SQL Books Online(BOL).
>
> I hope the information is helpful.
> Sophie Guo
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> ================================================== ===
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ================================================== ===
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>

OLE/DB provider returned message: Invalid authorization specification

Hello,
I'm trying to import a table from a MSDE database (databaseB) into a SQL
server database (database A).
Using to following sql statement:
insert tableA
select a.*
from openrowset(sqloledb,'Provider=sqloledb;P
assword=pwd;User ID=usr;Initial
Catalog=databaseA;Data Source=server', select * from [dbo].[tableB]'
) as a
I'm getting the following error:
[OLE/DB provider returned message: Invalid authorization specification]
[OLE/DB provider returned message: Invalid connection string attribute]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IDBInitialize::Initialize
returned 0x80004005: ].
Everything runs fine if I use integrated security!? The used usr/pwd is a
MSDE login account.
A UDL file connection test directly to the MSDE database runs fine.
Thanx!
CHU! EricHello Eric,
I have reproduced the issue on my side. Based on my research, the following
command works well:
insert into tableA
SELECT a.*
FROM OPENROWSET('SQLOLEDB','sophietest\msdein
stance';'sa';'password',
'SELECT * FROM test.dbo.tableB ') AS a
GO
or
insert into tableA
select a.*
from
openrowset('sqloledb','Provider=sqloledb
;UID=sa;PWD=password;Database=test;S
erver=sophietest\msdeinstance', 'select * from [dbo].[tableB]') as a
Therefore, I recommend you perform the following commands:
1. Make sure the Authentication Mode of MSDE is mixed mode.
The following article is for your reference:
INFO: MSDE Security and Authentication
http://support.microsoft.com/defaul...;en-us;325022#3
2. Run the following command to test:
insert into tableA
SELECT a.*
FROM OPENROWSET('SQLOLEDB','<your MSDE instance name> ';'sa';'password',
'SELECT * FROM databaseA.dbo.tableB ') AS a
GO
Or
insert into tableA
select a.*
from
openrowset('sqloledb','Provider=sqloledb
;UID=sa;PWD=password;Database=databa
seA;Server=<your MSDE instance name>', 'select * from [dbo].[tableB]
') as a
Note:
1. You need to replace the <your MSDE instance name> with your MSDE
instance name.
For more detailed information about OPENROWSET, please refer to the
OPENROWSET topic in SQL Books Online(BOL).
I hope the information is helpful.
Sophie Guo
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
========================================
=============
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Sophie,
Thank you! It works fine now
"Sophie Guo [MSFT]" <v-sguo@.online.microsoft.com> wrote in message
news:n2c8bveKFHA.2876@.TK2MSFTNGXA02.phx.gbl...
> Hello Eric,
> I have reproduced the issue on my side. Based on my research, the
> following
> command works well:
>
> insert into tableA
> SELECT a.*
> FROM OPENROWSET('SQLOLEDB','sophietest\msdein
stance';'sa';'password',
> 'SELECT * FROM test.dbo.tableB ') AS a
> GO
> or
> insert into tableA
> select a.*
> from
> openrowset('sqloledb','Provider=sqloledb
;UID=sa;PWD=password;Database=test
;S
> erver=sophietest\msdeinstance', 'select * from [dbo].[tableB]') as
a
>
> Therefore, I recommend you perform the following commands:
> 1. Make sure the Authentication Mode of MSDE is mixed mode.
> The following article is for your reference:
> INFO: MSDE Security and Authentication
> http://support.microsoft.com/defaul...;en-us;325022#3
>
> 2. Run the following command to test:
> insert into tableA
> SELECT a.*
> FROM OPENROWSET('SQLOLEDB','<your MSDE instance name> ';'sa';'password',
> 'SELECT * FROM databaseA.dbo.tableB ') AS a
> GO
>
> Or
>
> insert into tableA
> select a.*
> from
> openrowset('sqloledb','Provider=sqloledb
;UID=sa;PWD=password;Database=data
ba
> seA;Server=<your MSDE instance name>', 'select * from [dbo].[table
B]') as
> a
>
> Note:
> 1. You need to replace the <your MSDE instance name> with your MSDE
> instance name.
>
> For more detailed information about OPENROWSET, please refer to the
> OPENROWSET topic in SQL Books Online(BOL).
>
> I hope the information is helpful.
> Sophie Guo
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> ========================================
=============
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
=============
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>

OLE/DB provider returned message: Deferred prepare could not be completed

I have 2 SQL servers. And in the first one I have added the second SQL as a Link Server. When I run an SQL statement on the linked server I get the following message.

Server: Msg 7202, Level 11, State 1, Line 1
Could not find server 'PROD' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.
[OLE/DB provider returned message: Deferred prepare could not be completed.]

The SQL statement that I am runnins is

Select * from openquery(PROD,'Select * from PROD.GMS.dbo.qryDispCL')

But when I run only the SQL statement "Select * from PROD.GMS.dbo.qryDispCL" it works perfect. But I need to have the first statement running.

Please help. Your valuable feedback is greatly appriciated.

It's really strange... You can run this to check registered server:

EXEC sp_helpservers

If the server 'PROD' is not in the result, then run this to add it:

EXEC sp_addlinkedserver 'PROD'

Note: you may need to add login information for the 'PROD' server with 'sp_addlinkedsrvlogin'.

ole server login dialog box

I am trying to connect to sql server 2000 from a windows
95 machine and windows 98. Both give me the same problem.
There is no server listing in the login dialog box and it
won't allow me to type it in. The error is unable to
connect to data source.
The workaround is to code it in the registry, but that is
not acceptable.
The connection works fine in windows 2000, NT and XP.
Any ideas?
Thanks.What dialog box are you referring to? Are you talking about registering the
server in Enterprise Manager? Connecting through Query Analyzer? Can you
use OSQL and pass the server name as -S?
What does "won't allow me to type it in" mean? Do you get an error or it
won't let you click inside the dialog box?
What exactly do you add to the registry to make it work (what key and what
value)?
Cindy Gross, MCDBA, MCSE
http://cindygross.tripod.com
This posting is provided "AS IS" with no warranties, and confers no rights.

OLE Object extraction

Hi,

I have virtually no ms access skills as am an Oracle dba.

I need to extract OLE Object data which are images from an Access 2000 mdb file for an import I am writing, can anyone point me in the direction of either some software that will do this or any scripts I can write to do this.

When I open the table the field reads "Long Binary Data"

Many thanks

RobertHi,

I have virtually no ms access skills as am an Oracle dba.

I need to extract OLE Object data which are images from an Access 2000 mdb file for an import I am writing, can anyone point me in the direction of either some software that will do this or any scripts I can write to do this.

When I open the table the field reads "Long Binary Data"

Many thanks

Robert
Import to what ? Oracle or Sql server 2000 ?|||sorry, I just want to export the files into the file system|||sorry, I just want to export the files into the file system

We generally do it using BLOB..
Check this link
Link (http://www.vbwm.com/forums/topic.asp?TOPIC_ID=4073)
Hope it will help you.

OLE error code:80040E14

Hi,

I am getting the following error:

OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
Column 'tags.id' is invalid in the select list because it is not
contained in either an aggregate function or the GROUP BY clause.

when trying to execute the following query:

select tags.id, name, count(*) as count from taggings, tags where
tags.id = tag_id group by tag_id

The above query works fine on MySQL, but chokes on SQL Server.

Could anyone please help?

Thanks!

NM(neutralm@.gmail.com) writes:

Quote:

Originally Posted by

I am getting the following error:
>
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
Column 'tags.id' is invalid in the select list because it is not
contained in either an aggregate function or the GROUP BY clause.
>
>
when trying to execute the following query:
>
select tags.id, name, count(*) as count from taggings, tags where
tags.id = tag_id group by tag_id
>
>
The above query works fine on MySQL, but chokes on SQL Server.


SQL Server, like most DB engines, as well as ANSI SQL, that if your
SELECT list includes an aggregate such as COUNT(*), and there is no
OVER clause for the aggregate, then all unaggregated columns in the
SELECT list must appear in the GROUP BY list.

Change tag_id in the GROUP BY clause to tags.id or vice versa.

Apparently MySQL is lax on this point. As a matter of fact SQL Server
4.x also permitted columns to appear in the SELECT list, if they did
not appear in GROUP BY. Sometimes the result made sense, as here
where tags.id is one-to-one with tags_id. Sometimes you got screenfulls
of garbage when you expected two lines, because you had left out a
column in the GROUP BY clause. The feature was removed in SQL Server
6.0 (and Sybase System 10), missed by few.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thanks for your prompt reply, Erland. Pardon my ignorance, but I'm
still not sure if I understood how to solve the problem (although I
think I understand what the problem is from your explanation).

I have two tables:

1. tags (with the primary key 'id' and an attribute 'name')
2. taggings (the primary key is 'id', the foreign key is 'tag_id')

The query string I'm using is:

select tags.id, taggings.tag_id, name, count(*) as count from taggings,
tags where tags.id = taggings.tag_id group by taggings.tag_id

How should the correct query look like?

Thanks so much in advance!

Erland Sommarskog wrote:

Quote:

Originally Posted by

(neutralm@.gmail.com) writes:

Quote:

Originally Posted by

I am getting the following error:

OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
Column 'tags.id' is invalid in the select list because it is not
contained in either an aggregate function or the GROUP BY clause.

when trying to execute the following query:

select tags.id, name, count(*) as count from taggings, tags where
tags.id = tag_id group by tag_id

The above query works fine on MySQL, but chokes on SQL Server.


>
SQL Server, like most DB engines, as well as ANSI SQL, that if your
SELECT list includes an aggregate such as COUNT(*), and there is no
OVER clause for the aggregate, then all unaggregated columns in the
SELECT list must appear in the GROUP BY list.
>
Change tag_id in the GROUP BY clause to tags.id or vice versa.
>
Apparently MySQL is lax on this point. As a matter of fact SQL Server
4.x also permitted columns to appear in the SELECT list, if they did
not appear in GROUP BY. Sometimes the result made sense, as here
where tags.id is one-to-one with tags_id. Sometimes you got screenfulls
of garbage when you expected two lines, because you had left out a
column in the GROUP BY clause. The feature was removed in SQL Server
6.0 (and Sybase System 10), missed by few.
>
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

|||neutralm@.gmail.com wrote:

Quote:

Originally Posted by

The query string I'm using is:
>
select tags.id, taggings.tag_id, name, count(*) as count from taggings,
tags where tags.id = taggings.tag_id group by taggings.tag_id
>
How should the correct query look like?


select taggings.tag_id, name, count(*) as tag_id_count
from taggins join tags on taggings.tag_id = tags.id
group by taggings.tag_id, name

Explanations:

1) GROUP BY must include all unaggregated columns from the SELECT,
i.e. everything that is not a COUNT(), SUM(), etc. (Why doesn't
it implicitly assume this? Apparently, it used to let you leave
things out, but that caused more trouble than it was worth. The
short answer is "just give it what it wants".)

2) tags.id and taggings.tag_id are forced to be equal, so you only need
to include one of them. Optional but recommended, as it's simpler
and conserves bandwidth.

3) The join is changed from SELECT ... FROM A, B WHERE A.X = B.Y
to SELECT ... FROM A JOIN B ON A.X = B.Y
Optional but recommended, as it keeps join conditions separate from
each other, and from other restrictions (e.g. NAME LIKE '%ABC%'),
all of which makes the query easier to understand.|||Thank you very much, Ed. I really appreciate how quickly you've help me
fix this problem!

Ed Murphy wrote:

Quote:

Originally Posted by

neutralm@.gmail.com wrote:
>

Quote:

Originally Posted by

The query string I'm using is:

select tags.id, taggings.tag_id, name, count(*) as count from taggings,
tags where tags.id = taggings.tag_id group by taggings.tag_id

How should the correct query look like?


>
select taggings.tag_id, name, count(*) as tag_id_count
from taggins join tags on taggings.tag_id = tags.id
group by taggings.tag_id, name
>
Explanations:
>
1) GROUP BY must include all unaggregated columns from the SELECT,
i.e. everything that is not a COUNT(), SUM(), etc. (Why doesn't
it implicitly assume this? Apparently, it used to let you leave
things out, but that caused more trouble than it was worth. The
short answer is "just give it what it wants".)
>
2) tags.id and taggings.tag_id are forced to be equal, so you only need
to include one of them. Optional but recommended, as it's simpler
and conserves bandwidth.
>
3) The join is changed from SELECT ... FROM A, B WHERE A.X = B.Y
to SELECT ... FROM A JOIN B ON A.X = B.Y
Optional but recommended, as it keeps join conditions separate from
each other, and from other restrictions (e.g. NAME LIKE '%ABC%'),
all of which makes the query easier to understand.

OLE DB2 Provider

Hi

Running SQL 2005 standard edition, using OLE DB2 provider from Host integration server. When connected we can acces data with select statements, but cannot browse tables from import wizard in SSIS.

Is there a hint or solution?

rgds

It's probably the provider. The Enterprise Edition of Sql Server comes with a DB2 provider. You could also use an ODBC connection instead and see if that works. Finally, IBM might have a provider as well?|||Do you get an error message? I'm using the MS OLE DB2 provider quite regularly and have no issues... Setup is key, though, to getting it to work correctly.

OLE DB2 driver for Reporting Services

Question: When will the OLEDB driver be available for Reporting Services? In the Marketing Material I noted that Reporting Services can indeed connect to AS/400 through OLEDB. I have tried with all supplied OLEDB drivers and get only errors. The only drivers which work are ODBC and they are dog-slow. I have reviewed most posts on OLEDB drivers for AS/400 or DB2 and most everything points to SSIS. I want to be able to connect to the AS/400 through Reporting Services (SSRS) and report off it via an OLEDB driver instead of ODBC as I am doing it right now. Are there ANY implementable alternatives out there anybody?According to the SQL Server Feature Pack, the Microsoft OLEDB for DB2 driver can be used with Reporting Services.

http://www.microsoft.com/downloads/details.aspx?familyid=50b97994-8453-4998-8226-fa42ec403d17&displaylang=en

OLE DB: How to set the property DBPROP_SSCE_TRANSACTION_COMMIT_MODE correctly?

Hello,

because of the fact that the database sdf-file is stored on a cf-card, i want that all commit transactions will be flushed to the file immediately.
So i want to open the database with the above property. But i don't know the type and value i have to place into the variant. The following code fragment gave me the error "DB_S_ERRORSOCCURRED when i try to set the property with IDBInitialize::SetProperties() :

//Initialize property DBPROP_SSCE_TRANSACTION_COMMIT_MODE
dbprop_ssce_session[0].dwPropertyID = DBPROP_SSCE_TRANSACTION_COMMIT_MODE;
dbprop_ssce_session[0].dwOptions = DBPROPOPTIONS_REQUIRED;
dbprop_ssce_session[0].vValue.vt = VT_I4;
dbprop_ssce_session[0].vValue.lVal = DBPROPVAL_SSCE_TCM_FLUSH;

//Initialize property set DBPROPSET_SSCE_SESSION
dbpropset[1].guidPropertySet = DBPROPSET_SSCE_SESSION;
dbpropset[1].rgProperties = dbprop_ssce_session;
dbpropset[1].cProperties = 1;
//(there is another property for the path not shown here)

I would appreciate it when someone out there knows the answer and could tell me.

Kind regards,
Andre

Your code looks ok. I use the ATL OLE DB Consumer Templates for this and they also set the colid member to DB_NULLID. This is the only thing I see missing from your code.

Other than this, I would also look at the OLE DB error parameters to get more details.

|||

Every thing is okay except that you are setting the property on IDBInitialize. This is a session related property and so should be set using ISessionProperties.

If the question is answered, please mark it as answered.

Thanks

Raja

|||Thanks Raja,

that was exactly the crux of the matter!

Kind regards,
Andre

OLE DB: How to set the property DBPROP_SSCE_TRANSACTION_COMMIT_MODE correctly?

Hello,

because of the fact that the database sdf-file is stored on a cf-card, i want that all commit transactions will be flushed to the file immediately.
So i want to open the database with the above property. But i don't know the type and value i have to place into the variant. The following code fragment gave me the error "DB_S_ERRORSOCCURRED when i try to set the property with IDBInitialize::SetProperties() :

//Initialize property DBPROP_SSCE_TRANSACTION_COMMIT_MODE
dbprop_ssce_session[0].dwPropertyID = DBPROP_SSCE_TRANSACTION_COMMIT_MODE;
dbprop_ssce_session[0].dwOptions = DBPROPOPTIONS_REQUIRED;
dbprop_ssce_session[0].vValue.vt = VT_I4;
dbprop_ssce_session[0].vValue.lVal = DBPROPVAL_SSCE_TCM_FLUSH;

//Initialize property set DBPROPSET_SSCE_SESSION
dbpropset[1].guidPropertySet = DBPROPSET_SSCE_SESSION;
dbpropset[1].rgProperties = dbprop_ssce_session;
dbpropset[1].cProperties = 1;
//(there is another property for the path not shown here)

I would appreciate it when someone out there knows the answer and could tell me.

Kind regards,
Andre

Your code looks ok. I use the ATL OLE DB Consumer Templates for this and they also set the colid member to DB_NULLID. This is the only thing I see missing from your code.

Other than this, I would also look at the OLE DB error parameters to get more details.

|||

Every thing is okay except that you are setting the property on IDBInitialize. This is a session related property and so should be set using ISessionProperties.

If the question is answered, please mark it as answered.

Thanks

Raja

|||Thanks Raja,

that was exactly the crux of the matter!

Kind regards,
Andre

ole db, odbc, mdac what does enterprise manager register server use?

I hear a lot about different ways of pulling data off of sql servers.
When you go to register a server in enterprise manager what method of
data access is it using? ole db, odbc, ?
"tbone" <tony.despain@.gmail.com> wrote in message
news:1139251537.917459.100430@.g44g2000cwa.googlegr oups.com...
>I hear a lot about different ways of pulling data off of sql servers.
> When you go to register a server in enterprise manager what method of
> data access is it using? ole db, odbc, ?
>
My best guess is that it is using the SQL-DMO API. How the API is
connecting, who knows. I would guess that it is either using SQL OLE-DB, or
it may be using DBLib.
Rick Sawtell
MCT, MCSD, MCDBA

ole db, odbc, mdac what does enterprise manager register server use?

I hear a lot about different ways of pulling data off of sql servers.
When you go to register a server in enterprise manager what method of
data access is it using? ole db, odbc, ?"tbone" <tony.despain@.gmail.com> wrote in message
news:1139251537.917459.100430@.g44g2000cwa.googlegroups.com...
>I hear a lot about different ways of pulling data off of sql servers.
> When you go to register a server in enterprise manager what method of
> data access is it using? ole db, odbc, ?
>
My best guess is that it is using the SQL-DMO API. How the API is
connecting, who knows. I would guess that it is either using SQL OLE-DB, or
it may be using DBLib.
Rick Sawtell
MCT, MCSD, MCDBA

ole db, odbc, mdac what does enterprise manager register server use?

I hear a lot about different ways of pulling data off of sql servers.
When you go to register a server in enterprise manager what method of
data access is it using? ole db, odbc, ?"tbone" <tony.despain@.gmail.com> wrote in message
news:1139251537.917459.100430@.g44g2000cwa.googlegroups.com...
>I hear a lot about different ways of pulling data off of sql servers.
> When you go to register a server in enterprise manager what method of
> data access is it using? ole db, odbc, ?
>
My best guess is that it is using the SQL-DMO API. How the API is
connecting, who knows. I would guess that it is either using SQL OLE-DB, or
it may be using DBLib.
Rick Sawtell
MCT, MCSD, MCDBA