Skip to main content

Alter Table Column MsSql

Following is the important script for database server as the table "tbl_Log" as already created.



  • For Adding Default Value in Table
    • ALTER TABLE YourTable ADD CONSTRAINT DF_SomeName DEFAULT N'1' FOR YourColumn;
  • For Increasing the Column Size
    • ALTER TABLE YourTable ALTER COLUMN YourColumn VARCHAR (50) NOT NULL;
  • For Add/Creating New Column
    • ALTER TABLE PRESENTED_VOUCHER add  descrip  nvarchar(200);
  • For Change/Modify Existing Column 
    • ALTER TABLE PRESENTED_VOUCHER alter column  descrip  nvarchar(200);

Comments

  1. ALTER TABLE Projects add
    Balance_Acc varchar(10),
    Balance_Acc1 varchar(10),
    Balance_Cus varchar(10),
    Balance_Cus1 varchar(10),
    Balance_Cost varchar(10),
    Balance_Pur varchar(10),
    Balance_PurDisc varchar(10),
    Balance_Exp varchar(10);

    ReplyDelete
  2. ALTER TABLE Projects ALTER COLUMN [NAME] nvarchar (200);
    ALTER TABLE Projects ALTER COLUMN LongDescription nvarchar (1000);

    ReplyDelete
  3. ALTER TABLE SUB_INV add wgt1 float null;
    ALTER TABLE SUB_INV add wgt2 float null;

    for Sikendar Sb - Hawks

    ReplyDelete
  4. alter login sa with password = 'sa*786'

    ReplyDelete
  5. ALTER TABLE customer ALTER COLUMN cus_date smalldatetime NULL;

    ReplyDelete
  6. aLTER TABLE customer add close_date smalldatetime Null;

    ReplyDelete
  7. aLTER TABLE customer add Cus_Survay_Code nvarchar(6) Null;

    ReplyDelete
  8. aLTER TABLE invoice add cash_received float default 0;

    ReplyDelete
  9. ALTER TABLE tbl_TraDocImg_Dtl ALTER COLUMN Code nvarchar(5) NULL;

    ReplyDelete

Post a Comment

Popular posts from this blog

Spiral Model C#

I have created following: 01 - Db.Model ( i.e., "TicketProtection.cs + "ServiceCharges.cs" + "AtolProtection.cs") 02 - Configuration ( i.e., "TicketProtectionConfiguration.cs" + "ServiceChargesConfiguration.cs" + "AtolProtectionConfiguration.cs") 03 - Migration Added Migration(add-migration added_costing_charges_table)  04 - SQL Insert Script ( i.e., for ticket_protection_charges. in figure bellow)Please review if i miss anything...? 05 - Data for SQL Insert Script: creating file in seeding folder of project - with "embaded resource" 06 - Run the Project on Database to check data & tables are created. 07 - Repository: 08 - Manager ( Interface and Implementation) (Reference Data Manager) 09 - Controller (Reference Data Controller) "CustomApiResponse" 10 - Create Map in SelectItemProfile   11 - Create Front End "Costing Methods PassengerType wise" 

Distribution Management Software

Inventory & Financial Management System for Distribution Business CREATE & DEFINE: Area Sale Office Customer Supplier Main Products Group Products Product Specification Chart of Account Heads Sale Office Targets MAINTAIN TRANSACTIONS & RECORDS : Sale Order Sale Invoice Sale Voucher Purchase Order Purchase Invoice Purchase Voucher Cash Received Voucher Cash Payment Voucher Bank Payment Voucher Bank Received Voucher Journal Voucher Cheque Book Record  ( Cleared & Uncleared ) REPORTS : ORDER PRINT, INVOICE PRINT, VOUCHER PRINT, INVENTORY REPORTS, ACCOUNTING REPORTS, ETC