Best alternative for rowversion

We're currently evaluating SQL Server 2014's In-Memory OLTP for our application and saw in the documentation that rowversion is not a supported datatype: http://msdn.microsoft.com/en-us/library/dn133179(v=sql.120).aspx
What's regarded as best practice if we basically want to have the same functionality as rowversion in In-Memory OLTP? Using triggers would be a massive performance decrease for us compared to rowversion.

rowversion isn't a hash,  it's a database-wide durably-monotonically-increasing 8-byte binary value.  So the best way to get similar behavior is to implement your own database-wide durably-monotonically-increasing 8-byte value.
You can do this with a SEQUENCE object. eg
create sequence ts_seq as bigint start with 10000000
This is the same way you generate key values for memory tables, with the difference that this sequence is used to generate timestamp values for multiple tables, instead of key values for a single table.  You can then cast the value to binary(8) or store
it as bigint, as the sort orders are compatible, ie
for bigint a,b   a<b iff cast(a as bigint) < cast(b as bigint)
You can't access the sequence in a native proc, so you'll have to pass it in.  Eg here's how to fill up a memory table variable with sequence values (remember when NEXT VALUE FOR appears in a SELECT you get a new sequence value for each row of the output):
DECLARE @od Sales.SalesOrderDetailType_inmem
SET @DueDate = DATEADD(d, (@i % 10) + 2, @now)
DELETE FROM @od
INSERT @od
SELECT OrderQty, ProductID, SpecialOfferID, LocalID, (next value for ts_seq)
FROM Demo.DemoSalesOrderDetailSeed
WHERE OrderID = @i % @max_OrderID
Of course you must remember to get a new "timestamp" in any operation that inserts or updates the table.
David
David http://blogs.msdn.com/b/dbrowne/

