Pointers For The New SQL Programmers (Tutorial)

SQL, which stands for Structured Query Language, is a computer language for declaring and managing databases. It’s been around since the 70’s (at that time it was referred to as SEQUEL), but was later improved during the 80’s and the name was changed. As you likely know, those who write code are always looking to make things shorter and sweeter. It only seemed natural to knock out the vowels and change it SQL.

Sql server

Since its creation, SQL has only become more popular and relevant. Almost every website in existence uses it in some form or another if they have data to be stored. It can be used for all sorts of things and is especially useful when it comes to creating databases for log-in information and account profiles.

With the rising popularity of SQL comes the demand for more people who know how to write it. If you are already on the road towards becoming a professional SQL programmer, then you’re on the right path. However, everybody needs a little help now and again. There are hundreds of SQL server tutorials on the web. We’ve also gathered a few must-know tips to help you along the way.

Stick With Compliant Code.

SEQUEL became SQL when it was standardized by ANSI. It was later standardized by ISO. There are new changes implemented all of the time. As a professional SQL programmer it’s up to you to keep up with these revisions. Examples include SQL:1999, which is regarded as the most important set of revisions, and SQL:2008.

You likely already understand the importance of standard complaint code. First, there is the issue of maintainability. You want code that will last a long time and be easily updated in the future. If someone else ever needs to work on your code you want their job to be as easy and pain free as possible. Second, there is the matter of cross platform compliance.

This is even more relevant today than it has ever been as more people are turning to handheld devices, game systems, and other newer forms of technology. Compliant code is easier for people and machines to understand over the coming years and decades.

Consider SQL Training.

There is a lot to be learned from the web in the form of SQL server tutorials, forums, and tips, but you shouldn’t stop there. If you hope to land a job as professional SQL programmer, then you need to do everything possible to master the field and stand out from the competition. There is no better way to learn SQL than through professional training with a real instructor.

SQL training courses can be found online and in certain institutions. Some people prefer in-person training and others don’t mind learning from behind their computers. Once your training is complete you should receive some sort of certification.

Not only does this mean you’ve learned more than you knew before, but that certification will also help you land a job in the future. It shows companies that you’re serious about your craft and you know what you’re talking about.

Share this !
Share On Twitter
Share On Linkdin
Share On Pinterest
Share On Youtube
Share On Stumbleupon
Share On Reddit
Contact us
Posted in SQL Info | Comments Off on Pointers For The New SQL Programmers (Tutorial)

Remember SQL Server Connection String Formation Rules

SQL is not a complicated language, provided that you learn a few basic elements and the way they connect together. You can always have a cheat sheet at hand to help you find your way through the syntax of this language, but you can be more efficient if you simply learn the SQL server connection string formation rules by heart.

sql connection strings

Although blank characters are ignored in almost all instances, you have to be aware they can affect the connection pooling mechanism, so don’t abuse them. Pooled connections should have identical connection strings. Even the slightest difference between them is going to ruin your work, so watch out for those blanks.

The main SQL server string formation rules refer to the use of special characters in values and the way you have to treat them. The problem is that the language attempts to read them as part of the code rather than characters in a keyword or in a value. This is why you need to mark them in a specific way that would help make it clear they don’t belong to the code in those instances.

Sql server connection string

A few other rules to remember are that names are case insensitive, the value type isn’t relevant and escape sequences are not supported. These rules are going to make your work easier, as you won’t need to pay attention to cases and value types all the time.

When it comes to values, you need to use a single-quote if the value starts with a double-quote. Conversely, if the value starts with a single-quote, you have to use a double-quote. Additionally, you should know that if the value starts with a blank character, you have to enclose it in single- or double-quotes, otherwise it is going to be ignored and deleted. The same rule applies for trailing spaces in values, so you have to always make sure they are inside the quotes if you don’t want them to be ignored. If a value contains the equal sign, you have to precede it by an additional equal sign in order to let the language know this equal sign is actually part of the keyword and not a real equal sign.

Semicolons are important in SQL, so if a value contains a semicolon, you have to place it between quotation marks in order to tell the program it shouldn’t execute it. As semicolons are quite common in values, you need to memorize this rule which saves you from a lot of trouble when handing them.

By taking enough time to understand and learn these rules, you are going to find it much easier to form strings that are correct and work as expected. Together with the right choice of parameters, they can help you connect your application to the database without too many problems. This is the easiest way to avoid all sorts of errors that can keep you for hours in front of your computer, chasing semicolons, trailing spaces and semicolons,

Share this !
Share On Twitter
Share On Linkdin
Share On Pinterest
Share On Youtube
Share On Stumbleupon
Share On Reddit
Contact us
Posted in SQL Info | Comments Off on Remember SQL Server Connection String Formation Rules

