Tag Archives: Consulta SQL

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