Similar Messages

  • Best alternative for locating lost library & playlists?

    I keep my iTunes audio files on an external hard drive.  I'm not sure if iTunes stores the information (playlists, etc.) on my external or internal hard drive.  I accidently disconnected my hard drive while iTunes was open.  I quickly quit iTunes, reconnected the hard drive, then opened iTunes again - only to find everything gone.  I'm assuming I need to relocate my Library after holding down the OPTION key - but the .xml files are not highlighted - and then I read something about locating the .itl files .... but when I open the .itl file - it gives me a library from a few months ago - not the end of the world - but none of the new music I added to the library since then shows up.
    I have also tried dragging the .xml file directly into iTunes, but I'm still getting the library from two months ago.
    What would be my best bet?  Is there somewhere on either hard drive so I can make a full recovery?  I also have a backup of my computer on Time Machine - but that hard drive is in another location.  Would restoring my system to two days ago via Time Machine be my best best to get everything back?  If so .... maybe I can wait!  In the meantime, any help you have would be GREAT.
    Thank you!!!!!

    Double-clicking on an .itl file opens iTunes, but not necessarily the file that was clicked on. To check the contents of an .itl database you need to connect to it after holding down Option(Mac) or Shift(Win) as you click the icon to start iTunes and are prompted to choose or create a new library.
    If you know where the active library file is then this is the easiest way to restore a recent backup.
    Empty/corrupt library after upgrade/crash
    Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't lose a thing or need to do any further housekeeping. In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
    See MusicFolder Files Not Added and Super Remove Dead Tracks for tools to catch up with any changes since the backup file was created.
    tt2

  • Best alternative for central storage of a NAS

    Hi All,
    I own a macbook pro and an Imac.
    Next to that I use a NAS from QNAP to store my data centrally. That should make it easy to use my data on every device that I have.
    But in reality the NAS is very slow in relation to my apple products. With a windows machine it's fine. But showing up in Finder is a pain in the ash.
    When looking to the competition, also Synology has lots of issues on that part. As can be read on all the user forums.
    So, if I want to have an alternatieve solution with the following features:
    1) Store all my content centrally and use it on my apple products (so data is only on the central location)
    2) Backup the data from my central location to a location that's not in my house (for cases of theft or fire).
    3) Where the connection with the apple products is fast.
    As far as I know there's not something within the apple product range, but that could be my misunderstanding of the product line.

    When I saw 2TB, it triggered these questions:
    ISP
    Sufficient upload/download transfer caps to achieve your goal
    Sufficient bandwidth between you and your cloud services provider to achieve daily backups
    Edge device upgrades for higher bandwidth performance to ISP
    Cloud Services Provider
    Assurance your data remains on servers in your country
    Sufficient storage expandibility and fits expense budget
    Sufficient cloud performance to achieve 1.2, and subquent document access
    Adequate cloud management software interface
    Reviews and other documented evidence of cloud service reliability
    Personal Document Security
    One can place password protected documents in a folder
    With Disk Utility, create new disk image from folder
    Compression
    256-bit AES encryption
    Protection against 2.1 disregard

  • Libretto U100 - Best Alternative for missing Caps Lock Led

    If you are using Windows XP, search the internet for the file keystate.zip. It creates an icon in the systray with a simulated led that goes red when the caps lock are on and black when the caps lock are off.
    If you operate on Windows 98 SE there is an even better Toshiba program: toshled9.exe. It does basicly the same as keystate.zip but it has a much clearer and larger simulated led. In addition toshled9.exe has 4 more on-off icons that you might find usefull. Unfortunately toshled9.exe does not run within Windows XP.

    Hi Frans
    Great posting! Thanks!

  • Alternative for multiple inheritance (AbstractQueue and AbstractList)

    Hello all,
    What is the best alternative for multiple inheritance? I want to make a list, which supports queue operations. Both AbstractQueue en AbstractList are useful, so I would like to use them both, instead of implementing the methods myself or copying the code.
    thanks

    Do you mean you want a class just like LinkedList?
    Why don't you look at the code for LinkedList. Perhaps you could even use it.
    Most Queue methods have trivial implmentations using a List.
    From the source for LinkedList
    public class LinkedList<E>
        extends AbstractSequentialList<E>
        implements List<E>, Queue<E>, Cloneable, java.io.Serializable

  • I'm living in Middle East , there's no face time on my iPhone , what's the NEXT best alternative ??

    Hi
    I have an iPhone 5, iOS 7 , all legit , NO jailbreak
    There's no face time on the phone
    Looks like the local telecom has stopped the use if FaceTime
    So , what's the next best alternative for video calls ?
    I've got Skype installed , but not very happy with video  clarify
    Thanks in advance
    Regards
    Subu

    Thanks wjosten
    I'll wait and see if there are other solutions
    What about the numerous chats / chat apps that are popping up ? Anything has video calling ? Not video sending but live video calling like FaceTime ?
    TIA
    Regards
    Subu

  • The Best Mac For Gaming

    Hi Everyone. I'm sure this topic has come quite a bit, so I'll try to make as short to the point as I can.
    Basically, I have a 2008 black MacBook, and I have recently have gotten into computer gaming. It turns out that my graphic card is horrible for gaming, and I cannot upgrade it.
    Of course, I still want to stick with Macs, so I'm thinking about getting an entire new Mac, and I have a few specific questions.
    Is it better to get a new Mac, or is there some way to upgrade my current Mac that I do not know about?
    If I must get a new one, out of all the Macs, which one is the best for gaming (except the Mac Pro cause that is to expensive)?
    Is there speculation of any new Macs coming out in the near future? Basically, should I wait to get a new one?
    Currently, I'm thinking about getting the 13' MacBook Pro sometime in the next month or so before the student discount goes out.
    Thank you in advance for all your help. I really do appreciate it.

    Lamb,
    Welcome to Apple Discussions.
    Currently the best Mac with the exception of the Mac Pro is the i7 iMac. It offers the most processing power and most powerful GPU. That would probably be your best bet as your current machine with the exception of maxing out the RAM and installing a different HD is about all you can do. The i7 iMac once configured is also not upgradeable with the exception of the RAM. If you want upgradeability and power the Mac Pro is the only Mac alternative.
    BTW per the Terms of Use in these forums we cannot speculate on new Apple products or their decisions on current products. You can find the TofU directly to your right.
    While the 13" MBP is a fine machine it's not really considered the best alternative for gaming, if you want a MBP rather than an iMac then your best bet is probably a i5 15" MBP.
    Regards,
    Roger

  • Whats the best alternative to idvd for burning a disk with pics to play in a dvd player?

    Whats the best alternative to idvd for burning a disk with pics to play in a dvd player? I don't want to deal with older versions of ilife.

    Whats the best alternative to idvd for burning a disk
    In my opinion, there are none.
    Yes, there are other programs that will put a movie on a DVD.   I have tried most of the other substitutes including Toast, Burn, DVD Creator, Wondershare, and others.  None of them come anywhere near the ease-of-use and power of iDVD.
    IDVD is a wonderful piece of software and well worth the low cost of $40.
    http://www.amazon.com/Apple-MC623Z-A-iLife-VERSION/dp/B003XKRZES/ref=sr_1_1?ie=U
    http://dealmac.com/lw/artclick.html?1,527850,1872219

  • What is the best rated flash alternative for iPad?

    What is the best rated alternative for adobe flash for the iPad?
    <Edited by Host>

    If you want ratings, why haven't you gone to the App Store, searched and read the reviews?

  • What is the best limewire alternative for 10.4

    What is the best alternative ti Limewire for Mac OS X 10.4.11.

    None...  Don't use it.  Most that is available via Limewire is illegal, not to mention can open yourself up to hacked versions of software being sent your way.   Get the genuine article from http://www.macupdate.com/ or C!Net's replacement for http://www.versiontracker.com/  Do not use MacKeeper either, as that is malware.

  • HT204053 Is it possible to have two (or more) different icloud mail accounts (not alias) under the same apple id? If not what is you best advice for all family members to have their own e-mail and still share the purchases under the same apple id. Thanks

    Is it possible to have two (or more) different icloud mail accounts (not alias) under the same apple id? If not what is you best advice for all family members to have their own e-mail and still share the purchases under the same apple id. Thanks

    mannyace wrote:
    Thanks for the response.
    So I basically won't run into any trouble? I
    There should be no issues. Its designed to work like that.  You don't change Apple IDs just because you get a new device.
    mannyace wrote:
    Thanks for the response.
    Is there any chance that the phones can fall out of sync?
    Unlikely. But nothing is impossible.   Though I don;t see how that would happen. As long as both are signed into the Same Apple ID / iCloud Account they will be N'Sync. (Bad Joke)
    mannyace wrote:
    Thanks for the response.
    If I get a message or buy an app or take a photo on the iPhone 5, how do I get those things onto the iPhone 6?
    If you buy an App, you have 2 ways to get it to the iPhone6: If Automatic Downloads is enabled in Settings->iTunes & App Store, it will automatically download to the iPhone 6 when you buy it on the 5 and vice versa if you buy it on the 6, it will download to the 5.
    Alternatively, you can simply go to the App Store App->Updates->Purchased and look for the App there and download it. Purchased Apps will not require payment again. i.e They'll be free to download to the iPhone 6 once purchased.
    SMS Messages will sync over using Continuity as long as they are on the same Wifi network. Otherwise, restoring the iPhone 5 backup to the iPhone 6 will transfer all messages received up until the backup was made onto the iPhone 6.
    Images, can be transferred either through Photo Stream
    My Photo Stream FAQ - Apple Support
    Or any Cloud service you want such as Dropbox, or One Drive.
    mannyace wrote:
    Also, something i forgot to ask initially: Should I update the iPhone 5 to iOS 8 first or does that not matter?
    If you want the Continuity features as explained above you need to update the iPhone 5 to iOS 8. Otherwise its not all that important.

  • How do I sync 'on my mac' calendar in ical with icloud or an alternative for my iphone?

    I'm using Outlook 2011  with 2 IMAP email addresses, a business email and a gmail address.  The only reason I'm using Outlook instead of Mail, Address Book and iCal is because there were issues with me receiving meeting invites from business colleagues.  Anyway, now I'm using Outlook, my contacts & calendar are no longer synchronising with my iPhone (4).  I'm using the Outlook synch services to copy the Contact info to Address Book and the calendar info to iCal. BUT, the calendar in iCal is 'On My Mac' and doesnt get picked up by iCloud. 
    Can anyone help with simple suggestions for a wireless solution for keeping Outlook calendar in synch with my phone?  Would upgrading my email account to Exchange be a solution?

    Thanks Winston.  I'm aware that the 'on my mac' calendar doesn't get picked up by iCloud.  I'm wondering whether anyone can help with the best alternative solution for synchronisation of phone and Outlook.

  • Networking "best practice" for setting up a farm

    Hi all.
    We would like to set an OracleVM farm, and I have a question about "best practice" for
    configuring the network. Some background:
    - The hardware I have is comprised of machines with 4 gig-eth NICs each.
    - The storage will be coming primarily from a backend NAS appliance (Netapp, FWIW).
    - We have already allocated a separate VLAN for management.
    - We would like to have HA capable VMs using OCFS2 (on top of NFS.)
    I'm trying to decide between 2 possible configurations. The first would keep physical separation
    between the mgt/storage networks and the DomU networks. The second would just trunk
    everything together across all 4 NICs, something like:
    Config 1:
    - eth0 - management/cluster-interconnect
    - eth1 - storage
    - eth2/eth3 => bond0 - 8021q trunked, bonded interfaces for DomUs
    Config 2:
    - eth0/1/2/3 => bond0
    Do people have experience or recommendation about the best configuration?
    I'm attracted to the first option (perhaps naively) because CI/storage would benefit
    from dedicated bandwidth and this configuration might also be more secure.
    Regards,
    Robert.

    user1070509 wrote:
    Option #4 (802.3ad) looks promising, but I don't know if this can be made to work across
    separate switches.It can, if your switches support cross-switch trunking. Essentially, 802.3ad (also known as LACP or EtherChannel on Cisco devices) requires your switch to be properly configured to allow trunking across the interfaces used for the bond. I know that the high-end Cisco and Juniper switches do support LACP across multiple switches. In the Cisco world, this is called MEC (Multichassis EtherChannel).
    If you're using low-end commodity-grade gear, you'll probably need to use active/passive bonds if you want to span switches. Alternatively, you could use one of the balance algorithms for some bandwitch increase. You'd have to run your own testing to determine which algorithm is best suited for your workload.
    The Linux Foundation's Net:Bonding article has some great information on bonding in general, particularly on the various bonding methods for high availability:
    http://www.linuxfoundation.org/en/Net:Bonding

  • What are the best alternatives to Mail on a Mac?i

    After all the problem with Maverick and Apple Mail I want to change to a nother mail application.
    Apple Mail keep on jamming my iMac System (yes I installed the so called fix), using up to 2,5 GB of memory, lossing mails or give older mails as a blanc page.
    Mozilla Thunderbird, Outlook or other?
    What are the best alternatives?

    Never had problems whit Apple Mail. Till I updated to Maverick.
    First problam was Gmail after updating to Mavericks, Apple mail went to download all my old mail's over 6800. Just delleted my Gmail account form the list to stop it.
    Second issuu memory.
    First dit not now what was te problem till I found out that Apple Maill took over al my memory. Try differened tip and trick of the Apple Forums. This one works the best. Other users had the same problem after Mavericks.
    I restore my Accounts.plist form before the Maverick update.
    Looked whit TextWrangler but what am i lookong for? Do not know how is supposed to look.
    Size of Accounts.plist on 11/18 1.7MB
    Size of Accounts.plist on 23/18 3.0MB
    Hoping for the best ....

  • What are the best practices for using the enhancement framework?

    Hello enhancement framework experts,
    Recently, my company upgraded to SAP NW 7.1 EhP6.  This presents us with the capability to use the enhancement framework.
    A couple of senior programmers were asked to deliver a guideline for use of the framework.  They published the following statement:
    "SAP does not guarantee the validity of the enhancement points in future releases/versions. As a result, any implemented enhancement points may require significant work during upgrades. So, enhancement points should essentially be used as an alternative to core modifications, which is a rare scenario.".
    I am looking for confirmation or contradiction to the statement  "SAP does not guarantee the validity of enhancement points in future releases/versions..." .  Is this a true statement for both implicit and explicit enhancement points?
    Is the impact of activated explicit and implicit enhancements much greater to an SAP upgrade than BAdi's and user exits?
    Is there any SAP published guidelines/best practices for use of the enhancement framework?
    Thank you,
    Kimberly
    Edited by: Kimberly Carmack on Aug 11, 2011 5:31 PM

    Found an article that answers this question quite well:
    [How to Get the Most From the Enhancement and Switch Framework as a Customer or Partner - Tips from the Experts|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c0f0373e-a915-2e10-6e88-d4de0c725ab3]
    Thank you Thomas Weiss!

Maybe you are looking for