Sequel Server Advice when Learning The Ropes

Sequel server software is difficult to wrap your head around at first. This is why you must get to know how it all can work together before you say you’re an expert with it. Many great jobs exist where you manage databases through this type of database language.

Sequel Server

Taking classes on database management may be something that can help you to get familiar with how everything fits together and ends in you getting the database you need that is going to hold all data that’s important in an organized manner. Many people jump in and don’t know too much about making queries and end up costing their company a lot of money. Don’t think you can just do one or two tutorials and be good at it. This is something that takes dedication and learning how to go from a beginner to someone who practices as much as possible.

A good programmer that works with databases will keep up with the updates that come with the software. A lot of the time there are things that come out that help you to patch holes in your system. If you notice that there’s something you need to update, then you should apply it because that can keep you safe. IF you’re not able to make the time, get someone who is capable to do it right away. Hackers look for holes and they then get patched all the time, so if this is for your company you need to be safe.

Find a place where you can ask questions about the various SQL related functions that are out there because you want to know that you’re doing the most you can to work with your knowledge on databases without getting stuck. Before you ask a bunch of people on a forum, learn about the rules and also search to see if this has been answered before. That’s so you’re not just linked to the place where the answer is. Someone who wants to be good with computers has to be able to look questions up, so learn how to utilize search engines.

SQL can be tough but once you have it under your belt you should try to see if there is any more work you can get with it. There are a lot of jobs that have you working with the language, and that’s a great gig to have since it’s such a specialized skill. You should check into what your schools have to offer in the area for job placement. This way, you don’t have to just do one thing and that’s that after you take all the needed time to learn about this kind of thing.

When you finally learn what you can about Sequel server software, you can get started with it right away. Working with the standards in mind that you need to know about to keep databases in proper shape will let you avoid making a mess of things.

Share this !
Share On Twitter
Share On Linkdin
Share On Pinterest
Share On Youtube
Share On Stumbleupon
Share On Reddit
Contact us
Posted in SQL Info | Comments Off on Sequel Server Advice when Learning The Ropes

The Use Of SQL Server Management Studio 2008 R2

The SQL Server Management Studio 2008 R2 is the enterprise edition of this language and it is used by many IT managers to help connecting various software applications with their source data. It is reliable and fast, and it doesn’t have a very steep learning curve, once you manage to install it.

mssql server

One thing you need to know when you install it is that higher versions have the ability to manage all databases coming from lower versions. This is why you don’t need to install multiple versions of the program on a computer. It’s enough to have the latest one and you can manage all your databases, even if they belong to a previous version.

Actually, you have to know what are the components that are shared across all instances of the same major version of the program. This is going to help you understand better what you can do and you can’t do across minor versions of SQL Server. Management Studio is one of the components that are shared in all instances that belong to the same major version of SQL Server, so it doesn’t really matter which one you use in order to be able to take advantage of the full functionality of this component.

SQL Server Management Studio 2008 R2

Unlike SQL Server Management Studio 2008 R2, other components can’t work across all instances, so they need to be upgraded each time you proceed to an SQL Server upgrade. Such details are clearly illustrated on Microsoft’s website, so all you have to do is read the documentation carefully in order to understand what works and what doesn’t work, depending on the major and minor version of the SQL Server you’ve got installed on your computer.

If you need to install two versions in a side-by-side scenario, you can also find all instructions you need on the Microsoft website, together with specifications you need to be aware of for each version and for each component of the program. You can learn how to upgrade SQL Server Management Studio 2008 to SQL Server Management Studio 2008 R2, as well as details about upgrading other components such as SQL Server Book Online, Client tools SDK, SQL Server Profiler and SQL Client Connectivity SDK.

Before doing anything, make sure you read and understand all the steps you have to take in order to perform your upgrade. This will help you avoid various errors which could consume a lot of your time. The same applies for the situation in which you have to uninstall a certain version of the program, either because you did something wrong and it doesn’t work properly, or because you still need the previous version, but you’ve upgraded to the superior one without realizing what was going to happen with all components and with other elements of the program.

SQL is not too hard to understand, but it surely demands a good ability to focus and an attention to detail not too many people can show.

Share this !
Share On Twitter
Share On Linkdin
Share On Pinterest
Share On Youtube
Share On Stumbleupon
Share On Reddit
Contact us
Posted in SQL Info | Comments Off on The Use Of SQL Server Management Studio 2008 R2

Coding a Desktop Application in C# .net

In this post I will be describing the desktop application that I created in .net c# using the windows visual studios platform.

microsoft visual studios

Having some type of licensing system was very important as this was going to be a paid to use software but the actual application was an exe that would reside on the users computer.

We built a loop into the software that would firstly check the clients server to make sure the user was using a valid and approved license. The checking process would communicate with a .aspx file that would query a MsSql database.

