Showing posts with label everybody. Show all posts
Showing posts with label everybody. Show all posts

Sunday, March 25, 2012

AdventureWorksDW

Hi everybody,

I'm searching for a full description of AdventureWorksDW and also its relationship with AdventureWorks database.

Tanx

Hello. I have not found a full documentation but perhaps Books On Line can tell you something.

A short description is that AdventureWorks is the OLTP-version(read transaction system version) of a fictive company that sells bicycles and related equipment on the internet.

AdventureWorksDW is the data warehouse structure of this company's business that include several starschemas /data marts. This structure is for analysis, not for entering transactions. After installing tools and samples, that is part of the SQL Server 2005 installation, you will also find an Aventure Works cube project built on top of the AdventureWorksDW database.

HTH

Thomas Ivarsson

Sunday, March 11, 2012

Advance SQL question

Hello everybody,

i have a advance question about a specific sql problem:

My table A have for example 3 columns.
in the third column are words seperated by ~.

ID COL2 COL3
-----
1 ab test~dummy~ddd
2 cd testdata2~sjhfdg~sdf
3 ef sd~test
4 gh sd~cv

Now i want two lists:

1.) used Values for column 3:

Values
--
test
dummy
ddd
testdata2
sjhfdg
sdf
sd
cv

2.) used values plus ID
Value ID
----
test 1
test 3
sd 3
sd 4
cv 4
dummy 1
...

Is it posible to produce such a list with nearly one SQL -Statement or with
temporaly tables ?

Thanks in advance

T.Kindermann
Database Administrator

--
-----------------------
Thomas Kindermann
E-MAIL: Reply to TKINDER<x>@.GMX.DE without <x>Thomas Kindermann wrote:
> Is it posible to produce such a list with nearly one SQL -Statement ?

Yes, it is possible:

SELECT DISTINCT substring('~' + COL3 + '~', Number + 1,
charindex('~', '~' + COL3 + '~', Number + 1) - Number - 1) AS Value
FROM (
SELECT TOP 250 number
FROM master..spt_values WHERE number>0
GROUP BY number ORDER BY number
) Numbers, TheTable
WHERE Number <= len('~' + COL3 + '~') - 1
AND substring('~' + COL3 + '~', Number, 1) = '~'

SELECT ID, substring('~' + COL3 + '~', Number + 1,
charindex('~', '~' + COL3 + '~', Number + 1) - Number - 1) AS Value
FROM (
SELECT TOP 250 number
FROM master..spt_values WHERE number>0
GROUP BY number ORDER BY number
) Numbers, TheTable
WHERE Number <= len('~' + COL3 + '~') - 1
AND substring('~' + COL3 + '~', Number, 1) = '~'

This queries work with up to 250 words in each row.

However, it may be better to use other ways. For more informations, see
this excellent article by Erland Sommarskog, SQL Server MVP:
http://www.sommarskog.se/arrays-in-sql.html#tblnum-core

Razvan|||Am 23 Jun 2005 02:39:18 -0700 schrieb Razvan Socol:

> Thomas Kindermann wrote:
>> [1 zitierte Zeile ausgeblendet]
> Yes, it is possible:
> SELECT DISTINCT substring('~' + COL3 + '~', Number + 1,
> charindex('~', '~' + COL3 + '~', Number + 1) - Number - 1) AS Value
> FROM (
> SELECT TOP 250 number
> FROM master..spt_values WHERE number>0
> GROUP BY number ORDER BY number
> ) Numbers, TheTable
> WHERE Number <= len('~' + COL3 + '~') - 1
> AND substring('~' + COL3 + '~', Number, 1) = '~'
> SELECT ID, substring('~' + COL3 + '~', Number + 1,
> charindex('~', '~' + COL3 + '~', Number + 1) - Number - 1) AS Value
> FROM (
> SELECT TOP 250 number
> FROM master..spt_values WHERE number>0
> GROUP BY number ORDER BY number
> ) Numbers, TheTable
> WHERE Number <= len('~' + COL3 + '~') - 1
> AND substring('~' + COL3 + '~', Number, 1) = '~'
> This queries work with up to 250 words in each row.
> However, it may be better to use other ways. For more informations, see
> this excellent article by Erland Sommarskog, SQL Server MVP:
> http://www.sommarskog.se/arrays-in-sql.html#tblnum-core
> Razvan

