MVC SVG Tutorial (Sample code)


We all know that it is best practice in a responsive world to use SVG, but this is slightly more complicated within the MVC Razor view engine. Since SVG files are recognized as xml files and not image files other steps must be taken. Here are the steps to get SVG working in your MVC Application:

  1. Add some SVG files to your solution.
    I like The Noun Project for my icons so I am using a Factory from Amelia Wattenberger.  There are a lot of sources for getting and or making your own SVG. I’ve talked about them previously, and I recommend Inkscape since it is very full featured, free, and has plenty of good tutorials. I have also found it helpful to build out the raw image in Power Point and then go to image.online-convert.com to convert your simple image to something that is closer to what your looking for..
  2. Add this Helper to your Solution:
    1. using System.Collections.Generic;
    2. using System.Reflection;
    3. using System.Xml;
    4. using System.Xml.Schema;
    5. namespace System.Web.Mvc.Html //<– Note this namespace!
    6. {
    7.     public static class HtmlHelperExtension
    8.     {
    9.         public static MvcHtmlString SVG(this HtmlHelper htmlHelper, string path, object htmlAttributes)
    10.         {
    11.             Dictionary<String, Object> attributes = new Dictionary<String, Object>();
    12.             var fullPath = HttpContext.Current.Server.MapPath(path);
    13.             var xmlDoc = new XmlDocument();
    14.             xmlDoc.Load(fullPath);
    15.             string xsi = http://www.w3.org/2001/XMLSchema-instance&#8221;;
    16.             XmlSchema schema = new XmlSchema();
    17.             schema.Namespaces.Add(“xsi”, xsi);
    18.             PropertyInfo[] properties = htmlAttributes.GetType().GetProperties();
    19.             foreach (PropertyInfo propertyInfo in properties)
    20.             {
    21.                 if (xmlDoc.DocumentElement.Attributes[propertyInfo.Name] != null)
    22.                 {
    23.                     xmlDoc.DocumentElement.Attributes[propertyInfo.Name].Value =
    24.                         (string)propertyInfo.GetValue(htmlAttributes, null);
    25.                 }
    26.                 else
    27.                 {
    28.                     XmlAttribute xsiNil = xmlDoc.CreateAttribute(propertyInfo.Name, xsi);
    29.                     xsiNil.Value = (string)propertyInfo.GetValue(htmlAttributes, null);
    30.                     xmlDoc.DocumentElement.Attributes.Append(xsiNil);
    31.                 }
    32.             }
    33.             return new MvcHtmlString(  xmlDoc.OuterXml);
    34.         }
    35.     }
    36. }
  3. OutputinChromeAdd this where Where you want your SVG to be Displayed. at this point it becomes a bit of a preference discussion. However the standard for choosing which tag to use tag seems to be: prefer object over embed. The helper above is to include the svg in the rendered HTML (without either the object or embed). The reason I choose this approach is multi-fold:
    • The object/embed approach is simple enough that you don’t really need the overhead of an Html Helper.
    • The helper can get inside the XML and make modifications on the SVG which makes it more extensive.
    • Syntactically it is more in “tune” with the Razor View Engine.
    • Better to reduce/reuse code.

    here is how you would use the HTML Helper:

    1. @Html.SVG(“/Images/icon_10948/icon_10948.svg”,
    2.        htmlAttributes: new { width=“351”, height=“257” })

    And here is a comparison of the footprint of all three approaches:SVGodePicture
    It is easy to see that the HtmlHelper is a good compramise between the verbose and hard to maintain XCopy of the SVG XML into the cshtml file. and it is also shorter than the object approach.

I hope this helps you Happy Coding.

Posted in Code, Code Sample, Programming, Snippit, Tutorial, Uncategorized | Tagged , , , , , | Leave a comment

Infographic Misdirection and Bias Influencing


 

From the article  By Brandon Bailey

From the article
By Brandon Bailey

When I saw this infographic it instantly stuck me as off. I had to look very closely to discover exactly how it was misleading me. This article is clearly biased in the favor of Google, the info depicted here implies market share or importance of development to the observer. It becomes very clear that the author didn’t dig for breadth and this infographic is a much better representation of the viewpoint and focus of this articles author as opposed to the state of industry. There was no comment on Qualcomm Zeroth processors, and all of the approaches describer herein use CPU & GPU approaches not NPU.  Perhaps the blame should go to Doug Griswald the artist, please Doug read my post about infographics and data representation before you make another.