The actual application that was being made was a video marketing software that would be used by video marketers, It would allow users to create videos, upload them and share them on social sites.

For creating the actual videos we worked with the well known imagemagick platform that allowed us to manipulate images and then we tied them together using the FFmpeg platform .

For the actual posting part then we worked with .net’s HttpWebRequests protocol and saved cookies and sessions to avoid issues of continues logins

The actual application turned out to be excellent and went on to sell thousands of copies and still sells today.

You can see the application by viewing the video below

Share this !
Share On Twitter
Share On Linkdin
Share On Pinterest
Share On Youtube
Share On Stumbleupon
Share On Reddit
Contact us
Posted in SQL Info | Comments Off on Coding a Desktop Application in C# .net

The CHARINDEX in SQL Server

CHARINDEX () returns the location of an expression in another expression, usually the starting position. Its syntax takes the following arguments:

CHARINDEX (expression1, expression2, location)

Where, expression1 represents the expression to be searched,

expression2 represents the key expression which contains expression1, and

location is optional, it specifies a position in expression2 from which the search for expression1 begins.

Charindex

CHARINDEX () returns a BIGINT/INT based on the data type of expression2, which stipulates the starting point of expression1. For data types declared with (MAX) it returns BIGINT.

Comments

If any of the expression1 or expression2 is of a Unicode data type (nchar or nvarchar) and the other is not, the SQL engine will automatically convert the other to a Unicode data type. CHARINDEX cannot be applied to ntext, image, and text data types.

sql server charindex

In case either expression1 or expression2 turns out to be a NULL, then you should be pretty prepared for CHARINDEX to returns a NULL as well.

Also, in case expression1 is not found inside expression2, then the function CHARINDEX returns 0.

Note that CHARINDEX executes comparisons based on the arrangement of the input. To implement a comparison in a quantified collation, you don’t need to do it manually but instead, you can make use of the already existing function COLLATE to apply an overt collation to the input data.

Remember that the starting position always returned should be 1-based, and not 0-based.

Similarly, the 0x0000 (char (0)) is an indeterminate character in some platforms such as Windows collations and therefore cannot be encompassed in CHARINDEX.

Usage

Using CHARINDEX to extract first and last name of a person

DECLARE @ Name VARCHAR (120)
SET @ Name = ‘Tom House’
SELECT LEFT (@ Name, CHARINDEX (‘ ‘, @Name) – 1) AS [First_Name],
RIGHT (@ Name, CHARINDEX (‘ ‘, REVERSE (@ Name)) – 1) AS [Last_Name]

The output of the above code is:
First Name Last Name
———- ———-
Tom House

Another Example usage

DECLARE @string VARCHAR (150)

SET @string = ‘CHARINDEX to search for a first occurrence of a specified string/character’

SELECT CHARINDEX (‘Char’, @string) AS ‘Position’,

CHARINDEX (‘Char’, @string, 2) AS ‘Position’

The Output is:

Position Position

———– ———–

1 75
(1 row(s) affected)

In the above illustration, the first columns returns 1 as the string began with ‘Char’, while in the second segment the search was begun from ‘HARINDEX’, which brought about giving back the second recurrence of ‘Char’.

Most search depend on the data’s collation. CHARINDEX () has performed a case-insensitive search as my present collation is set to Latin1_General_CI_AI. To perform a case-sensitive inquiry here we can apply Latin1_General_CS_AI collation to @string.

Another utilization of the CHARINDEX string function, which is not very self-evident, is in sorting an outcome set. How about we expect you have a table which contains a U.S. State Code and rather than sorting the outcome sequentially taking into account the U.S. State Code you need it sorted by specific states, as NY, TX, FL, CA, in a specific order. This can be refined utilizing the CHARINDEX string function:

SELECT *
FROM [dataB1]. [Names]
ORDER BY CHARINDEX ([State], ‘NY – TX -FL- CA ‘)

Share this !
Share On Twitter
Share On Linkdin
Share On Pinterest
Share On Youtube
Share On Stumbleupon
Share On Reddit
Contact us
Posted in SQL Info | Comments Off on The CHARINDEX in SQL Server

What Does an SQL Server Error Mean?

If you see an SQL Server Error on one of your websites, then you may be rather confused as to what the error means. The good news is that the SQL Server Errors are usually quite descriptive.

 

SQL errors

If the error says that the server was unable to select database, then provides the name of the database. then this means that there is something wrong with your connection string. Either the database does not exist, the username or password you provided was incorrect, or the user that you provided does not have the rights to access that database.

On the other hand, if the error simply says that there is a problem with your syntax, then this may be more difficult to diagnose.