GENIAL SUPER,

you are my good ;-))))))))

Thanks

Thomas
--
-----------------------
Thomas Kindermann
E-MAIL: Reply to TKINDER<x>@.GMX.DE without <x>

Tuesday, March 6, 2012

Adodb.field error 80020009 in my code

Hi everybody,

I really don't find the bug in my code. It returns Adodb.field error '80020009'. I tried various things but it don't works. Can U look at my code and find the bug....

-------------------
My connection object is 'dbconn'
My object query is 'rssqlselect_clients'
---------------------

<form name="monform">
<select name="listeA" onchange=changeliste()>
<option value=0>Choisit une liste</option>


<% rssqlselect_clients.moveFirst
while not rssqlselect_clients.eof %>

<% while not t > c %>

<option value=<%= t %>>Liste <%


response.write rssqlselect_clients("nomclient")
%> </option>

<%

t = t + 1

wend %>



<%rssqlselect_clients.moveNext
wend
rssqlselect_clients.close
Dbconn.close%>

------------

Thank U very much.

BaRRonWhat line of script is generating your error?

Monday, February 13, 2012

ADO & C++ return values after error

Hi everybody,
i've a problem calling a sql sp from my c++ component, if i
voluntarily crash the sp (for example try to insert a null value where
is not allow) return value are all blank and isn't possible for me to
understand correctly the problem
here you are sp:
CREATE PROCEDURE SP_TEST_RETURN_VALUE
(
@.ErrNum INT OUTPUT,
@.ErrMsg varchar(256) OUTPUT
)
AS
BEGIN
DECLARE @.PatientCode int
SET @.ErrNum = 999
SET @.ErrMsg = 'Empty'
BEGIN TRANSACTION
INSERT INTO TabellaTest( [INDEX], CampoTest)
VALUES ( @.PatientCode, NULL) -- Not CampoTest not allow a null
value!!
SET @.ErrNum = @.@.ERROR
IF @.ErrNum > 0 BEGIN
SET @.ErrMsg = 'ERROR (pos 2)'
goto abort_transaction
END
COMMIT TRANSACTION
RETURN 0
abort_transaction:
ROLLBACK TRANSACTION
RETURN -1
END
GO
here you are the call from c++:
.............
try
{
olehr = accessor.Open(dataSource.GetSession(),
_T("{? = call dbo.SP_TEST_RETURN_VALUE;1 (?,?) }") );
// if fail value is 0 not -1!!
result = accessor.m_RETURNVALUE;
// IF FAIL the 2 memeber below contain wrong value
//accessor.m_ErrNum;
//accessor.m_ErrMsg;
if (FAILED(olehr())) _com_issue_error(olehr());
} // end try
catch (_com_error &e)
{
char * descr = (char*) e.Description();
char * msg = (char*) e.ErrorMessage();
accessor.Close();
}
it seems that the sp fail make the rollback but not se any values into
in/out parameters.
Please help me......Put SET NOCOUNT ON as the first statement in the sp.
CREATE PROCEDURE SP_TEST_RETURN_VALUE
(
@.ErrNum INT OUTPUT,
@.ErrMsg varchar(256) OUTPUT
)
AS
set nocount on
DECLARE @.PatientCode int
SET @.ErrNum = 999
SET @.ErrMsg = 'Empty'
BEGIN TRANSACTION
INSERT INTO TabellaTest( [INDEX], CampoTest)
VALUES ( @.PatientCode, NULL) -- Not CampoTest not allow a null
value!!
SET @.ErrNum = @.@.ERROR
IF @.ErrNum > 0 BEGIN
SET @.ErrMsg = 'ERROR (pos 2)'
goto abort_transaction
END
COMMIT TRANSACTION
RETURN 0
abort_transaction:
ROLLBACK TRANSACTION
RETURN -1
GO
AMB
"Matteo" wrote:

