Cómo Insertar NULL Utilizando el Enterprise Manager

Sal Young | April 11th, 2006


Si alguna vez te haz preguntado cómo insertar el valor NULL en una columna mientras vez los registros de una tabla en Eterprise Manager, lo único que debes hacer es CTRL+0 (la tecla del número cero mientras presionas la tecla CTRL) al estar en la casilla que deseas modificar.

Read More

Buena Idea Mal Implementada

Sal Young | March 23rd, 2006


Una de las razones por la cual decidí escribir este artículo es porque alguien me sugirió utilizar el procedimiento de sistema SP_DEPENDS para encontrar las tablas que se usan en un SP (procedimiento almacenado). Al iniciar mis pruebas con el SP_DEPENDS utilizando la base de datos AdventureWorks todo parecía andar muy bien, pero cuando lo […]

Read More

The Object Within

Sal Young | January 4th, 2006


Finding tables referenced in a stored procedure Recently, I was asked for an easy way to list the tables used in a stored procedure. I looked in my list of previously used scripts and found one that did not fully satisfy the requirements of the task. So I decided to come up with a solution […]

Read More

WMI Date Conversion

Sal Young | July 6th, 2005


USE: To convert the GMT data returned from error logs to a readable date time value. CLEAR $sHostName = “TUIRA” $aLogName = “Application” $FromDate = [datetime]::today $WMIQuery = “LogFile=’$aLogName’ and Type=’Error’ and TimeGenerated>=’$FromDate'” Get-WmiObject Win32_NTLogEvent -ComputerName $sHostName ` -Filter “$WMIQuery” ` -ErrorAction SilentlyContinue | ` SELECT SourceName, ` @{Name = “TimeGenerated”; EXPRESSION = {$_.ConvertToDateTime($_.TimeGenerated)}}, ` […]

Read More

Top 25 Most Expensive Stored Procedures

Sal Young | July 1st, 2005


USE: These queries will display the top 25 most expensive stored procedures that are still in the cache.  

Read More

PowerShell and Outlook

Sal Young | June 27th, 2005


This script was written by ed wilson at Use PowerShell to Data Mine Your Outlook Inbox CLEAR Function Get-OutlookInBox { Add-type -assembly “Microsoft.Office.Interop.Outlook” | out-null $olFolders = “Microsoft.Office.Interop.Outlook.olDefaultFolders” -as [type] $outlook = new-object -comobject outlook.application $namespace = $outlook.GetNameSpace(“MAPI”) $folder = ($namespace.getDefaultFolder($olFolders::olFolderInBox)).folders|WHERE {$_.Name -eq “DDUMP”} $folder.items | Select-Object -Property Subject, ReceivedTime, Importance, SenderName } #end function […]

Read More

Script Out All Indexes and Primary Keys from a Database

Sal Young | June 26th, 2005


USE: To generate T-SQL code for all indexes and PK constraints from a database. CLEAR $sSRCServer = “TPW520” $sSRCDatabase = “iSQLPS” $oSO = New-SqlScriptingOptions $oSO.ClusteredIndexes = $true $oSO.Indexes = $true $oSO.NonClusteredIndexes = $true $oSO.IncludeIfNotExists = $true $oTables = Get-SqlDatabase $sSRCServer $sSRCDatabase|Get-SqlTable foreach ($oTable in $oTables){ $oT = $oTable.Indexes foreach ($oIndex in $oT) { $DDL = […]

Read More

Create Time String

Sal Young | June 21st, 2005


USE: This function will return a string representation of time. CREATE FUNCTION [dbo].[fnCreateTimeString] ( @seconds int) RETURNS varchar(75) AS BEGIN DECLARE @h int, @m int, @s int, @secs int, @BuildDate varchar(75), @hour varchar(75), @minute varchar(50), @second varchar(25) SELECT @secs = @seconds SELECT @h = @secs / 3600 SELECT @secs = @secs – (@h * 3600) […]

Read More

Index Information

Sal Young | June 19th, 2005


USE: To display index information.  

Read More