Common problems with SQL syntax include mis-spelling field or table names, not surrounding names with quotes if the field name is a reserved word, missing out quotation marks or brackets that would be important punctuation for the query, and attempting to insert data that does not match the type of the field you are working with.

SQl Server Error

SQL is quite error tolerant, and it will often fail silently if you try to do something that is syntactically incorrect. For this reason, it is important that you enable error logging when you are trying to work with a database that is giving you problems. Error logging will help you to identify a lot of problems that you would otherwise struggle to diagnose.

Once you have your database working reasonably well, be sure to turn verbose error reporting off. The last thing that you want is for your SQL server to send snippets of the query to the public facing part of the website when there is an error. This could be a massive security issue if it is noticed by a malicious user. Admittedly, relying on not revealing information is, to an extent, security through obscurity, but it is something that you will want to get used to – you do not want to give away information about the configuration of your server unless you absolutely have to.

Once your website is up and running, you are unlikely to see SQL errors unless the server falls over or your configuration files get corrupted. However, during testing you may find that there are a number of potential problems. For example, if the site accepts input from users and uses it to build a database query, then this could create potential for SQL injection attacks, and sometimes these will occur by accident in testing, throwing errors when malformed SQL statements are sent to the server.

Properly sanitising your inputs will prevent this, and this is one of the first things that you should get in the habit of testing for. Make sure that you know exactly what is going on in your server at all times, and that any queries sent to it serve a clear purpose, and contain only the information they are supposed to contain.

Share this !
Share On Twitter
Share On Linkdin
Share On Pinterest
Share On Youtube
Share On Stumbleupon
Share On Reddit
Contact us
Posted in SQL Info | Comments Off on What Does an SQL Server Error Mean?

Everything To Know About SQL, Structured Query Language

Network software packages are increasingly becoming larger and more flexible. Quite often, the principle scheme of operation is actually a selection of scripts that regulate the pattern of a particular database.
Because of the diversity of languages and existing databases, the way to ‘connect’ between each other can become very complicated and challenging, luckily, the use of standards that allow us to try and do those functions in a widespread form make this puzzling task more convenient to execute.

sql server

This is what Structured Query Language (SQL) is about, SQL is merely an international standards language of communication within databases. Consequently, Structured Query Language (SQL) is a standardized language that allows us to use pretty much any language e.g. ASP or PHP, in combination with any sort of database e.g. MySQL, SQL Server, and MS Access.

SQL was first developed by IBM in the 1970’s, initially it was actually referred to as SEQUEL, Structured English Query Language. It is in the years to come that Oracle and Microsoft also embraced this language. Its popularity and use grew and this led to SEQUEL being changed to SQL. In 1986, the definition of SEQUEL was standardized by the American National Standards Institute (ANSI) to SQL. Essentially, they dropped the world ‘English’ from the term.

Until the present day, there are lots of users who object to refer to it as SQL, to them, SEQUEL should be the right name for this international standardized database language. SQL has also been revised in 1989 and later 1992 (SQL-92).

SQL claims to be an internationally standardized language, but this does not imply that it is similar to every other database language out there today. Furthermore, some databases put into operation certain functions that would not necessarily run in others. That is the reason why every supplier who offers database products including Microsoft and Oracle have their own certification process to make sure that men and women who take the certification test are very well prepared and know the differences between the many different types of SQL. Their knowledge has to be centered on their own personal specific version of SQL.

SQL is not just relevant due to the ability to standardize a normally confusing language, it has two other completely unique characteristics. On one side, it is extremely versatile and powerful. Also, you will find that it is easily accessible and that makes it a ‘language’ easy to understand.

There are several database products that support SQL, however, the two biggest and most widely used are Microsoft SQL server and Oracle database.

Each and every company that delivers database products has their personal approach to develop a prospect into an ‘expert’. Microsoft features a selection of certifications to make certain that every person who is Microsoft SQL Certified fits their specifications. Oracle does a similar course of action.

SQL or Structured Query Language has continued to grow and get numerous improvements over the years. This very popular language is used in many parts of the world to help individuals and organizations to run efficient and fully functional database systems.

Share this !
Share On Twitter
Share On Linkdin
Share On Pinterest
Share On Youtube
Share On Stumbleupon
Share On Reddit
Contact us
Posted in SQL Info | Comments Off on Everything To Know About SQL, Structured Query Language

My Coding Journey

I first started to code about 10 years ago from my basement. I used to love it, I would spend hours each day trying to optimize my code.

Today I am a full time work from home farther of 2 – I will be using this blog to share all of my tweaks, tricks and tips on both SQL and MSSQL

For now watch the video below

Share this !
Share On Twitter
Share On Linkdin
Share On Pinterest
Share On Youtube
Share On Stumbleupon
Share On Reddit
Contact us
Posted in SQL Info | Comments Off on My Coding Journey