How to use sql defined functions as fields?

前端 未结 1 1768
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-23 07:59

I am creating tables in Sql Management Studio 2012 using SQL. How do I make fields or columns with names that are already defined in Sql Server e.g User_ID, User_Name. I want to

相关标签:
1条回答
  • 2021-01-23 08:43

    Warp the column name like in brackets [ ] ... such as

    create table Ticket(
      Ticket_Id varchar(10) not null,
      TicketType_Id varchar(3) not null,
      Ticket_PurchaseDate DateTime null,
      LottoDraw_Id int null,
      [User_Id] int null,
      Ticket_IsWinner bit null
      Primary Key(Ticket_Id,TicketType_Id)
    )
    
    0 讨论(0)
提交回复
热议问题