Mês: maio 2017

Gerar Query Insert Automaticamente

A procedure abaixo cria query INSERT a partir dos registros de uma tabela no SQL Server. [sql] CREATE PROC [dbo].[InsertGenerator] (@tableName varchar(100)) as –Declare a cursor to retrieve column specific information –for the specified table DECLARE cursCol CURSOR FAST_FORWARD FOR SELECT column_name,data_type FROM information_schema.columns WHERE table_name = @tableName OPEN cursCol DECLARE @string nvarchar(3000) –for storing […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> SQL | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , , | Leave a comment

Verificar se valor existe na String Javascript

Algumas formas de verificar se valor existe em uma string utilizando JavaScript. 1. (ES6) includes [js] var string = “foo”, substring = “oo”; string.includes(substring); [/js] 2. search [js] var string = “foo”, expr = “/oo/”; string.search(expr); [/js] 3. lodash includes [js] var string = “foo”, substring = “oo”; _.includes(string, substring); [/js] 4. RegExp [js] var […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> JavaScript | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , | Leave a comment