SELECT SQL Select SQL and upgrade your performance

  • SELECT SQL
  • MSSQL
  • MySQL
  • Utilities
  • CSV to SQL
  • Contact
0
DateAdd and Leap Year issue
DateAdd and Leap Year issue
There is an issue with Leap Year and DateAdd function that can appear if you want to compare two dates from different years and using some date value ...
How to SELECT Min/Max value with associated column from same row
How to SELECT Min/Max value with associated column from same row
When you need select Min or Max value from table with one column, it's easy SQL task. A little harder is same request when you want to find minimum va...
Solved - Arithmetic overflow error converting float to data type numeric
Solved - Arithmetic overflow error converting float to data type numeric
Are you trying convert float to numeric and you get "Arithmetic overflow error converting float to data type numeric" error? This could happen even if...
How to recover unsaved T-SQL or previous version of altered view or store procedure
How to recover unsaved T-SQL or previous version of altered view or store procedure
When you alter view or stored procedure and you realize, previous version wasn't saved and you need it. Or you want recover SQL script immediately aft...
How to find and remove hidden characters and invisible whitespace when LTrim, RTrim not work
How to find and remove hidden characters and invisible whitespace when LTrim, RTrim not work
Sometimes it can happen, that you compare two strings, which looks exactly sames, but they are processed as not equal. Also when you use SELECT DISTIN...
 
 
Execute SQL Task Error: 0xC002F210, Problems with the query,
Execute SQL Task Error: 0xC002F210, Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly
3 most often reason, when you are using variables in Execute SQL task inside SSIS and get following error: Error: 0xC002F210 ... , Execute SQL Task: ...
How to use a variable inside SQL in SSIS Data Flow Tasks
How to use a variable inside SQL in SSIS Data Flow Tasks
Sometimes you need to use a variable inside SQL in SSIS Data Flow Tasks. For example, you may want to select TOP x records in a periodically scheduled...
Solved - Retrieving the COM class factory for component with CLSID in SSIS
Solved - Retrieving the COM class factory for component with CLSID in SSIS
I get strange error during redeveloping one SSIS. When I tried run some SQL task, finally such an easy one with "SELECT 1", I always received same err...
Loop through ADO recordset in SSIS
Loop through ADO recordset in SSIS
For some solutions in SSIS you may need to go over all records from some SELECT and each record use in some subqueries. In this case you want loop rec...
 
 
A couple of MySQL DML things I did not know
A couple of MySQL DML things I did not know
As I'm coming from Microsoft SQL Server environment, working with MySQL is constantly surprising me in many ways, both good and bad :) In contrast to ...
Read this Entry
SQL script to create intro image by parsing article text in Joomla 3.x
SQL script to create intro image by parsing article text in Joomla 3.x
When I migrated one of my web site from Joomla 1.5 into Joomla 3.3 I found there is finally nice feature in Joomla 3.x called Images and Links, which ...
Read this Entry
How to merge 2 tables into one result in MySQL
How to merge 2 tables into one result in MySQL
Today I get interesting question. How to merge in MySQL two tables, where could be same primary key and different values. Result should be as select f...
Read this Entry
 
 

DateAdd and Leap Year issue

Details
Written by Stanislav Duben
Published: 28 May 2018
Parent Category: MSSQL

SQL icon baseThere is an issue with Leap Year and DateAdd function that can appear if you want to compare two dates from different years and using some date value from table. For example if you have calendar table and use DateAdd function, you can get 2 rows wit two date for one source date instead of expected 1 row. See bellow reason and solution.

Read more: DateAdd and Leap Year issue Add new comment
Last Updated: 28 May 2018
Hits: 145864

How to SELECT Min/Max value with associated column from same row

Details
Written by Stanislav Duben
Published: 20 March 2018
Parent Category: MSSQL

SQL icon baseWhen you need select Min or Max value from table with one column, it's easy SQL task. A little harder is same request when you want to find minimum value and maximum value associated with column from minimal value row. For example, let's say we want see Customer with his minimum sales order plus amount value of this order and compare it to maximum value from any other order made with this customer.

Read more: How to SELECT Min/Max value with associated column from same row Add new comment
Last Updated: 20 March 2018
Hits: 24774

Solved - Arithmetic overflow error converting float to data type numeric

Details
Written by Stanislav Duben
Published: 01 November 2017
Parent Category: MSSQL

SQL icon baseAre you trying convert float to numeric and you get "Arithmetic overflow error converting float to data type numeric" error? This could happen even if all was working before and now it fails. The reason should be in precision and scales settings.

Read more: Solved - Arithmetic overflow error converting float to data type numeric Add new comment
Last Updated: 01 November 2017
Hits: 132819

How to script all Jobs in SQL Server Management Studio

Details
Written by Stanislav Duben
Published: 11 August 2017

cofee_book.pngWhen you need script more than one job from Microsoft SQL Server Management Studio by right click with mouse 'Script job', you will find you can script only one object and you cannot choose more than one job at once. Even with Shift or Ctrl key. Script all of then one by one can be really long and unpleasure work. But there is a an easy way, how to script all jobs (or objects like views, tables etc.).

Read more: How to script all Jobs in SQL Server Management Studio Add new comment
Last Updated: 11 August 2017
Hits: 12455

How to recover unsaved T-SQL or previous version of altered view or store procedure

Details
Written by Petr Slaba
Published: 15 June 2017
Parent Category: MSSQL

SQL icon baseWhen you alter view or stored procedure and you realize, previous version wasn't saved and you need it. Or you want recover SQL script immediately after management studio crash and you were lucky, that you run it at least once. There is a nice tricky way how do to it by SQL script without any 3rd party enhancement. 

Read more: How to recover unsaved T-SQL or previous version of altered view or store procedure Add new comment
Last Updated: 15 June 2017
Hits: 19392

How to find and remove hidden characters and invisible whitespace when LTrim, RTrim not work

Details
Written by Stanislav Duben
Published: 04 April 2017
Parent Category: MSSQL

SQL icon baseSometimes it can happen, that you compare two strings, which looks exactly sames, but they are processed as not equal. Also when you use SELECT DISTINCT and still there are rows that looks same, like DISTINCT is not working. Dimensional attribute in OLAP can return errors for duplicities even you used DISTINCT for dimension. This is the right time to search invisible/hidden characters in string.  RTrim and LTrim function not stripping whitespace.

Read more: How to find and remove hidden characters and invisible whitespace when LTrim, RTrim not work Add new comment
Last Updated: 11 April 2017
Hits: 77043

Page 1 of 5

  • Start
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next
  • End

Contact

Travel Guides

  • Travel Guides
  • Atlanta Travel Guide
  • Berlin Travel Guide
  • Brazil Travel Guide
  • Bulgaria Travel Guide
  • Caribbean Travel Guide
  • Detroit Travel Guide
  • Egypt Travel Guide
  • Hong Kong Travel Guide
  • Japan Travel Guide
  • Madrid Travel Guide
  • Miami Travel Guide
  • New York Travel Guide
  • Norway Travel Guide
  • Prague Travel Guide
  • Rome Travel Guide
  • Shanghai Travel Guide
  • Slovakia Travel Guide
  • Spain Travel Guide
  • Sydney Travel Guide
  • Tijuana Travel Guide
Powered by T3 Framework