At the very least this infographic should have been in chronological order (which would put Microsoft as the last “achiever”), but to give the companies different sizes.. Come On man.. Seriously..

  • Integrity -1
  • Professionalism -2

 

 

Posted in Artificial Intelligence, Computers and Internet, Digest, News and politics | Tagged , , , , | Leave a comment

Static Library vs Dynamic Linked Library (Lib vs. DLL)


The Kool Aid:
“Using dynamic linking instead of static linking offers several advantages. DLLs save memory, reduce swapping, save disk space, upgrade easier, provide after-market support, provide a mechanism to extend the MFC library classes, support multilanguage programs, and ease the creation of international versions.”

Lib

-This is a code “bundle” inside your .exe

DLL

-This is a stand alone unit of code.

Performance
  •  Code is always loaded with the executable
  • Can speed up app load time
  • Small hit when the .dll loads
  •  Can be deferred at App load time
Compiled Size
  •  Larger file size for .exe
  •  Many smaller files
ALM
  • Can only be used at compile time.
  • Not prone to versioning problems.
  • You will need to take extra steps to get the PDB’s rolled into the DLL PDB
  • Must update each product which uses it separately
  • Fights incompatibility issues
  • requires you to replace the exe for upgrades.
  • Some say Lib’s make it easier to support many platforms
  • Modularity
  • Can Be used by multiple Applications.
  • Can speed up development (reduced compile time)
  • Can cause versioning problems.
  • Can upgrade all products at once if dll is shared across product lines
  • Forces you to update all related projects and can cause compatibility maintenance issues across your organization.
  • Allows you to upgrade the application by replacing just the dll.
  • Can make it easier to support new hardware or hardware changes
Operation
  • Used by the compiler at compile-time.
  • Results in 1 Large file.
  • Avoids dependency issues
  • Compiled and called at runtime.
  • Results in many smaller files.
  • Can be stored in the GAC
Misc.
  •  All iOS binaries are static libs
  • Original implantation was the origin of DLL Hell
  • Your Exe will produce a minimal Lib file at compile time to link to the dll
  • Allow a game to easily support mods.
Architectural Consideration
  • Special care need to be taken when internal dependencies are not straight forward.
  • Allows for inter-process communication
Legal Implications
  • If you use an LGPL library statically your code automatically becomes Open Sourced
  • If you use an LGPL library then you only have to open source the changes made to that library/
Security
  • Everything is internal to the exe, thus contained
  • Data can potentially be ‘hacked’

If you are developing for windows 8 (win8)  then the quick answer is use a DLL

If your Developing for iOS then use a Lib

 

References:

Posted in Uncategorized | Leave a comment

XenoBiology


Back in 1997 I took my first organic chemistry class, and in it we discussed the origins of organic compounds in a primordial soup. Ever since then I’ve had interest in the origins of life, “genetics”, knowledge transmission and of course Xenobiology. I had considered going to a school in Florida that offered a xenobiology program, I didn’t yet that too has always been a decision that I feel could have changed many thing on my view of self. Realistically the field is an odd entity to exist inside the sciences, and perhaps would be better suited to a liberal sciences department that also studies the paranormal, Numerology, and meta-consciousness.

On 4 November 2013, astronomers reported, based on Kepler space mission data, that there could be as many as 40 billion Earth-sized planets orbiting in the habitable zones of sun-like starsand red dwarf stars within the Milky Way Galaxy.[11][12]

–Wikipedia

It is a fun exercise to revisit once in a while. Astronomers say that 1 in 10 stars has a Goldilocks planet. And if you assume that “Life as we know it” is based on a phospholipid bi-layer enclosing self reproducing reagents then you take into consideration the number of rain drops from a single rain-cloud releasing it’s burden over a puddle that has had oils build up on it’s surface ( or ocean spray or waterfall droplets…etc) then the chances that a Goldilocks planet has long chain hydrocarbons and doesn’t have micelles is infinitesimal! So what about sugars? Well scientists have found sugars in nebular clouds and on asteroids. And we know that planets are accretions of these interstellar. Bodies so it stands to reason structurethat there are sugars on these planets (DNA is sugars with a phosphate backbone). Things like sodium, phosphorus, nitrogen and oxygen  can be found right next to the sugars store mentioned in deep space so they would accumulate along with everything else trapped in that Goldilocks’ Hilbert sphere. And just on the law of diffusion (entropy) our sugars oils and other gasses & minerals would   come into contact with one another. So the setting is right.

