Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Wednesday, March 28, 2012

Mssql - Mysql

Hi!

As a newbie I'm wondering if there is a difference between mySql and msSql.

Will mySql -code and -tables work in a msSql database?

Thank you!

Hi !

Well...thats depends. The code ported from mysql ill work if you only used the ANSI SQL compliant features. if you use any specific keywords or features of MySQL you will get a compilation / syntax error because SQL Server won′t know of these keyewords (like LIMIT). The relational data itself it compatible with SQL Server as you find an appropiate matching data type at SQL Server. Data Types differ in the different system, so while importing data in SQL Server you will have to decide how to convert (or match) the data(-types).

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Wednesday, March 21, 2012

msmdpump, how does it work?

I am using AS2000, i have msmdpump setup properly and its working fine, but when i look at the code of msolap.asp i was confused as to how is the mdx query passed to msmdpump.dll as i couldn't see any parameters being passed to msmdpump, i could just find

//no parameter passed here

pump.ReadData

So how does msmdpump know as to which mdx query it has to process?. I badly need to find out which mdx query is the msmdpump processing ,or which dimensions it is querying.

I took a dump of the data being posted to the msolap.asp page from an excel client by writing an isapi filter and writing the data on the SF_NOTIFY_READ_RAW_DATA event,here it is

--

 R E Q U E S T = H ; S T A T E = 0 ; T Y P E = b ; N A M E = FoodMart 2000 ; V E R = 2 4 8 ; L A S T = N ; T Y P E = m ; N A M E = Sales; V E R = 4 4 0 ; L A S T = Y ; D V E R = 3 8 8 ; C V E R = 0 ; POST /msolap.asp HTTP/1.1

User-Agent: Light DCube

Host: localhost:8080

Content-Length: 268

Connection: Keep-Alive

Cache-Control: no-cache

Cookie: ASPSESSIONIDQASQBQST=BOFBOCMCIMPOFJEECELBGBJD

 R E Q U E S T = H ; S T A T E = 0 ; T Y P E = b ; N A M E =FoodMart 2000 ; V E R = 2 4 8 ; L A S T = N ; T Y P E = m ; N A M E = HR ; V E R = 4 4 1 ; L A S T = Y ; D V E R = 4 0 4 ; C V E R = 0 ; POST /msolap.asp HTTP/1.1

User-Agent: Light DCube

Host: localhost:8080

Content-Length: 252

Connection: Keep-Alive

Cache-Control: no-cache

Cookie: ASPSESSIONIDQASQBQST=BOFBOCMCIMPOFJEECELBGBJD

I couldn't make anything out of it though

I also tried referencing msmdpump.dll to a .net project and i could see functions like

OnStartPage(object piUnk) .

looked to me as if piUnk is a reference to some asp com object interface, but don't know for sure.

Any help is appreceiated

In AS2000, the MDX query is not passed from the client to the server. Client code, i.e. msolap80.dll does all the parsing etc. The communication with server happens on much lower level.|||

Thanks for the reply , so is there anyway to know which mdx query is being passed to the as2000 server to process, or if that's not possible, then is it possible to know which dimension is the client trying to access.

Actually the problem is that we have as2000 server in domain A ,the webserver is in domain B and the users are in domain C.

Now B trusts C, A trusts B. We want to give users in C direct permission to the cubes so we have setup msmdpump. But the problem is that we want the users in C to have access to only a particular value of a dimension ,say dimRestricted, and since A doesn't know the users in C, we can't directly add users in C to the AS2000 client roles. So we have created users in B and have added them to the roles in AS2000 server,one for each value of dimRestricted(the number of entries in dimRestricted is constant and is less then 10).When a client from C tries to access the cubes we check whether he has access to the cube and depending on the dimension of dimRestricted which he is trying to access we impersonate the corresponding user in domain B.

But for that to happen we need to find out the value of dimRestricted dimension the client is trying to access.

Any clues or hints are well appreciated.

|||I suggest that you create a mapping between users in domain C and users in domain B. This way, when user from C is authenticated - you will be able to map him to user in domain B. The mapping will work purely on user per user basis, and won't need to know anything about cubes or dimensions.|||

Thanks for the quick reply,

That's pretty much what we are doing, so what we have is that we have AD groups in C each of which is supposed to have access to a particular value of dimension dimRestricted and a corresponding user in Domain B to which we give access to that value of dimRestricted dimension.

So suppose we have AD group named C1 in C , which is supposed to have access to value "panasonic" in dimension dimRestricted, so there is a corresponding user B1

in B which only has access to panasonic value in dimRestricted.

Similarly we have AD group named C2 in C , which is supposed to have access to value "samsong" in dimension dimRestricted, so there is a corresponding user B2 in B which only has access to samsong value in dimRestricted.

