Showing posts with label operation. Show all posts
Showing posts with label operation. Show all posts

Monday, March 19, 2012

DML without logging

Is there a way to stop logging DML? I have a large delete and I dont want to log the operation, is it possible?Truly non-logged operations are not possible in MS-SQL.

The closest you could probably get would be to copy the data to another data source (most probably a file), delete the data there, truncate your original table, then reload the edited data source back into your table.

-PatP|||No...

But you can bcp the data you want to keep, TRUNCATE the TABLE and then bcp the data back in...use native mode (-n)

EDIT: DAMN, sniped again

And Non logged is a misnomer...even TRUNCAT is logged...but at the page level (I think)

Pat?

Sunday, March 11, 2012

Division operator

I'm trying to perform a simple mathematical operation on an integer. The integer is the result of the COUNT() function, I need to divide this by a number, say 5, and then round up that number.

For example, if the result of the operation was 52.4, it would become 53, if it were 52.6 it would be 53 and If it were 52, it would remain 52.

Is this kind of functionality built in to T-SQL ?

The main problem I'm having is that the result of COUNT(blah)/5 returns an integer, and ignores the remainder.

Thanks,
PaulIf you look up "division" in BOL you will get a better understanding of what is happenig.

you might try "cast(count(blah) as float)/5"

Friday, February 17, 2012

Distributed Transaction Persistent Error

When I try to make a distributed transaction, I always get this error:

Server: Msg 7391, Level 16, State 1, Line 14
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].

That is although, I am sure that both servers have active DTC.

Have you verified from Control Panel->Component Services->Computers->My Computer->Properties->Security Configuration that Network DTC access is allowed and other settings on the same tab?

|||

No, I didn't verify that.

Now I checked the Network DTC Access check box in the place you mentioned, but still the same error persistent.

What are the other settings in the same tab that I should check?

Thanks

|||

You may want to check the following to trouble shoot the Distributed transaction errors:

1. Verify there are no MS DTC firewall issues. Please see link: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306843 on how to trouble shoot them.
2. In case the two computers are running in domains or workgroups that do not trust each other, the MSDTC may fail to mutually authenticate. Please see link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cossdk/html/dc45d41e-58f7-412f-834d-fec72e00fc01.asp for more details.

Thanks

Suroor

|||

The matter is very sophisticated.

Isn't there an easier way than that whole sophistication?

What are the settings to allow under MSDTC "Allow Network Access"?

Thanks

|||

http://support.microsoft.com/kb/827805#kb3

http://support.microsoft.com/kb/329332/

HTH