Archive for February, 2008
Saturday, February 2nd, 2008
Queria só dizer que este livro que eu recomendei vivamente num post que fiz há uns dias atrás, vem hoje, 02/02/2008, classificado com 5 (cinco) estrelas no suplemento de Sábado do JN (Jornal de Notícias).
Posted in livros | 1 Comment »
Saturday, February 2nd, 2008
Thanks David for your comment on my post.
Now i want to rectify the tip i give to you yesterday.
The best way to make an autonumber field is the Identity "process" - which i didn't know... is:
CREATE TABLE Users(
Id Identity(1,1),
Name nvarchar(50),
Email nvarchar(50),
)
INSERT INTO Users(Name, Email)
VALUES ('Andre', 'aslgomesATgmailDOTcom')
The Identity sintax is: Identity(value start,increment).
More at: MSDN - Identity
Posted in programação | No Comments »
Saturday, February 2nd, 2008
The type uniqueidentifier is the way to make an autoincrement field on a table, using SQL Server.
In this post i will demonstrate how you can autoincrement that field when you make an insert on the table, for example.
Now, creates a simple table:
CREATE TABLE Users(
Id uniqueidentifier,
Name nvarchar(50),
Email nvarchar(50),
)
To insert an element here, in Id field you should use ...
Posted in programação | 3 Comments »