Skip to content

Instantly share code, notes, and snippets.

View tkMageztik's full-sized avatar

Juan José Ruiz de Castilla tkMageztik

View GitHub Profile
@tkMageztik
tkMageztik / gist:7308995
Created November 4, 2013 20:49
Patrones varios .NET
http://www.dofactory.com/Patterns/PatternAdapter.aspx#_self1
@tkMageztik
tkMageztik / ADV_FS_NUM_LETRAS.sql
Created December 2, 2013 04:16
Permite generar la glosa de una factura, mediante la conversión de un monto a letras, en moneda peruana (nuevos soles).
CREATE FUNCTION [dbo].[ADV_FS_NUM_LETRAS](
@Numero NUMERIC(20,2) )
RETURNS VARCHAR(MAX)
AS
BEGIN
DECLARE @ImpLetra Varchar(180)
DECLARE @lnEntero INT,
@lcRetorno VARCHAR(512),
@lnTerna INT,
@tkMageztik
tkMageztik / gist:8308846
Created January 7, 2014 23:28
Reiniciar valor identity de la columna de una tabla, donde el valor representa el número en donde quiere que se quede el índice, el siguiente registró será +1
DECLARE I INT
SET I = 0
DBCC CHECKIDENT('TABLA', RESEED, I)
@tkMageztik
tkMageztik / gist:a8b641f5e3fc641fb310
Created January 6, 2016 22:23
Decidir cuando usar una aplicación web en lugar de un sitio web
1)
http://vishaljoshi.blogspot.com/2009/08/web-application-project-vs-web-site.html
2) De donde se sacó la información y relativo al primer link.
http://stackoverflow.com/questions/7233521/reference-folder-in-solution-explorer-not-showing-vs2010
@tkMageztik
tkMageztik / troubleshotting_correo.sql
Created January 25, 2016 17:34
script para troubleshotting ejecutable en sql server 2008r2+
-- ACTIVA EL MOSTRAR OPCIONES AVANZADAS EN SP_CONFIGURE
sp_configure 'show advanced', 1;
GO
-- COMO UN COMMIT PARA EL SCRIPT ANTERIOR
RECONFIGURE;
GO
-- MUESTRA LAS OPCIONES DE SP_CONFIGURE
sp_configure;
GO
@tkMageztik
tkMageztik / tablas_email_sqlserver2008r2.sql
Created January 25, 2016 17:34
tablas importantes troubleshotting correo
USE msdb
GO
sysmail_help_queue_sp @queue_type = 'Mail' ;
SELECT * FROM sysmail_allitems ORDER BY send_request_date DESC
SELECT * FROM sysmail_sentitems ORDER BY send_request_date DESC
SELECT * FROM sysmail_unsentitems
SELECT * FROM sysmail_faileditems
SELECT * FROM sysmail_event_log ORDER BY log_date DESC
@tkMageztik
tkMageztik / gist:1985202bdc36d6a7e9c9
Created January 28, 2016 18:55
Problema de Halloween
http://sqlperformance.com/2013/02/t-sql-queries/halloween-problem-part-1
http://es.stackoverflow.com/questions/3283/orden-de-ejecuci%C3%B3n-de-varios-update-con-sql-server
@tkMageztik
tkMageztik / BuscaValorEnBBDD.sql
Created March 18, 2016 17:20
Busca un texto en todas las columnas de todas las tablas de una BD SQL SERVER
CREATE PROC BuscaValorEnBBDD
(
@StrValorBusqueda nvarchar(100)
)
AS
BEGIN
CREATE TABLE #Resultado (NombreColumna nvarchar(370), ValorColumna nvarchar(3630))
SET NOCOUNT ON
@tkMageztik
tkMageztik / recommended_indexes.sql
Last active March 18, 2016 23:05
Muestra recomendaciones de las tablas a las que se les deberían cread índices y cuales deberían ser.
@tkMageztik
tkMageztik / varios.txt
Created April 13, 2016 15:05
Para darle color a las filas de un gridview en el databound, entre otros formatos ...
//e.Row.Attributes.Add("style", "cursor:help;");
//if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState == DataControlRowState.Alternate)
//{
// if (e.Row.RowType == DataControlRowType.DataRow)
// {
// e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='orange'");
// e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#E56E94'");
// e.Row.BackColor = Color.FromName("#E56E94");