But now there can be a special user who might be both in C1 and C2, the code just checks that if user belongs to C1 then impersonate to B1 ,if C2 then B2. Now if he requests to see Measures for dimension "panasonic" , he would be impersonated to B1 and everything would be fine, but what if he tries to see for "samsong", our code does't knows which dimension he is trying to access and would again impersonate to B1 and he would not get any data whereas he should.

So we need to know which value of dimRestricted he is trying to access.

Thanks for the help.

|||My suggestion was that you have true one-to-one mapping between users in C and in B. If you have user C3 which should belong to two different roles, you need to create corresponding user B3, who will belong to these two roles, and then when you detect C3, you impersonate B3. I.e. you map user to user, not group to user. There is a management overhead with this solution, but this is the only way you can get it working with AS2000.|||

Thanks for the reply,

Yes that's what we are planning to do, and its specifically for this huge number of users that we might have to create in domain B(for which we may not even get permission) that i was looking for finding some way out of finding the dimension that the client is accessing .

Thanks anyways!.

Msgbox/Breakpoints not working in a script component.

In the code behind the Script Transformation component, neither the MsgBox nor any of the breakpoints seem to work. Am I missing to do something in order for these to get executed?

Thanks.

Andy.

No, you're right. Breakpoints and msgboxes do not work in script components.

-Jamie

|||So how do we debug code?|||

Best way is to throw information events that appear in the output window.

I can't remember the syntax offhand but if you type "Me." intellisense will guide you.

Thinking about it I think its "Me.FireInformation(...)"

-Jamie

Monday, March 12, 2012

Msg 226, Level 16, State 6, Line 4 ALTER DATABASE statement not al

Is this the entire code? Try by only selecting these lines before executing
it.
ML
http://milambda.blogspot.com/Yeah this code right here generates the error. I suspect it has to do with
the fact that I have to use the brakets because our company databases are
all numeric digits.
"ML" <ML@.discussions.microsoft.com> wrote in message
news:5227DBBD-7BB7-4A71-B859-24F2A5435C33@.microsoft.com...
> Is this the entire code? Try by only selecting these lines before
> executing it.
>
> ML
> --
> http://milambda.blogspot.com/

Saturday, February 25, 2012

MSDTC fails on Windows 2003 but security has been reset so its not that.

I am running SQL Server 2000 (clustered server) with Windows 2003. For some reason MSDTC is failing on distributed transactions. I can run code that begins and commits a transaction from query analyzer, or run a stored procedure from Query Analyzer with the same code in it and both work great, but if I call the stored procedure from a DTS job, then the job fails with the following error:

DTSStep_DTSExecuteSQLTask_1, Error = -2147217900 (80040E14) Error string: The operation could not be performed because the OLE DB provider 'MSDASQL' was unable to begin a distributed transaction. Error source: ..... Error string: OLE DB error trace [OLE/DB Provider 'MSDASQL' ITransactionJoin::JoinTransaction returned 0x8004d00a]. Error source: Microsoft OLE DB Provider for SQL Serve. The step failed.

Any help would be appreciated!Ensure MSDTC is started on the machine.
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=3451 for your reference.

MSDTC error

Hi,
I have econnection code in front end app to do the update. I got the
following error,
The transaction manager has disabled its support for remote/network
transaction...
I checked app server the MSDTC has enabled
Any ideas why?
ThanksRead the replies...think youre answer in there.
Just google my friend ;)
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230390&SiteID=1
First verify the "Distribute Transaction Coordinator" Service is
running on both database server computer and client computers
1. Go to "Administrative Tools > Services"
2. Turn on the "Distribute Transaction Coordinator" Service if it is
not running
If it is running and client application is not on the same computer as
the database server, on the computer running database server
1. Go to "Administrative Tools > Component Services"
2. On the left navigation tree, go to "Component Services > Computers
> My Computer" (you may need to double click and wait as some nodes
need time to expand)
3. Right click on "My Computer", select "Properties"
4. Select "MSDTC" tab
5. Click "Security Configuration"
6. Make sure you check "Network DTC Access", "Allow Remote Client",
"Allow Inbound/Outbound", "Enable TIP" (Some option may not be
necessary, have a try to get your configuration)
7. The service will restart
8. BUT YOU MAY NEED TO REBOOT YOUR SERVER IF IT STILL DOESN'T WORK
(This is the thing drove me crazy before)
On your client computer use the same above procedure to open the
"Security Configuration" setting, make sure you check "Network DTC
Access", "Allow Inbound/Outbound" option, restart service and computer
if necessary.
On you SQL server service manager, click "Service" dropdown, select
"Distribute Transaction Coordinator", it should be also running on
your server computer.
Hope it helps,|||the server is virtual server running window 2000 terminal
"mecn" <mecn2002@.yahoo.com> wrote in message
news:%23myijFJ8HHA.1484@.TK2MSFTNGP06.phx.gbl...
> Hi,
> I have econnection code in front end app to do the update. I got the
> following error,
> The transaction manager has disabled its support for remote/network
> transaction...
> I checked app server the MSDTC has enabled
> Any ideas why?
> Thanks
>