Copyright © 2008-2019 Paula DiTallo

Tag Cloud


SQL Server: How do I pull the ASCII value for each character in a column name?

This is a handy script to cycle through every character in a column to determine what each ascii value is. This is especially useful when a string match isn't matching. Often times, there is a hidden space, etc. DECLARE @counter int = 1;--DECLARE @asciiString varchar(10) = 'AA%#& '; DECLARE @asciiString varchar(100) SELECT @asciiString = [ColumnName] FROM schema.TableName where ColumnName like '%Something%'WHILE @counter <= DATALENGTH(@asciiString) BEGIN SELECT CHAR(ASCII(SUBSTRING(@ascii... ......

How do I set a trace in SQL Server?

Think of this as a lightweight alternative to SQL profiler. Under the hood of SQL profiler, there exists SQL Trace -- which provides a collection of stored procedures to generate trace info. Cut and paste the t-script below to see how it works.-- Pay attention to what the server settings for traces look like first:select * from sys.tracesgo-- you are looking to make sure there isn't already a trace file set somewhere-- In any case you will need to create a new trace, make sure the @tracefile doesn't ......

What is "Hungarian Notation" ?

During the heyday of Microsoft's Visual C++ development (read: late 80's - early 90's) this naming convention was talked about a lot. In essence the naming convention prefixes each variable name with letters that denote the data type + a shortened description name -- with each word of the description beginning with a capital letter. Let's say you needed to create a variable that would contain the string value of a book title. You might choose a name like: strBookTitle or maybe just strTitle. Today, ......