identity

Modifying my website to allow anonymous comments

I write the code for my own website as an educational/fun exercise. Right now part of the website is a blog (like every other site out there :-/) which supports the usual basic blog features, including commenting on posts. But I only have comments enabled for logged-in users; I want to alter the code to allow anonymous comments - that is...

.NET One Hop Rule and SharePoint Webparts

Hi I have a SharePoint webpart which is compiled as a DLL and placed in the BIN folder of my SP site. My webpart works on my local machine, but when I put it on production it fails with a (401) Unauthorized. After doing some research I came acrooss what is known as the "One hop rule". Meaning I have to either pass in the credential...

Reset Identity column in SQL Server

Hello everyone! I am making an SQL database that stores contacts. I want to be able to delete contacts, and the correct id for each contact is crucial for my software connecting to it. Lets say I have contact James and he is the first one. His id is 0. I add Mary and her id is 1. If I delete James, how can Mary's id be set to 0 instead o...

How should I go about implementing an "autonumber" field in SQL Server 2005?

I'm aware of IDENTITY fields but I have a feeling that I couldn't use one to solve my problem. Let's say I have multiple clients. Each client has multiple orders. Each client needs to have their orders numbered sequentially, specific to them. Example table structure: Orders: OrderID | ClientID | ClientOrderID | etc... Some example...

In an SSIS package, how do you insert master-detail records?

I have a data flow task that extracts data from one database and inserts into a SQL Server database. After each record is inserted in the master row I also need to insert rows into a detail table. The data for the detail table is pretty simple and can be calculated. How do I retrieve the value of the identity column after inserting? Ho...

Can I use a SQL Server identity column to determine the inserted order of rows?

I need to be able to determine the order which rows have been inserted into a table (there are no updates). Can I use an identity column to do this? I know that there may be gaps, but are the values guaranteed to be increasing by insertion order? ...

Confirming a user is the Wikipedia user they say they are?

Quite hard to describe, but if a user on my site said they were the Wikipedia user "example" what would be the best way of confirming they are indeed that Wikipedia user & not an imposter? Hope that makes sense?! ...

Database-wide unique-yet-simple identifiers in SQL Server

First, I'm aware of this question, and the suggestion (using GUID) doesn't apply in my situation. I want simple UIDs so that my users can easily communicate this information over the phone : Hello, I've got a problem with order 1584 as opposed to hello, I've got a problem with order 4daz33-d4gerz384867-8234878-14 I want...

SQL server identity column values start at 0 instead of 1

Hi, I've got a strange situation with some tables in my database starting its IDs from 0, even though TABLE CREATE has IDENTITY(1,1). This is so for some tables, but not for others. It has worked until today. I've tried resetting identity column: DBCC CHECKIDENT (SyncSession, reseed, 0); But new records start with 0. I have tried doi...

T-SQL EXEC and scope

Let's say I have a stored procedure with this in its body: EXEC 'INSERT INTO ' + quotename(@table) ' blah...' SELECT IDENT_CURRENT('' + @table + '') Is IDENT_CURRENT() guaranteed to get the identity of that row INSERTed in the EXEC? IDENT_CURRENT() "returns the last identity value generated for a specific table in any session and any ...

Can't perform Create, Update or Delete operations on Table because it has no primary key

Hello! I've been trying to insert row in the table having an identity column RequestID (which is primary key as well) HelpdeskLog logEntry = new HelpdeskLog { RequestBody = message.Body }; if (attachment != null) logEntry.Attachments = Helper.StreamToByteArray(attachment.ContentStream); Database.HelpdeskLogs.InsertO...

How to change identity column values programmatically?

I have a MS SQL 2005 database with a table Test with column ID. ID is a identity column. I have rows in this table and all of them have their corresponding ID autoincremented value. Now I would like to change every ID in this table like this: ID = ID + 1 But when I do this I get error: Cannot update identity column 'ID'. I've trie...

Strategy for coping with database identity/autonumber maxing out

Autonumber fields (e.g. "identity" in SQL Server) are a common method for providing a unique key for a database table. However, given that they are quite common, at some point in the future we'll be dealing with the problem where they will start reaching their maximum value. Does anyone know of or have a recommended strategy to avoid t...

How to change programmatically non-identity column to identity one?

I have a table with column ID that is identity one. Next I create new non-identity column new_ID and update it with values from ID column + 1. Like this: new_ID = ID + 1 Next I drop ID column and rename new_ID to name 'ID'. And how to set Identity on this new column 'ID'? I would like to do this programmatically! ...

Zend Framework: How best to go about retrieving the first name of an authenticated user?

I can get the username by doing this: public function indexAction() { $this->view->username = Zend_Auth::getInstance()->getIdentity(); } "username" is the column in the table that validates the identity. "firstname" is also a column in that table. Does Zend_Auth only store the username? Or is there a way to access other columns fr...

How come open source applications that are targeted at enterprises, don't have these security features?

It would seem to me that many large enterprises already have robust directory services such as Active Directory and it would be silly to constantly duplicate users in an application-specific store. Even if you require duplicating the user store, you can provide a mechanism to authenticate against Active Directory. Alternatively, you cou...

Identity management/SSO solution?

What are your recommendations for a basic, centralized identity management/SSO service? It must be open source, have a pluggable identity manager (eg: LDAP, DB, openID, etc.) and provide a decent range of API access options (eg: web services, REST, etc.). It must also be clusterable for high availability. JOSSO? CAS? others? ...

changing your company entity and tax ID number for your iphone app that is already approved.

Does anyone know if it is difficult to change your company entity and tax id for an iphone app that has been submitted and approved? ...

Algorithm for determining a file’s identity (Optimisation)

Further to this question: Algorithm for determining a file’s identity Recap: I'm looking for a cheap algorithm for determining a files identity which works the vast majority of the time. I went ahead and implemented an algorithm that gives me a "pretty unique" hash per file. The way my algorithm works is: For files smaller than a c...

HiLo or identity?

Just wanted to get some opinions on primary keys - would it be better to use identity/sequence numbers or use a HiLo strategy (query for the high value and increment the low value on the app itself)? ...