CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets for: kopelli
SQL
SELECT TOP {#} {Fields} 
FROM {table} 
ORDER BY newid()
by kopelli   December 31, 2009 @ 1:55pm
Tags: sql
200 Views
no comments
 
SQL
DECLARE @str nvarchar(128)
SET @str = '[AdventureWorks].[dbo].[ErrorLog]'
 
SELECT    ISNULL(PARSENAME(@str, 4), @@SERVERNAME) AS [ServerName],
        ISNULL(PARSENAME(@str, 3), DB_NAME()) AS [DatabaseName],
        ISNULL(PARSENAME(@str, 2), ISNULL([default_schema_name], 'dbo')) AS [SchemaName],
        PARSENAME(@str, 1) AS [ObjectName]
       
FROM [sys].[database_principals]
WHERE [name] = SYSTEM_USER
by kopelli   December 31, 2009 @ 6:32am
158 Views
no comments
 
foreach ($adminGroup in gwmi -computer "." Win32_Group | where {$_.SID -eq "S-1-5-32-544"} | select -Property __PATH) {foreach ($userPart in gwmi Win32_GroupUser | where {$_.GroupComponent -eq $adminGroup.__PATH} | select PartComponent) {gwmi Win32_Account | where {$_.__PATH -eq $userPart.PartComponent} | select @{Name="Account";Expression={$_.Caption}}}}
by kopelli   November 11, 2009 @ 10:39pm
273 Views
no comments
 
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics
 
Public Module Tools
    Public Sub DateTimeStamp()
        Dim textSelection As EnvDTE.TextSelection
        textSelection = DTE.ActiveDocument.Selection
by kopelli   September 28, 2009 @ 1:37pm
Tags: Macro
236 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate