create new account ask! ;;((

06/13/2023 15:13 risslove#1
I'm trying to create a second account in SQL. I can't really make it...(9.5.2 server / and telecaster, auth)

INSERT INTO [Auth].[dbo].[Account] ([account_id], [account], [password], [email], [password2], [phone], [block], [IP_user], [Admin], [point], [datePassword]) VALUES ('1952', 'riss2', '613b5247e3398350918cb622a3ec19e9', '[Only registered and activated users can see links. Click Here To Register...]', '613b5247e3398350918cb622a3ec19e9', '0', '0', '127.0.0.1', '1', '0', '2017-10-20');

Exequte this to SQL.

but...

Msg 544, Level 16, State 1, Line 1
Cannot insert explicit value for identity column in table 'Account' when IDENTITY_INSERT is set to OFF.

I get an error like above.


(I also tried the below. not work..)
1. Open your MSSQL server management window and connect to your database.
2. Expand your database folder
3. Expand your auth database
4. Expand you tables folder
5. Right click on your dbo.Account table and select design from the right click context menu
6. Select the row for account_id in the design window
7. In the bottom design pane scroll down to where you see "Identity Specification"
8. Expand that by clicking on the arrow to the left of it
9. Where it says (Is Identity) on the right side of that if you select the area where it says no use the drop down arrow and change it to yes
10. The two fields below it should say Identity Increment 1 and Identity Seed 1

Then last of all in the top design window go to the first row that is empty and add age

age, Int, and check the box to allow nulls

It is in the script and as long as we are making the user enter it we might as well collect that data.

11. Click on the save icon in the tool bar to save the changes you have just made to the dbo.Account table.


Help.......;(
06/13/2023 15:15 ThunderNikk#2
Account ID is probably identity seeded which means it will add the next one in the identity index automatically.

You don't need it in your insert statement
06/13/2023 17:31 risslove#3
Quote:
Originally Posted by ThunderNikk View Post
Account ID is probably identity seeded which means it will add the next one in the identity index automatically.

You don't need it in your insert statement

If so, how do I create an account? ;;((
06/13/2023 19:30 Masumichan#4
Read this.
[Only registered and activated users can see links. Click Here To Register...]
06/13/2023 21:52 ThunderNikk#5
Remove account_id and the value 1952 from your insert statement and it should work auto applying its own value from the next value in the identity seed.
06/14/2023 12:44 risslove#6
Quote:
Originally Posted by ThunderNikk View Post
Remove account_id and the value 1952 from your insert statement and it should work auto applying its own value from the next value in the identity seed.

so.,

INSERT INTO [Auth].[dbo].[Account] ([account], [password], [email], [password2], [phone], [block], [IP_user], [Admin], [point], [datePassword]) VALUES ('riss2', '613b5247e3398350918cb622a3ec19e9', '[Only registered and activated users can see links. Click Here To Register...]', '613b5247e3398350918cb622a3ec19e9', '0', '0', '127.0.0.1', '1', '0', '2017-10-20');

Can I apply this? ;((

Quote:
Originally Posted by Masumichan View Post
Read this.
[Only registered and activated users can see links. Click Here To Register...]
Thank you, but I don't know what it means.. what should I apply...

Since I am a beginner, I can execute a simple query like the one below. Please speak easily. ;)

INSERT INTO [Auth].[dbo].[Account] ([account_id], [account], [password], [email], [password2], [phone], [block], [IP_user], [Admin], [point], [datePassword]) VALUES ('1952', 'riss2', '613b5247e3398350918cb622a3ec19e9', '[Only registered and activated users can see links. Click Here To Register...]', '613b5247e3398350918cb622a3ec19e9', '0', '0', '127.0.0.1', '1', '0', '2017-10-20');
06/14/2023 15:27 ThunderNikk#7
Quote:
Originally Posted by risslove View Post
so.,

INSERT INTO [Auth].[dbo].[Account] ([account], [password], [email], [password2], [phone], [block], [IP_user], [Admin], [point], [datePassword]) VALUES ('riss2', '613b5247e3398350918cb622a3ec19e9', '[Only registered and activated users can see links. Click Here To Register...]', '613b5247e3398350918cb622a3ec19e9', '0', '0', '127.0.0.1', '1', '0', '2017-10-20');

Can I apply this? ;((
Yes you should be able to use that.
06/15/2023 05:03 risslove#8
Quote:
Originally Posted by ThunderNikk View Post
Yes you should be able to use that.
thanks a lot!! I did it!!! yeah~~~ :D:D