netnerds.net
Home
AI Integration Series
AI Usage
About
Subscribe
github bluesky youtube github-star rss
  • MSSQL: The Differences Between SAFE, EXTERNAL_ACCESS and UNSAFE Assembly Permissions

    calendar Feb 20, 2007 · 2 min read  ·
    Share on: mastodon facebook linkedin bluesky copy

    I found this useful security tip on Microsoft.com.

    SAFE is the recommended permission setting for assemblies that perform computation and data management tasks without accessing resources outside an instance of SQL Server.

    We recommend using EXTERNAL_ACCESS for assemblies that access resources outside of an instance …


    Read More
  • SQL Server 2005: Creating Your First C# CLR UDF in 10 Easy Steps (One of Which Includes Partying)

    calendar Feb 14, 2007 · 3 min read  ·
    Share on: mastodon facebook linkedin bluesky copy
    Well, 10 steps, give or take. This could have been executed in fewer steps had we not chosen such a useful function as an example . This function, which is only supported in SQL Server 2005 with CLR enabled, esentially performs a reverse IP lookup (nslookup -type=ptr), uses System.Net.Dns.GetHostEntry and thus requires …
    Read More
  • T-SQL: Don't Run This in a Production Environment

    calendar Feb 2, 2007 · 1 min read  ·
    Share on: mastodon facebook linkedin bluesky copy

    Here's some code that I'm posting mainly for my future reference. I do not recommend running this anywhere near a production machine.

    DECLARE @SQL varchar(8000) -- if you use nvarchar for whack table names, change this to 4000 SET @SQL = '' SELECT @SQL = @SQL + 'ALTER DATABASE ' + NAME + ' SET RECOVERY SIMPLE; ALTER …


    Read More
  • T-SQL: Reindex All Indexes in All Databases (sans tempdb)

    calendar Feb 2, 2007 · 2 min read  ·
    Share on: mastodon facebook linkedin bluesky copy

    As you probably know, Microsoft provides two undocumented/unsupported stored procedures for iterating through databases, sp_msforeachdb and sp_msforeachtable. I've always wondered, then, why the following code never showed up in Google searches:

    sp_MSforeachdb @command1 = 'EXEC sp_msForEachTable @COMMAND1= ''DBCC …


    Read More
  • T-SQL: Quickly Kick All Users Out of a SQL Server Database

    calendar Jan 30, 2007 · 1 min read  ·
    Share on: mastodon facebook linkedin bluesky copy

    There are a few ways to do this but here's one that I like. I believe it works in SQL Server 7, 2000 and 2005.

    ALTER DATABASE myDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO USE myDatabaseName GO

    Go ahead and do what you need to do then set it back:

    ALTER DATABASE myDatabaseName SET MULTI_USER


    Read More
  • VBScript & SQL: Programatically Find the Location of an IP Address

    calendar Jan 30, 2007 · 2 min read  ·
    Share on: mastodon facebook linkedin bluesky copy
    This is more of a post for proper keywords. My previous entry titled "Import MaxMind City CSVs into SQL Server 2005" assumes the user has already conducted research to find that MaxMind's free GeoIP database provides the functionality to look up the location of an IP address. So, if you wish to quickly and …
    Read More
  • BCP: Remove Quotes from CSV Import using BCP Format File

    calendar Jan 29, 2007 · 2 min read  ·
    Share on: mastodon facebook linkedin bluesky copy
    I'd like to start this post by saying that BCP is limited and ghe-toe, but it gets the job done to some degree. One of the guys over at SQLteam.com wrote a really informative post on Flat File Bulk Import methods speed comparison in SQL Server 2005 that you should check out if you are into that sort of thing. BCP ranks …
    Read More
  • MaxMind GeoIP: Import MaxMind City CSVs into SQL Server 2005

    calendar Jan 29, 2007 · 4 min read  ·
    Share on: mastodon facebook linkedin bluesky copy
    Inspired by kitty0's GeoIP Demo, I created two scripts which automatically import the free MaxMind GeoIP database (which resolves IP addresses to city locations) into SQL Server using VBS and BCP. The VBS file can be set as a Scheduled Task for MaxMind's free once-a-month updates. I also created a SQL Server UDF to …
    Read More
  • T-SQL UDF: Convert Traditional IP into Numeric IP

    calendar Jan 25, 2007 · 1 min read  ·
    Share on: mastodon facebook linkedin bluesky copy

    This user-defined function (only available in SQL 2000 and above) is part of a larger project I'm working on. PARSENAME in SQL Server is my new favorite function.. Thanks to Jeff Smith for the heads up.

    CREATE FUNCTION [dbo].[IPtoNumeric] (@strIP varchar(255)) RETURNS bigint AS BEGIN DECLARE @intIPNum bigint IF …


    Read More
  • T-SQL: Parse Top Level Domain from URL

    calendar Jan 17, 2007 · 2 min read  ·
    Share on: mastodon facebook linkedin bluesky copy
    I keep track of all hits to my website RealCajunRecipes.com in a SQL table called hitcounter which has columns for the user's IP, browser, referring URL and the date. Recently, I saw a surge in traffic and wanted to know which domains were sending the traffic our way. After getting tired of issuing ad-hoc queries that …
    Read More
    • ««
    • «
    • 9
    • 10
    • 11
    • 12
    • 13
    • »
    • »»

Chrissy LeMaire

SQL & PowerShell MVP. GitHub Star. Creator of dbatools. Need to oil my knees.

GenAI book

Buy the MEAP at manning.com for 45% off with code gaipbl45

AI Integration Series

  • Automation with AI Toolkit + GH Models
  • Getting Started with AI for PowerShell
  • Asking Tiny Questions: Local LLMs
  • Local Models Demystified
  • Asking Bigger Questions: Remote LLMs
  • PDF Text to SQL Data with OpenAI
  • Document Classification in SharePoint
  • Azure Functions Doc Parser

dbatools book

Now available in bookstores and amazon 🥳 Buy it at manning.com for 50% off with code bldbatools50

dbatools

dbatools is an awesome PowerShell module that helps you migrate entire instances with a single command, plus a whole lot more.

available from dbatools.io and github

dbachecks

dbachecks validates SQL Server environments using crowdsourced DBA checklists and outputs to Power BI and is available on github.com 📊

Find me

Find me on Bluesky

recent posts

  • Document Intelligence with Azure Functions: A Practical Implementation
  • Automating Document Classification in SharePoint with Power Platform and AI
  • Asking Bigger Questions: Remote LLMs for Automation Engineers
  • AI Integration for PowerShell Developers: Getting Started with PSOpenAI and GitHub Models
  • AI Automation with AI Toolkit for VS Code and GitHub Models: A Visual Guide
  • Asking Tiny Questions: Local LLMs for PowerShell Devs
  • Local models mildly demystified
  • Let's talk about anti-AI slop: my plead for schools to teach AI literacy

categories

powershell 128 sql-server 123 general 64 security 60 windows 47 sharepoint 42 active-directory 37 linux 31 networking 30 vbscript 30 apple 24 virtualization 22 iis 19 genai 14 github 10
All Categories
active-directory37 ai1 apache7 apple24 asp-net2 azure5 azure-functions1 bi4 db24 devcontainers1 exchange7 genai14 general64 github10 iis19 linux31 livestreaming4 lync2 mastodon4 networking30 oracle1 powershell128 security60 sharepoint42 sql-server123 typescript1 vbscript30 virtualization22 windows47 wpf7
[A~Z][0~9]
 

Copyright 2003 -  Chrissy LeMaire. All Rights Reserved