Sql server alter column

sql alter column size ALTER TABLE table_name ALTER COLUMN column_name datatype; sql server alter column ALTER TABLE table_name ALTER COLUMN column_name new_data_type(size); alter column type ALTER TABLE table_name ALTER COLUMN column_name datatype; sql change column types ALTER TABLE table_name ALTER COLUMN column_name datatype; — Example ALTER TABLE product ALTER COLUMN description VARCHAR(250); sql add column […]

Sql server alter column Read More

Sql quote in string

sql escape quote DECLARE @my_table TABLE ( [value] VARCHAR(200) ) INSERT INTO @my_table VALUES (‘hi, my name”s tim.’) SELECT * FROM @my_table sql quote in string /*adding single quote into the string in SQL*/ on P.SupplierID=S.SupplierID where S.CompanyName in (‘Tokyo Traders’,’Exotic Liquids’,’Grandma Kelly”s Homestead’)

Sql quote in string Read More

Sql date format

SQL Date Format SELECT FORMAT(dbo.column, ‘M/dd/yyyy’) sql date format SELECT DATE_FORMAT(“2017-06-15”, “%Y”); sql server format date convert (varchar , getdate()-1 , 112) sql server date field syntax DATE – format YYYY-MM-DD sql time format DATE – format YYYY-MM-DD DATETIME – format: YYYY-MM-DD HH:MI:SS TIMESTAMP – format: YYYY-MM-DD HH:MI:SS YEAR – format YYYY or YY sql […]

Sql date format Read More

Sql count

sql count /*COUNT(column_name) will return the number of rows from the column that are not NULL*/ SELECT COUNT(column_name) FROM table_name; /*COUNT(*) will return the number of rows from the table*/ SELECT COUNT(*) FROM table_name; select count sql SELECT COUNT(column_name) FROM table_name WHERE condition; sum of column in sql SELECT SUM(column_name) FROM table_name WHERE condition; how […]

Sql count Read More

Lua table

lua table local t = { “hello”, “how”, “are”, “you” } for k,v in pairs(t) do print(“Number: “..k..”Message: “..t) end output: Number: 1 Message: hello Number: 2 Message: how Number: 3 Message: are Number: 4 Message: you lua table local Table = { “Hello”, “Goobye”, “Bruh”, Part = Instance.new(“Part”) } — This is our table! […]

Lua table Read More

Lua syntax

lua syntax chunk ::= {stat [`;´]} [laststat [`;´]] block ::= chunk stat ::= varlist `=´ explist | functioncall | do block end | while exp do block end | repeat block until exp | if exp then block {elseif exp then block} [else block] end | for Name `=´ exp `,´ exp [`,´ exp] do […]

Lua syntax Read More