SQL Server Load Image From File

Every once in a while I find myself needing to load an image file into a database field. Assume there is a table similar to this and I already have one or more widget records. 1 2 3 4 5 6 7 8 9 10 11 create table dbo.Widget ( WidgetId tinyint not null primary key, WidgetName varchar(40) not null, WidgetDrawing varbinary(max) null ); insert into dbo.Widget (WidgetId, WidgetName) values (1, 'Widget A'), (2, 'Widget B'), (3, 'Widget C'); Now I have a drawing of one of those widgets which I would like to load into the WidgetDrawing column.

Using PowerShell to parse XML

Sample Data Let’s start with some sample data, and store it in a file c:\temp\university-node.xml. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <University> <Department> <Name>English</Name> <Chair>Professor Lit</Chair> </Department> <Department> <Name>Mathematics</Name> <Chair>Professor Calc</Chair> </Department> <Department> <Name>Biological Science</Name> <Chair>Professor Nature</Chair> </Department> <Department> <Name>Environmental Science</Name> <Chair>Professor Green</Chair> </Department> </University> Let’s format the same data as attributes, and store it in a file c:\temp\university-attribute.

Font ligatures when saving HTML to PDF

I have an HTML document which I have been printing to PDF. The document includes words like configure which has fi which turns into a ligature when saved to PDF. If I’m just reading the PDF document on the screen, it will appear to look fine. However, the problem arises when I copy the text and discover the ligature when I paste the text into other places. Character sequences you may run into this problem with include: ff, fi, fl, ffi, and ffl.

Query Tuning Implicit Conversion

What are implicit conversions An implicit conversion is when SQL Server has to convert from one data type to another data type to be able to make a comparison. Generally, implicit conversions are most problematic when they turn what could have been an index seek into an index scan. Implicit conversion can also affect cardinality estimates. Often this is a issue that can be fixed relatively easily. Sample Data This sample code creates a table with 1,000,000 rows.