quarta-feira, 4 de setembro de 2013

SQLServer Tip's - Procedure, rename table, xml, dynamic SQL


1. Introduction

I'm just gathering references to well done post and documentation about SQLServer.

2. References

2.1. Stored Procedure - with parameters

IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'sp_edi_transf_dummy')
DROP PROCEDURE sp_edi_transf_dummy 
GO

CREATE PROCEDURE sp_edi_transf_dummy
  @pIdLoteEdi int 
AS 
    SET NOCOUNT ON;
    INSERT INTO coc_param_proc_lote_edi ( id_lote_edi, param, id )
    VALUES (@pIdLoteEdi, 'proc_transf_dummy', @pIdLoteEdi);
GO


2.2. Rename Table Column


sp_RENAME 'my_table_name.old_column_name', 'new_column_name' , 'COLUMN'




2.3. Oracle equivalents in SQLServer



2.4. String, Date and Time conversion in SQLServer


2.5. String and Int conversion in SQLServer



2.6. Dynamic SQL




2.7. XML








Nenhum comentário:

Postar um comentário