This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
'ALTER TABLE ' + OBJECT_SCHEMA_NAME(parent_object_id) + | |
'.[' + OBJECT_NAME(parent_object_id) + | |
'] DROP CONSTRAINT ' + name | |
FROM sys.foreign_keys | |
WHERE referenced_object_id = object_id('Mantenimiento.SIC_T_ALMACEN') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First of all, you need to decide what is the duplicate criteria that you will use. For example I want to check if the phone number is duplicate in the same Org Nro, company Name and postalcode. I can do this: | |
First table for test | |
CREATE TABLE TEST | |
( | |
id int, | |
phonenumber int, | |
orgno int, | |
companyname varchar(100), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update tabla | |
set tabla_descripcion= | |
(case when PATINDEX('% %',tabla_descripcion) > 0 | |
then left(tabla_descripcion,4) +'. '+ | |
left(substring(tabla_descripcion,PATINDEX('% %',tabla_descripcion)+1,LEN(tbien_descripcion)),4)+'.' | |
else left(tbien_descripcion ,4) +'. ' | |
end ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string[] getInstances() | |
{ | |
Microsoft.Win32.RegistryKey rk; | |
rk = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Microsoft SQL Server"); | |
string[] s; | |
s = ((string[])rk.GetValue("InstalledInstances")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE MULTIPLICACION_MISMA_COLUMA | |
(NUMERO DECIMAL(9,2)) | |
INSERT INTO MULTIPLICACION_MISMA_COLUMA | |
VALUES (5.00) | |
GO | |
INSERT INTO MULTIPLICACION_MISMA_COLUMA | |
VALUES (5.00) | |
GO | |
INSERT INTO MULTIPLICACION_MISMA_COLUMA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (AsyncFileUpload1.HasFile) | |
{ | |
//Copiar Archivo | |
string targetPath = @"\\servidor\carpeta_guardar_pdf\"; | |
string _archivo = targetPath + System.IO.Path.GetFileNameWithoutExtension(AsyncFileUpload1.FileName) + System.IO.Path.GetExtension(AsyncFileUpload1.FileName); | |
AsyncFileUpload1.PostedFile.SaveAs(_archivo); | |
string ruta = System.IO.Path.GetFileName(_archivo); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://regex101.com/r/yM3vL0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://validator.w3.org/check?uri=indumet.pe | |
http://www.woorank.com/en/www/indumet.pe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Variable que contentendrá el texto a buscar, nombre de una tabla, columna, etc... | |
DECLARE @SearchText AS VARCHAR(MAX) | |
SET @SearchText = 'Tabla1' | |
--Consulta de los procedimeintos que contienen dicho texto | |
SELECT DISTINCT USER_NAME(o.uid) + '.' + OBJECT_NAME(c.id) AS 'Object name', | |
name, | |
CASE | |
WHEN OBJECTPROPERTY(c.id, 'IsReplProc') = 1 | |
THEN 'Replication stored procedure' | |
WHEN OBJECTPROPERTY(c.id, 'IsExtendedProc') = 1 |
OlderNewer