> Hi everybody,
> i've a problem calling a sql sp from my c++ component, if i
> voluntarily crash the sp (for example try to insert a null value where
> is not allow) return value are all blank and isn't possible for me to
> understand correctly the problem
> here you are sp:
> CREATE PROCEDURE SP_TEST_RETURN_VALUE
> (
> @.ErrNum INT OUTPUT,
> @.ErrMsg varchar(256) OUTPUT
> )
> AS
> BEGIN
> DECLARE @.PatientCode int
> SET @.ErrNum = 999
> SET @.ErrMsg = 'Empty'
> BEGIN TRANSACTION
> INSERT INTO TabellaTest( [INDEX], CampoTest)
> VALUES ( @.PatientCode, NULL) -- Not CampoTest not allow a null
> value!!
> SET @.ErrNum = @.@.ERROR
> IF @.ErrNum > 0 BEGIN
> SET @.ErrMsg = 'ERROR (pos 2)'
> goto abort_transaction
> END
> COMMIT TRANSACTION
> RETURN 0
> abort_transaction:
> ROLLBACK TRANSACTION
> RETURN -1
> END
> GO
> here you are the call from c++:
> ..............
> try
> {
> olehr = accessor.Open(dataSource.GetSession(),
> _T("{? = call dbo.SP_TEST_RETURN_VALUE;1 (?,?) }") );
> // if fail value is 0 not -1!!
> result = accessor.m_RETURNVALUE;
> // IF FAIL the 2 memeber below contain wrong value
> //accessor.m_ErrNum;
> //accessor.m_ErrMsg;
> if (FAILED(olehr())) _com_issue_error(olehr());
> } // end try
> catch (_com_error &e)
> {
> char * descr = (char*) e.Description();
> char * msg = (char*) e.ErrorMessage();
> accessor.Close();
> }
>
> it seems that the sp fail make the rollback but not se any values into
> in/out parameters.
> Please help me......
>|||Wow, thanks a lot it seems to be working fine...... I've another
question (if you have another bit time for me!)
As you can see there is a try-catch block, every time the sp crash the
e.Description return "IDispatch Error #3092", i expect that in this
member is store the error description related to e.Error member (which
contain the error code), but indeed there is always the message above,
do you know something about it? Thanks.
Matteo
"examnotes" <AlejandroMesa@.discussions.microsoft.com> wrote in messa
ge news:<B4E1BBA4-BB85-4D27-8BB0-16A1D4618CA3@.microsoft.com>...
> Put SET NOCOUNT ON as the first statement in the sp.
> CREATE PROCEDURE SP_TEST_RETURN_VALUE
> (
> @.ErrNum INT OUTPUT,
> @.ErrMsg varchar(256) OUTPUT
> )
> AS
> set nocount on
> DECLARE @.PatientCode int
> SET @.ErrNum = 999
> SET @.ErrMsg = 'Empty'
> BEGIN TRANSACTION
> INSERT INTO TabellaTest( [INDEX], CampoTest)
> VALUES ( @.PatientCode, NULL) -- Not CampoTest not allow a null
> value!!
> SET @.ErrNum = @.@.ERROR
> IF @.ErrNum > 0 BEGIN
> SET @.ErrMsg = 'ERROR (pos 2)'
> goto abort_transaction
> END
> COMMIT TRANSACTION
> RETURN 0
> abort_transaction:
> ROLLBACK TRANSACTION
> RETURN -1
> GO
>
> AMB
>
> "Matteo" wrote:
>|||sorry, in my previous mail i described a new problem, but the member
that contain "IDispatch Error #3092" is nor e.Desciption, but
e.ErrorMessage!!! I'm sorry...
mbellardi@.ferraniait.com (Matteo) wrote in message news:<3c42a11c.0504220511.4152e939@.posti
ng.google.com>...
> Hi everybody,
> i've a problem calling a sql sp from my c++ component, if i
> voluntarily crash the sp (for example try to insert a null value where
> is not allow) return value are all blank and isn't possible for me to
> understand correctly the problem
> here you are sp:
> CREATE PROCEDURE SP_TEST_RETURN_VALUE
> (
> @.ErrNum INT OUTPUT,
> @.ErrMsg varchar(256) OUTPUT
> )
> AS
> BEGIN
> DECLARE @.PatientCode int
> SET @.ErrNum = 999
> SET @.ErrMsg = 'Empty'
> BEGIN TRANSACTION
> INSERT INTO TabellaTest( [INDEX], CampoTest)
> VALUES ( @.PatientCode, NULL) -- Not CampoTest not allow a null
> value!!
> SET @.ErrNum = @.@.ERROR
> IF @.ErrNum > 0 BEGIN
> SET @.ErrMsg = 'ERROR (pos 2)'
> goto abort_transaction
> END
> COMMIT TRANSACTION
> RETURN 0
> abort_transaction:
> ROLLBACK TRANSACTION
> RETURN -1
> END
> GO
> here you are the call from c++:
> .............
> try
> {
> olehr = accessor.Open(dataSource.GetSession(),
> _T("{? = call dbo.SP_TEST_RETURN_VALUE;1 (?,?) }") );
> // if fail value is 0 not -1!!
> result = accessor.m_RETURNVALUE;
> // IF FAIL the 2 memeber below contain wrong value
> //accessor.m_ErrNum;
> //accessor.m_ErrMsg;
> if (FAILED(olehr())) _com_issue_error(olehr());
> } // end try
> catch (_com_error &e)
> {
> char * descr = (char*) e.Description();
> char * msg = (char*) e.ErrorMessage();
> accessor.Close();
> }
>
> it seems that the sp fail make the rollback but not se any values into
> in/out parameters.
> Please help me......

