|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
uniquenessHi
We are developing a licensing application for our application that will license against our database. I am looking for a identifier that will be unique to every database on a SQL server. Thanks, Jaco wrote:
> Hi If I understand you correctly, I believe NEWID() will give you what you > > We are developing a licensing application for our application that will > license against our database. I am looking for a identifier that will be > unique to every database on a SQL server. > > > Thanks, want... Yes thanks that looks like something I can use.
Does a SQL database hold a unique id ike the one in NEWID() that will change for instance if you change the database name or copy the database to a new server? Show quote "Tracy McKibben" wrote: > Jaco wrote: > > Hi > > > > We are developing a licensing application for our application that will > > license against our database. I am looking for a identifier that will be > > unique to every database on a SQL server. > > > > > > Thanks, > > If I understand you correctly, I believe NEWID() will give you what you > want... > > > -- > Tracy McKibben > MCDBA > http://www.realsqlguy.com > > Does a SQL database hold a unique id ike the one in NEWID() that will The values won't change> change > for instance if you change the database name > or copy the database to a new server? You've made a copy of the data. So, no, the data won't change, it's a copy.A You could try something like
Select @@ServerName + '/' + Coalesce(Cast(ServerProperty('InstanceName') as varchar(20)), '*Default*') + '/' + Db_Name() which will change if you change the database name and/or copy it a different instance or server. Tom Show quote "Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message news:%23vBzfn5xGHA.4660@TK2MSFTNGP02.phx.gbl... >> Does a SQL database hold a unique id ike the one in NEWID() that will >> change >> for instance if you change the database name > > The values won't change > >> or copy the database to a new server? > > You've made a copy of the data. So, no, the data won't change, it's a > copy. > > A > |
|||||||||||||||||||||||