create table : CREATE TABLE Project ( ProjectID int NOT NULL IDENTITY(1,1), ProjectName varchar(255) NOT NULL, CreatedDate datetime , Price int, FactoryName varchar(255), Status varchar(255), CustomerName varchar(255), Location varchar(255) ) Add constraints: ALTER TABLE @tablename ADD CONSTRAINT @defaultconstraint_name DEFAULT GETUTCDATE() FOR @columnname same as other constraints Insert data: Insert into project(ProjectName, Price, FactoryName, Status, CustomerName, Location) … Continue reading SQL basic command
Month: November 2017
SQL default constraint problem
Briefly, how to get default constraint name: -- returns name of a column's default value constraint SELECT default_constraints.name FROM sys.all_columns INNER JOIN sys.tables ON all_columns.object_id = tables.object_id INNER JOIN sys.schemas ON tables.schema_id = schemas.schema_id INNER JOIN sys.default_constraints ON all_columns.default_object_id = default_constraints.object_id WHERE schemas.name = 'dbo' AND tables.name = 'tablename' AND all_columns.name = 'columnname' This answer … Continue reading SQL default constraint problem
write swagger in Node js locally and deploy it to Azure
This week, I got a task to write swagger document, at the beginning, I thought it wasn't hard. But.... after I got stuck for a few days, now i got my first swagger working in azure. My swagger not perfect, but good enough ! I am using NodeJS as environment, main package is swagger. Notice … Continue reading write swagger in Node js locally and deploy it to Azure