identity

SSIS populating cross reference table

独自空忆成欢 提交于 2019-12-04 06:11:45
问题 Destination tables look like this: Source table look like this: Customer CustomerId FirstName LastName Email Address1 Address2 City Zip Person table in destination is a base table (which will later be inherited by new customer table). So I am trying to export a row from one table and populate 3 tables in destination. I managed to do this in following way: Get records from source table (Customer) Create empty AddressId field Populate Address table using OLE DB Command task (it calls stored

On SQL INSERT can I use the identity column for part of the insert data in another column at the same time?

风格不统一 提交于 2019-12-04 05:26:46
问题 CREATE TABLE Table1 : Id int IDENTITY(1,1), PK_Column1 nvarchar(50) Primary Key. INSERT INTO Table1 (PK_Column1) VALUES ('Name'+Id) Result: Id PK_Column1 1 Name1 Is this possible? Or do I need to manage the Id column myself for this to work? 回答1: From the documentation: After an INSERT, SELECT INTO, or bulk copy statement completes, @@IDENTITY contains the last identity value generated by the statement. This applies to all the other identity checkers. You should probably write a little SP to

SCIM (System for Cross-domain Identity Management) library for C#

时光怂恿深爱的人放手 提交于 2019-12-04 03:24:53
The SCIM standard was created to simplify user management in the cloud by defining a schema for representing users and groups and a REST API for all the necessary CRUD operations. It is intended to replace the older SPML protocol. Are there any "mature" C# libraries out there? Most of the stuff I've googled is for Java or else doesn't seem very active. Update: In response to the comment: These libraries are usually of the form: User = new User; User.name = "name"; ... etc ... User.Create; In other words, it hides the underlying implementation by using a model user. That way you don't have to

Violation of Primary Key error on Identity column

无人久伴 提交于 2019-12-04 03:04:21
问题 This is maddening! Code in question has been running for over 5 years. Here's the scoop.... I am doing an INSERT...SELECT into a table with a primary key that is an identity column. I do not specify the key when I insert - SQL Server generates it as expected. I am doing the insert in a stored procedure that I call in a loop (for loop in SSIS, actually). The stored procedure will insert rows in batches (configurable). It might insert 1000 rows at a time or it might insert 50,000 - doesn't

What is the practical use of the identity function in R?

被刻印的时光 ゝ 提交于 2019-12-03 22:05:19
Base R defines an identity function, a trivial identity function returning its argument (quoting from ?identity ). It is defined as : identity <- function (x){x} Why would such a trivial function ever be useful? Why would it be included in base R? Don't know about R, but in a functional language one often passes functions as arguments to other functions. In such cases, the constant function (which returns the same value for any argument) and the identity function play a similar role as 0 and 1 in multiplication, so to speak. I use it from time to time with the apply function of commands. For

POCO's with the new ASP.NET Identity and MVC 5.0 + claims-based Identity

狂风中的少年 提交于 2019-12-03 17:03:06
问题 With the new version of VS 2013 RTM and asp.net mvc 5.0, I’ve decided to try out a few things... Needless to say, a lot has changed. For example, the new ASP.NET Identity is a replacement of the old Membership and (less old) SimpleMembership APIs. In all previous applications I’ve built, I never had the chance to work with Membership or with SimpleMembership. I’ve always ended up creating my own Login() method which would convert a submitted ViewModel to a POCO (using automapper) which in

IdentityConfig.cs is missing in my C# web application project

隐身守侯 提交于 2019-12-03 16:53:57
I followed the steps from below link so that I could add Email verification to my project: http://www.asp.net/web-forms/overview/security/create-a-secure-aspnet-web-forms-app-with-user-registration,-email-confirmation-and-password-reset#addRes I am wondering where is IdentityConfig.cs and I can't find this file in my project. Instead of IdentityConfig.cs, in which file can I insert my code? Oh my god I have the same problem, so I'm going to use my older project for Identityconfig.cs using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System

SecItemAdd creating two identities

眉间皱痕 提交于 2019-12-03 16:46:49
I'm developing an application for IPhone that needs a certificate to call some services, so I'm adding a certificate to my keychain doing this: SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef) certificadoData); NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; [dictionary setObject:(__bridge id)kSecClassCertificate forKey:(__bridge id)kSecClass]; [dictionary setObject:(__bridge id)(cert) forKey:(__bridge id<NSCopying>)(kSecValueRef)]; OSStatus status = SecItemAdd((__bridge CFDictionaryRef)dictionary, NULL); When I list all the

SCOPE_IDENTITY is not working in asp.net?

白昼怎懂夜的黑 提交于 2019-12-03 15:33:24
I am trying to insert a record and get its newly generated id by executing two queries one by one, but don't know why its giving me the following error. Object cannot be cast from DBNull to other types My code is as below: (I don't want to use sql stored procedures) SqlParameter sqlParam; int lastInsertedVideoId = 0; using (SqlConnection Conn = new SqlConnection(ObjUtils._ConnString)) { Conn.Open(); using (SqlCommand sqlCmd = Conn.CreateCommand()) { string sqlInsertValues = "@Name,@Slug"; string sqlColumnNames = "[Name],[Slug]"; string sqlQuery = "INSERT INTO videos(" + sqlColumnNames + ")