Sql server tutorial cursor

sql server tutorial cursor DECLARE @product_name VARCHAR(MAX), @list_price DECIMAL; DECLARE cursor_product CURSOR FOR SELECT product_name, list_price FROM production.products; OPEN cursor_product; FETCH NEXT FROM cursor_product INTO @product_name, @list_price; WHILE @@FETCH_STATUS = 0 BEGIN PRINT @product_name + CAST(@list_price AS varchar); FETCH NEXT FROM cursor_product INTO @product_name, @list_price; END; CLOSE cursor_product; DEALLOCATE cursor_product; sql cursor example DECLARE @name […]

Sql server tutorial cursor Read More

Sql server connection string

sql server connection string Standard Security Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword; Trusted Connection Server=myServerAddress;Database=myDataBase;Trusted_Connection=True; Connection to a SQL Server instance The server/instance name syntax used in the server option is the same for all SQL Server connection strings. Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;Password=myPassword; Using a non-standard port If your SQL Server listens on a non-default port you can specify that using […]

Sql server connection string Read More

Sql exists

sql if exists if exists(select 1 from table where id = 4) if exists sql server IF EXISTS (SELECT * FROM tblGLUserAccess WHERE GLUserName =’xxxxxxxx’) BEGIN SELECT 1 END ELSE BEGIN SELECT 2 END sql exists Checks for the existence of any record within the subquery, returning true if one or more records are returned. […]

Sql exists Read More

Lua game code

lua game code local grid = { { 11, 12, 13 }, { 21, 22, 23 }, { 31, 32, 33 } } for y, row in ipairs(grid) do for x, value in ipairs(row) do print(x, y, grid[y][x]) end end

Lua game code Read More