![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
My "Users" table contains the same identical data. The biggest problem is that the UserID in "aspnet_membership" table is a uniqueidentifier so I cannot link it directly to the "Users" since it has different data types. ([UniqueIdentifier] VS [Int] with identity) |
|
CREATE TRIGGER InsertIntoUser ON aspnet_Membership AFTER INSERT AS DECLARE @userID varchar(16), @Email nvarchar(50), @Password nvarchar(50), @Username nvarchar(50) SET @userID = (Inserted userID in aspnet_membership) @Email = (Inserted email in aspnet_membership) @Password = (Inserted Password in aspnet_membership) @Username = (Inserted Username in aspnet_membership) |
|
VALUES (@Email, nvarchar(50), ,@Password, nvarchar(50), ,@Username, nvarchar(50), ,@UserID, varchar(16),) |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Yes that is something I was needing. I need to convert an Hex type to Varchar and use that as a id. I would like to use an integer but the cast would not work. I think I might have the answer. ALTER TRIGGER myTrigger_INSERT ON aspnet_Membership FOR INSERT AS --this is an INSERT FROM SELECT INSERT INTO WikedCompetitions.dbo.testTable SELECT CAST(userId AS VARCHAR(16)), --pay attention to the column sizes because of the uniqueidentifier type |
![]() |
| Thread Tools | |
| Display Modes | |
| |