Sunday, November 1, 2015

INSERT & DELETE

Thursday, June 5, 2014

SQL Server -- Query Table Record Data via TSQL - WHERE CLAUSE - AND Oper...

This SQL Server tutorial shows the tricks for using the AND operator in the query WHERE clause. It demonstrates how to do this from the TSQL Command line.




SQL SERVER COURSE - 95% OFF FOR OUR READERS

For those of you that would like to broaden your understanding of SQL Server, or if you work with someone who needs a little (or a lot of) help :), We are offering a huge discount to one of our most popular online courses. It is the lead off course which discusses tables - what to do and not do. It is very instructional, practical and straightforward.



Normally this course is $199.00, but for a limited time it is available through this offer for only $3.00!   Click the link below to get started:

SQL Server -- Query Table Record Data via TSQL - WHERE CLAUSE - The OR O...

This SQL Server tutorial shows the tricks for using the ORoperator in the query WHERE clause. It demonstrates how to do this from the TSQL Command line.





SQL SERVER COURSE - 95% OFF FOR OUR READERS

For those of you that would like to broaden your understanding of SQL Server, or if you work with someone who needs a little (or a lot of) help :), We are offering a huge discount to one of our most popular online courses. It is the lead off course which discusses tables - what to do and not do. It is very instructional, practical and straightforward.



Normally this course is $199.00, but for a limited time it is available through this offer for only $3.00!   Click the link below to get started:

SQL Server -- Query Table Record Data via TSQL -- WHERE CLAUSE -- AND, O...

When it comes to using SQL Server and writing TSQL queries, you really need to understand the WHERE CLAUSE. It is primarily used to state your criteria, or in other words, how you will be filtering records. Other wise you will return every record in a table or a set of tables, and that is almost never desirable.
 
The structure of the WHERE CLAUSE has a lot of pieces to it and you can nest as many AND and/or OR operators. It is very handy. The video below will get you started.
 
Note: The WHERE CLAUSE always follows the FROM CLAUSE and always PRECEDES the ORDER BY Clause, if the ORDER BY Clause is used. The Order BY Clause is optional. Actually, so is the WHERE Clause. The FROM Clause is also optional, but it is highly unlikely that it will be missing.
 
Most of the time you will be running a query (F5 button) from the command line in SSMS (SQL Server Management Studio) or perhaps from within a stored procedure.
 

 



SQL SERVER COURSE - 95% OFF FOR OUR READERS

For those of you that would like to broaden your understanding of SQL Server, or if you work with someone who needs a little (or a lot of) help :), We are offering a huge discount to one of our most popular online courses. It is the lead off course which discusses tables - what to do and not do. It is very instructional, practical and straightforward.



Normally this course is $199.00, but for a limited time it is available through this offer for only $3.00!   Click the link below to get started:

SQL Server FAST TRACK - Course 101 - Tables

SQL SERVER - STORED PROCEDURES - HOW TO WRITE TO A FILE

One of the coolest features of SQL Server coding is the ability to write to a text file. You can actually write to any ASCII based flat file format, like plain text (.TXT). comma separated values (.CSV) also known less officially as comma separated files, tab delimited and even special import files for QuickBooks (.IIF).
 
In order to do this you will need to turn on a few features in SQL Server that are initially turned off:
 
xp_cmdshell
 
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE
GO
 
Ole Automation
 
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
reconfigure with override;
GO
 

 
The video below will go into a lot more detail than this article. However, you need to understand that even if you run the two previous scripts (and you must be an administrator), and even if you are referencing a real location on the server, sometimes this writing to a file still won't work. It can be frustrating. If this happens to you it is possible that you do not have OS (operating system) permissions on the folder. Permissions will always burn you.
 
If so, try adding the user "Everyone" and then give the "Everyone" account write permissions. That usually takes care of any issues in WIndows.
 
If you find this video helpful, please leave a comment below!
 



SQL SERVER COURSE - 95% OFF FOR OUR READERS

For those of you that would like to broaden your understanding of SQL Server, or if you work with someone who needs a little (or a lot of) help :), We are offering a huge discount to one of our most popular online courses. It is the lead off course which discusses tables - what to do and not do. It is very instructional, practical and straightforward.



Normally this course is $199.00, but for a limited time it is available through this offer for only $3.00!   Click the link below to get started:

SQL Server FAST TRACK - Course 101 - Tables

SQL SERVER - QUERIES - FROM CLAUSE - JOIN vs NO JOIN




SQL SERVER COURSE - 70% OFF FOR OUR READERS

For those of you that would like to broaden your understanding of SQL Server, or if you work with someone who needs a little (or a lot of) help :), We are offering a huge discount to one of our most popular online courses. It is the lead off course which discusses tables - what to do and not do. It is very instructional, practical and straightforward.

Normally this course is $199.00, but for a limited time it is available through this offer for only $18.00!   

SQL SERVER COURSE - SAVE 70% !!

SQL Server FAST TRACK for Novices - Tables

Quickly master intelligent table design and management via SSMS, Queries, TSQL, Scripting and Stored Procedures.   Get Started

SQL SERVER - QUERIES - FROM CLAUSE - JOIN vs NO JOIN

This video covers some of the more important theories of SQL. A join is a way of stating certain requirements in the FROM CLAUSE as opposed to writing much more confusing and convoluted code in the WHERE CLAUSE. The reason to do this is that it will make your code cleaner and tighter (easier to maintain) as well as making it much more easier to read.
 

 
By adhering to these coding standards you will have a better coding experience. The technologies that are available in both SQL (Structured Query Language) and then SQL Server's T-SQL (Transact SQL) are really in place to help you to create a more robust and clear query. Your stored procedures (SP's or sprocs or procedures), user defined functions (UDF's or functions) and trigger code will be much better and will integrate more easily with the feelings and preferences of most other typical and advanced software developers.
 



SQL SERVER COURSE - 70% OFF FOR OUR READERS

For those of you that would like to broaden your understanding of SQL Server, or if you work with someone who needs a little (or a lot of) help :), We are offering a huge discount to one of our most popular online courses. It is the lead off course which discusses tables - what to do and not do. It is very instructional, practical and straightforward.

Normally this course is $199.00, but for a limited time it is available through this offer for only $18.00!   

SQL SERVER COURSE - SAVE 70% !!

SQL Server FAST TRACK for Novices - Tables

Quickly master intelligent table design and management via SSMS, Queries, TSQL, Scripting and Stored Procedures.   Get Started