Thursday, March 29, 2012
Distributed queries
I am trying to execute the query
select CodRicerca AS codice, PrezzoEuro,ArticoloID,UnitaMisuraID from (
select * from dbo.vArticoliBaseAggiornamentiListini where PrecodiciID=3D
36966 and ArticoliCodificheTipoID=3D 1 and ListinoID=3D
1 ) as vArticoliBaseAggiornamentiListini INNER JOIN
OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data
Source=3D"W:\Clipparts\Bin\..\Data\\Listino.mdb";J et OLEDB:System
database=3D"W:\Clipparts\Bin\..\Data\\CLIPUSERS.MD W";User
ID=3Daaaa;Password=3D123456789')...[listini] as ClipListino on
ClipListino.CodRicerca=3DArticoliCodificheArticolo COLLATE
database_default where ClipListino.IdLineaProdotto=3D 959 and
(ArticoliListiniDataVigore<CAST('2006-04-04 00:00:00' AS smalldatetime)
or PrezzoEuro<>ArticoliListiniPrezzo)
But sometimes I get the error
"OLE/DB provider returned message: Impossibile avviare l'applicazione.
Il file di informazioni sul gruppo di lavoro =E8 mancante o aperto in
modo esclusivo da un altro utente."
[The translation shoul be: OLE/DB provider returned message: Cannot
start your application.The workgroup information file is missing or
opened exclusively by another
user]
It does not happen always. I get the error only in some enviroment (but
I can non find under which ).
Sometime the same query works from query analyzer, but does not work if
embedded in an application running on a host other than that running
sqlserver.
thanks in advance for you help
Massimo
After other trials, I found that the problem is on the accout connected
to the server. Some accounts are allowed to make distributed queries
but some other not. More specifically if I use the domain account the
query runs well, if I use SQLServer account it does not work
sql
Distributed queries
I am trying to execute the query
select CodRicerca AS codice, PrezzoEuro,ArticoloID,UnitaMisuraID from (
select * from dbo.vArticoliBaseAggiornamentiListini where PrecodiciID=3D
36966 and ArticoliCodificheTipoID=3D 1 and ListinoID=3D
1 ) as vArticoliBaseAggiornamentiListini INNER JOIN
OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data
Source=3D"W:\Clipparts\Bin\..\Data\\Listino.mdb";Jet OLEDB:System
database=3D"W:\Clipparts\Bin\..\Data\\CLIPUSERS.MDW";User
ID=3Daaaa;Password=3D123456789')...[listini] as ClipListino on
ClipListino.CodRicerca=3DArticoliCodificheArticolo COLLATE
database_default where ClipListino.IdLineaProdotto=3D 959 and
(ArticoliListiniDataVigore<CAST('2006-04-04 00:00:00' AS smalldatetime)
or PrezzoEuro<>ArticoliListiniPrezzo)
But sometimes I get the error
"OLE/DB provider returned message: Impossibile avviare l'applicazione.
Il file di informazioni sul gruppo di lavoro =E8 mancante o aperto in
modo esclusivo da un altro utente."
[The translation shoul be: OLE/DB provider returned message: Cannot
start your application.The workgroup information file is missing or
opened exclusively by another
user]
It does not happen always. I get the error only in some enviroment (but
I can non find under which ).
Sometime the same query works from query analyzer, but does not work if
embedded in an application running on a host other than that running
sqlserver.
thanks in advance for you help
MassimoAfter other trials, I found that the problem is on the accout connected
to the server. Some accounts are allowed to make distributed queries
but some other not. More specifically if I use the domain account the
query runs well, if I use SQLServer account it does not work
Distributed queries
I am trying to execute the query
select CodRicerca AS codice, PrezzoEuro,ArticoloID,UnitaMisuraID from (
select * from dbo.vArticoliBaseAggiornamentiListini where PrecodiciID=3D
36966 and ArticoliCodificheTipoID=3D 1 and ListinoID=3D
1 ) as vArticoliBaseAggiornamentiListini INNER JOIN
OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data
Source=3D"W:\Clipparts\Bin\..\Data\\Listino.mdb";Jet OLEDB:System
database=3D"W:\Clipparts\Bin\..\Data\\CLIPUSERS.MDW";User
ID=3Daaaa;Password=3D123456789')...[listini] as ClipListino on
ClipListino.CodRicerca=3DArticoliCodificheArticolo COLLATE
database_default where ClipListino.IdLineaProdotto=3D 959 and
(ArticoliListiniDataVigore<CAST('2006-04-04 00:00:00' AS smalldatetime)
or PrezzoEuro<>ArticoliListiniPrezzo)
But sometimes I get the error
"OLE/DB provider returned message: Impossibile avviare l'applicazione.
Il file di informazioni sul gruppo di lavoro =E8 mancante o aperto in
modo esclusivo da un altro utente."
[The translation shoul be: OLE/DB provider returned message: Cannot
start your application.The workgroup information file is missing or
opened exclusively by another
user]
It does not happen always. I get the error only in some enviroment (but
I can non find under which ).
Sometime the same query works from query analyzer, but does not work if
embedded in an application running on a host other than that running
sqlserver.
thanks in advance for you help
MassimoAfter other trials, I found that the problem is on the accout connected
to the server. Some accounts are allowed to make distributed queries
but some other not. More specifically if I use the domain account the
query runs well, if I use SQLServer account it does not work
Wednesday, March 21, 2012
Dissociation between DTS and Scheduled Job
I've got a DTS package with a single step that runs an exe via Process Task. The DTS runs fine when I execute it manually, but when I schedule the package, the job says it runs successfully, but does not execute the package. Now, a few facts:
The DTS is owned by user1
The Job is owned by user1
All security credentials match up
The exe is on a network with full unc path specified
SQLAgent service is running in user1's context
All user input is on the actual SQL server, but exe is on network
When I change the DTS from running the exe to performing a simple query, the job executes the DTS just fine. When I move the exe from the network and place it locally on the server, the job still won't execute the DTS. What am I missing here? This is driving me crazy!!Shameless newbie bump...|||View the job history. Click the checkbox to show detail. Is there anything interesting there?
-PatP|||Hi Pat,
The job history tells me that all scheduled runs were successes, that the last step to run was step 1 (the only step), but the run time was one or two seconds. This one step that runs, however, should take between 2 and 3 minutes to complete (and does when DTS is executed manually).
That's all I get from the job history...
TIA|||SQLAgent service is running in user1's context
All user input is on the actual SQL server, but exe is on network
How is that possible?
In all my experience when a DTS package runs when manually executed, it's running under the context of the client, when scheduled, it runs under the context of the server...
Drive mappings and Security have always been the reason as to why the scheduled job fails...
Another reason why I stopped using DTS a long time agao for ANY production processes...
Saturday, February 25, 2012
Displaying a field in SQL Server MSE
I have a long text field in a table. Is there a query that I can execute in Mgt. Studio Express that will display the whole of this field. It is too long to easily see in the table view and SELECT <fieldname> from <tablename> only displays part of the field before displaying ellipses (...).
Many thanks,
This depends on what your data is and how you're displaying it. If the data is an XML document then casting it to XML in the select will allow you to click on it and display nicely formatted XML. If it's just text then management studio has a configurable limit on how much it will display. Go to Tools->Options in the menu bar and navigate to Query Results->SQL Server->Results to Grid and set the Non XML data size for results displayed in a grid and Query Results->SQL Server->Results to Text and set the Maximum number of characters displayed in each column for text results.|||Thanks. This is a VARCHAR(MAX) field. I will try the menu option you recommend.
- A
|||Hi Roger,
I wanted to know how can we convert (cast) the <Long Text> field into XML.
The query below isn't working !!
SELECT CAST(RateSet AS xml) AS Readable, *
FROM Table
That's the right way to do it. Perhaps if you were to elaborate a little on "isn't working"
This works for me:
create table xmlstuff(txt nvarchar(MAX))
insert into xmlstuff values ('some XML')
select CAST(txt AS xml) from xmlstuff
Displaying a field in SQL Server MSE
I have a long text field in a table. Is there a query that I can execute in Mgt. Studio Express that will display the whole of this field. It is too long to easily see in the table view and SELECT <fieldname> from <tablename> only displays part of the field before displaying ellipses (...).
Many thanks,
This depends on what your data is and how you're displaying it. If the data is an XML document then casting it to XML in the select will allow you to click on it and display nicely formatted XML. If it's just text then management studio has a configurable limit on how much it will display. Go to Tools->Options in the menu bar and navigate to Query Results->SQL Server->Results to Grid and set the Non XML data size for results displayed in a grid and Query Results->SQL Server->Results to Text and set the Maximum number of characters displayed in each column for text results.|||Thanks. This is a VARCHAR(MAX) field. I will try the menu option you recommend.
- A
|||Hi Roger,
I wanted to know how can we convert (cast) the <Long Text> field into XML.
The query below isn't working !!
SELECT CAST(RateSet AS xml) AS Readable, *
FROM Table
That's the right way to do it. Perhaps if you were to elaborate a little on "isn't working"
This works for me:
create table xmlstuff(txt nvarchar(MAX))
insert into xmlstuff values ('some XML')
select CAST(txt AS xml) from xmlstuff
Displaying a field in SQL Server MSE
I have a long text field in a table. Is there a query that I can execute in Mgt. Studio Express that will display the whole of this field. It is too long to easily see in the table view and SELECT <fieldname> from <tablename> only displays part of the field before displaying ellipses (...).
Many thanks,
This depends on what your data is and how you're displaying it. If the data is an XML document then casting it to XML in the select will allow you to click on it and display nicely formatted XML. If it's just text then management studio has a configurable limit on how much it will display. Go to Tools->Options in the menu bar and navigate to Query Results->SQL Server->Results to Grid and set the Non XML data size for results displayed in a grid and Query Results->SQL Server->Results to Text and set the Maximum number of characters displayed in each column for text results.|||Thanks. This is a VARCHAR(MAX) field. I will try the menu option you recommend.
- A
|||Hi Roger,
I wanted to know how can we convert (cast) the <Long Text> field into XML.
The query below isn't working !!
SELECT CAST(RateSet AS xml) AS Readable, *
FROM Table
That's the right way to do it. Perhaps if you were to elaborate a little on "isn't working"
This works for me:
create table xmlstuff(txt nvarchar(MAX))
insert into xmlstuff values ('some XML')
select CAST(txt AS xml) from xmlstuff
Friday, February 17, 2012
Display MDX Results in asp.net 2.0
How to connect to a analysis server 2005 cube,execute a mdx query and display result in a aspx page?
Please guide me
Take a look at ADOMD.Net.
Bryan
|||Well, me too am looking for some codes to do this.This might help: http://msdn2.microsoft.com/en-us/library/ms123477.aspx