Sunday, February 12, 2012

Administrator cannot see administration toolbar, buttons and shortcuts on Report Manager

Hy everybody.

I have recently installed from scratch RS 2003 on a WIN2003 SRV and got that the problem that the administrator cannot access or even see the regular administration toolbar and links at the Report Manager, such as Site Configuration, Upload New File, the common 'Contents | Properties ' tab, among other stuff. The only options available are 'Home', 'My Subscriptions' and 'Help', in the right superior link bar. I find this behaviour very strange, since the RS comes right out of the box configured with full access to administrator, but right now I CAN'T do any administration task on the RS Server.

Another strange behaviours I've found:
- The few links that appear redirect to the internal ip address of the server.
- When you call the '/ReportServer/ReportingService.asmx' it returns an XML document, not the usual browsing interface.

There's some information about the server configuration I think it might help:
- IIS is running more than one website, and the RS server is not installed on the Default WebSite, wich is stopped.
- SharePoint Services is running in the server, but not in the DefaultWebSite.
- The security settings of the virtual directory of the Report Manager are configured to use Windows Authentication and are NOT configured to use anonymous authentication.
- The server is published to the Internet.

There's some stuff that I tried and for now didn't worked:
- Create the virtual directories in other websites.
- Switch the attributes of the 'impersonate' attribute in Web.config file between true and false.
- Enable anonymous authentication and use the administrator account to impersonate.
- The steps described in the help article 'Troubleshooting a Side-by-Side Installation of Reporting Services and Windows SharePoint Services'
- Reinstalling the RS product.

I really hope you guys can help me with this.

Thanks in advance.
JCAlthough you said your Report Manager is configured for WIndows auth, is your Report Server directory the same way? Anonymous is not on either one?