在SQL SERVER 2005中为本地和远程位置创建标识列 [英] Creating Identity Column for Local and Remote Location in SQL SERVER 2005

查看:92
本文介绍了在SQL SERVER 2005中为本地和远程位置创建标识列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为远程用户创建一个基于wed的结算系统应用程序,对于内部用户则创建一个基于Windows的计费系统应用程序
两端产生的票据
为了存储账单信息,我在sql server 2005中创建了一个表
作为具有标识(1,1)的Billmaster
现在我面临的问题是,如果从远程以及内部用户插入相同的身份,例如.如果同时从远程用户和内部用户插入了18号帐单,则在合并数据时可能会引起问题
我正在使用合并复制以两种方式传输数据
我希望帐单号是唯一的,并且不能重复
我应该使用哪种身份NewId()
例如. 65D9F929-5BF0-4F19-9706-554958FAF0B1
就唯一票据号而言,它看起来并不标准

请提出您是否有解决方案

I am Creating a Billing system application which based on wed for remote user and windows based for Inhouse users
Bills generated from both ends
To Store the bill information i have created a table in sql server 2005
as Billmaster with identity (1,1)
Now problem i am facing is that if same identity is inserted from Remote as well as Inhouse user For eg. if Bill no 18 is inserted from Remote as well as Inhouse user Then at a time of merging the data it may cause the problem
I am using merge replication to transfer the data in both ways
I want bill number to be unique and not to be duplicated
What kind of identity should i used NewId()
Eg. 65D9F929-5BF0-4F19-9706-554958FAF0B1
doesnt look standard as far as Unique bill number is Concerned

Please suggest if you''ve any solution

推荐答案

关注:
http://www.mssqltips.com /sqlservertip/1600/auto-generation-sql-server-keys-with-the-uniqueidentifier-or-identity/ [
Follow:
http://www.mssqltips.com/sqlservertip/1600/auto-generated-sql-server-keys-with-the-uniqueidentifier-or-identity/[^]


这篇关于在SQL SERVER 2005中为本地和远程位置创建标识列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