But what is it that really makes “LIFE” ? Most people would say the ability to reproduce and or pass along information.    O.k…? What does that mean? “knowledge” at it’s most mathematical level is most easily described as reverse entropy or perhaps more discreetly as the coefficients of reverse entropy (snap shots in space time of pockets of order) and unlike “nonliving” things these pockets of order don’t spontaneously disperse, they grow in magnitude and become more ordered patterns of ordered things ( think a mass of cells).  What then is learning? Well we say that plant cells learned to use chlorophyll, but what we really believe is that proto-img15plant cells ingested chloroplasts (and perhaps other cellular components) and found it more beneficial to not eat then but to nurse from them and “farm” them { if you will }. So in thus case “Learning” was a matter of perhaps a detrimental issue (a lack of digestive system) that lead to the happy accident that resulted in invagination And propagation of chloroplasts ( which were no doubt a competitor at that time of what we would come to call the proto-plant cell.
So learning at it’s most basic is still a matter of perspective. Inside the chloroplast the pancake like structures have “evolved” to be wonderful sugar makers and light absorbers. They didn’t start that way but over time the chloroplasts that produced the right protei53076-004-61A5272Ans to make that structure get to live longer (presumeably because the cell nursing on it could last longer between meals due to the ready supply of sugars) and those who were slightly less strong would end up running out of energy and become dinner.  This is evolution! Is it also “Learning”?

Certainly we are reducing degrees of freedom in this space and conferring those reduced dimensions to our progeny so yes we have the most basic form of knowledge transfer structural (and possibly related to that genetic). Then as we scale our systems up we see that at a certain point “Learning” takes on new meanings. It is the scale of the dimensionallity here that now becomes meaningful and treacherous at the same time. Is it learning for cells to come together for protection “flocking” into biofilms for example. The film is more than the sum of it’s parts, and yet it’s parts may be very basic. Do we call it learning when one organism stats producing adhesives  to attach to other cells? Or is this just a byproduct of wanting to be more stationary with the added benefit that your neighbor is a filter feeder which circulates food past your mouth for you? (“Lazy 0r Lucky Learning”?)

These types of scale & scale boundary  questions it seems have become pervasive  across a wide variety of disciplines.  perhaps most widely discussed is the quantum classical barrier ,but we find them in places where there are discontinuities between one way of  understanding and the next. Even when it comes to classification of extrasolar xenomorphic societies we have discontinuities, but in this case it can help us understand that we as humans need to categorize things to make them comprehensive.  Thus we come round circle to semantics and belief.

Posted in Leisure, News and politics | Tagged , , , | Leave a comment

Isn’t it A-mazing!?


While starting this research I noticed how many of these “maze” posts start with an explanation of just why you would be interested in mazes… and as I have nothing new to offer in that category, I will refrain from revealing my reasons, and dive right in…

History of Mazes and Labyrinths

Image and caption from unmuseum.org

Paul Lucas sketched this drawing of the supposed remains of the Egyptian Labyrinth in 1700.

So the idea of a “maze” goes back 4,000 years to the ancient Egyptians (specifically Amenemhat III ). Who, by the time of Herodotus,  had created a great Labyrinth in the town  Arsinoë (also known as Crocodopolis), about which Heroditus claimed :

“I found it greater than words could tell, for although the temple at Ephesus and that at Samos are celebrated works, yet all the works and buildings of the Greeks put together would certainly be inferior to this labyrinth as regards labor and expense.” –ref (more on Wikipedia) (more on amazeingart.com)

Map Showing relative location of Crocodilopolis (alt image credit)

Another ancient writer Pliny wrote of the temple:

“.. banquet halls reached by steep ascents, flights of ninety steps leading down from the porticoes, porphyritic columns, figures of gods and hideous monsters, and statues of kings.” … “Some of the palaces are so made that the opening of a door makes a terrifying sound as of thunder. Most of the buildings are in total darkness.”

The resulting legacy has echoed through time, with ideas like the Minotaur’s Labyrinth in Knossos, populating the nightmares of Greek and Roman children, they have worked their way into Christianity, and were even a part of Native American religious traditions. Over time they have lost their ominous overtones and become more a thing of novelty such as the  “footprint of a Colossus” in Gloucestershire.Today they are a form of entertainment for children and people trying to waste time (my own opinion). But what about the fundamentals?

Maze Terms
Definitions based on Branching
Unicursal Maze without branches. Sometimes called a circuit maze.
Multicursal Maze with branches and dead ends.
Maze Anatomy
Branch A path inside a maze.
Island A section of the maze containing walls not connected to the external wall of the maze. Sometimes also referred to as a detached wall.
Blind Alley Branch that has a dead end.
Hub An enlarged area inside the maze with multiple choices of branch leading in/out.
Types of Maze
Braid Maze A type of maze with branches, but without dead ends. All branches loop back to other branches.
Perfect Maze Maze with no islands or isolated sections. A perfect maze has only one solution.
  Delta Maze Maze consisting of interlocking triangles.
  Orthogonal  A type of maze composed of square cells.
Plainair Maze A maze on something other than a flat surface. For example, a maze painted on the outside of a cube or sphere.
  Sigma  A type of maze composed of Hexagons.
  Theta  A type of maze composed of concentric circles.

Maze Code Samples

 Source Type Article Type Lang. Sample Image
2D MSDN tutorial C#
2D CSharpCorner Maze Generation C#
2D HWS Math & CS Sample Java
3D Falstad  Sample  Java
3D jsmadeeasy  Sample  JavaScript  Ascii output
3D threejs  potential  JavaScript

Mazes in Higher dimensionality

Video Games like Portal (play flash version here) have taken the concept of a maze to an entirely new level, by introducing a virtual reality where Pirisannni and M.C. Escher would have felt right at home. A couple of interesting applications of higher dimensional spatial pathfinding puzzles are the movie Cube and the The Rotating Labyrinth (access to a playable version here)

 

Notice any similarities?

Creating the Maze

Because of the variability in Maze anatomy and dimensionality branching etc, there are a number of ways to generate mazes, however in my experience using randomness like this results in a boring sort of normality (think about probability distribution and you will see what I’m talking about). Pockets of “order” IMHO add to the confusion of the Human solving the puzzle. This can be seen in the Movie “Labyrinth” when the little creatures start messing with the protagonists “bread crumbs”.

 

Solving the Maze

Solving the  maze (or any network problem) is one of the fundamental discreet math concepts. There are gaming variants of this problem primarily the A* Algorithms, and typically when solving a typical maze one is looking for the shortest path. Due to the structure of the solution space of this type of problem (no a priori structure per se) Maze solving algorithm’s typically do so by brute force exploration of the solution space. A graphical “tutorial” about longest/shortest path solving can be found at pathery.

Tower Defense

The Tower defense game is in my opinion an inversion of the Maze concept where instead of the least longest path one is striving for the longest path. A sample of this can be seen at Pathery, but typically the game is centered around having a path, and then trying to introduce obstacles to that path, typically the path is exemplified by “living” units” (AI Agents) which can be killed by the sections of maze wall which are often offensive “towers”, some games from this category are Plants vs. Zombies, and Defense Grid.

– and since I don’t have a rational place to close this discussion so I will just present you the exit:

Posted in Digest, Game Development, Math, Review & Comparison | Tagged , , , , , , , , | Leave a comment

2013 in review


The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 11,000 times in 2013. If it were a concert at Sydney Opera House, it would take about 4 sold-out performances for that many people to see it.

Click here to see the complete report.

Aside | Posted on by | Tagged | Leave a comment

Wen Model #6501 Combination Power Sander


I Like many others was enticed to go out shopping on “Black Friday” this year and I got this belt sander. You would think that based on my previous experiences with Wen Products that I wouldn’t waste my money. But I did need a belt sander, and it was cheep (which I also was interested in) so I got one. It came disassembled (mostly) but was easy to put together. 
Wen it is finally put together (spelling error intended) you get a fairly nice looking albeit hard to figure out how to use upright sander.

Here are my thoughts on this device: the 3/4 hp. motor seems a bit under-powered, and when I first turned it on it did nothing! So I loosened up the belt which was easy to do but made me concerned about how you would get a new belt on there square. So .. Loosened it up and still  I  turned it on and it did nothing! At this point i was thinking about just returning it, but I had just braved cold temperatures, Black Friday traffic and buying conditions and I was not interested in taking it back. So I decided to go off script, I’ve had to do this with other under powered “power” tools, and I turned on the machine, and (since the belt was not moving at all) I jump started the belt by hand, and it finally started!!!  So Yay I have a “working” belt sander.

All this has gotten me to wonder what is going on with this company and how they can stay in business??

Final thoughts

1 – I have yet to glue the sanding pad onto the disc, however I am disappointed that I have to “glue” anything, it should be velcro adhesive that i just apply to the disc (like industry standard) so … I would like to ask the “engineers” at Wen how one is supposed to replace the sanding disc??? You see it here a a silver round (almost polished) piece of cast aluminum.

2 – The “feet” on this device have already fallen off a couple of times, and the machine will walk as a result (these are the little rubber pieces on the left of the parts image above.

3 – The Factory belt had some grains that were very large and caused deep grooves in the material that I needed to tend to explicitly.

4 – The “safety guard” on the belt sander has a little bar right where it shouldn’t if you want to sand a long piece of material (so I had to remove it), this is the L shaped metal bar just above the wrench (which is a piece of crap soft steel).

5 – The “Table” for the disc sander is only only stabilized by a couple of  screw knobs, so it may shift during use and is hard to ensure alignment (square), you see the table on the left.

6 – Lastly the screws to adjust the angle of the belt are hidden and the only way you can get to them is with the crappy  metal wrench.

So should you buy one? I am not sure.. only if you really need a cheep belt sander.

Posted in Leisure, Review & Comparison, Uncategorized | Tagged , | Leave a comment

So you wanna make a Healthcare website..?


All the kerfluffel around the HealthCare.Gov website debacle is a bit funny and frustrating to me. I start with the frustrating bits, and then I will discuss the humor in it all.

It’s Frustrating that the Senators are not asking the right questions and that  the White house advisers are giving bad information, both out of ignorance and the typical politics of  CYA and Pin the Blame on the Donkey. But nobody is asking the question of who picked this consulting firm, who in the government is responsible for not demanding an azure (or other cloud based) solution for something that was textbook for use case. It’s odd as a consultant I look at this situation as  a classic example of how the customer messed up the project and the consultant is blamed. dilbert-example-sm

How Did it Ever Get This Messed Up?

Well that is simple, (see cartoon above) it’s commonly said you can get it done cheep or you can do it right. Now don’t get me wrong I think the government way overspent for this application, but how does this really happen? Here is an iconic cartoon that very clearly illustrates this common problem is software development:

  • This is going to be a simple place where you can go get insurance, or a subsidy and compare prices.
  • The project leader(s) understood that they were cut off at the knees due to legal jargon and statutes.
  • The analyst inaccuracy assumed that there would be a steady small flow of people signing up (not all 300 million people in the US would try signing up day one).
  • The developer did the best they could (hopefully) with the information they were given.
  • Someone know how to make this thing luxurious and functional, with all the bells and whistles (even though they were not directly asked for)
  • As time goes on and deadlines start coming or being missed what good is a document saying how the system works when it doesn’t even work.
  • If I don’t tel you to put an engine on my buggy I’ll get a horse drawn carriage  as opposed to a model T, because you can’t bill me for an engine I didn’t ask for.!
  • The customer billing one is obvious.
  • The people who’s jobs would be on the line when this whole thing blows up were too busy with other important stuff..
  • We ultimately want only a tire swing, this is what the president’s advisers told him he was getting.

O.k. that’s funny but what does it really say? The number one reason that software projects fail is a lack of communication. “A Lack of communication in politics! HA!” You say sarcastically.  It is the same story whether your a multi-billion dollar organization or you only hope to clear 100K in a year. You have the competing triad of

  1. Money
  2. Team
  3. Business

All three need to come together to have success, and when you have “politics” (whether that is in the government or in the office) you don’t have a team. Without a consensus or accepted leadership your business has no idea whether they are coming going or just missed a meeting. And if nobody cares about success, or even worse is trying to pin failure on another party they will not accept their money being spent to aid that initiative, stopping the train before it even gets started.

But what many may not be aware of is that the landscape is never simple. When it  comes time for anyone who is familiar with government software to start explaining it they always start with shaking their heads.  Lets take the simple case of a new federal fishing license for interstate and international waters. We have differing fish populations on each of the 4 Cartesian boarders of Minnesota. To the north Canada (which makes setting licensing restrictions slightly easier because it is only one party for many of the states, but in Minnesota the fish on the east side ate very different from those in the middle and even those on the western edge. allowing even one Muskie to be taken from the red river could be considered a violation on endangered habitat, yet there are places that you have problems keeping them off your hook in the north west(or so it has been rumored in dark corners by old drunken fisher persons). Now look at the species along the Wisconsin boarder, where they are fighting invasive species and it is all river (similar to North and South Dakota), and there are no Wilderness preserves. O.k. well lets take each place on a per case basis then what you get is something like:

  • If it is the Canadian Border
    • If it west of Lake of the Woods…
    • If it east of Lake Of the woods…
    • If it is the ….
  • If it is the Wisconsin Border
    • If it is north of the St Thomas Falls …
    • If it is north of St Croix Falls …
    • If it is the ….
  • If it is the ….

And the scope of the logic just exponentially increases as we take into consideration things like handicapped access (use of a crossbow for bow fishing) .. Bow Fishing!..  you can see how a simple place to go get a license can get complicated quick depending especially on what that license is intended to cover. Here is our simple diagram of that was just described:

So the next time your thinking about building that governmental website, give one person the budget tell them to make it, and get out of their hair!

Why is it Funny?

It’s funny because every developer knows this and yet everyone who has never worked in construction, development or any field where you must operate behold-ant to expectations and hard reality you will always have to explain why it is so complicated even when it should be obvious…

Posted in Cloud, Computers and Internet, Jokes, Leisure, News and politics, Programming | Tagged , , , , | Leave a comment

Error: Attempt by security transparent method ‘…Start()’ to access security critical method ‘..#System.String#’ failed.


Attempt by security transparent method ‘WebMatrix.WebData. PreApplicationStartCode.Start()’ to access security critical method System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport#System.String#’ failed.

All you need to do is to install Microsoft.AspNet.Web.Helpers.Mvc, simply use the NuGet Console and run the following command in the Package Manager Console


PM> Install-Package Microsoft.AspNet.Web.Helpers.Mvc

–I found the origional fix here

Posted in Snippit | Tagged , , | 1 Comment

All your Foreign key are showing!


Just this week I needed the ability to find all the foreign keys in my SQL DB as there was something that didn’t quite makes sense to me, and it’s better to know then to be sorry.. Here is the handy little script that does the trick (source):

Code Snippet
  1. SELECT
        K_Table = FK.TABLE_NAME,
        FK_Column = CU.COLUMN_NAME,
        PK_Table = PK.TABLE_NAME,
        PK_Column = PT.COLUMN_NAME,
        Constraint_Name = C.CONSTRAINT_NAME
    FROM
        INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS C
    INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS FK
        ON C.CONSTRAINT_NAME = FK.CONSTRAINT_NAME
    INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS PK
        ON C.UNIQUE_CONSTRAINT_NAME = PK.CONSTRAINT_NAME
    INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU
        ON C.CONSTRAINT_NAME = CU.CONSTRAINT_NAME
    INNER JOIN (
                SELECT
                    i1.TABLE_NAME,
                    i2.COLUMN_NAME
                FROM
                    INFORMATION_SCHEMA.TABLE_CONSTRAINTS i1
                INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE i2
                    ON i1.CONSTRAINT_NAME = i2.CONSTRAINT_NAME
                WHERE
                    i1.CONSTRAINT_TYPE = 'PRIMARY KEY'
               ) PT
        ON PT.TABLE_NAME = PK.TABLE_NAME

With this script you will see all the foreign keys relating all of your SQL Tables to one another!

Posted in Computers and Internet, Programming, Snippit | Tagged , | Leave a comment