-
During a large ETL process from a staging table , UPDATE was creating an error on a CONVERT. Msg 245, Sev 16, State 1, Line 17 : Conversion failed when converting the nvarchar value '慬浩ų㈁ ㈀ ĀĀ畁桴牯摥䈁獵湩獥癅湥Ŵ潃浭牥楣污䤠敲慬摮ā䤁呃䥓㐳㌱㠵Ķ昶㐱挴㠹戭㕣ⵥㄴて戭㔶ⴰ挶㠱挴敥户晦ਁ1217' to data type int. [SQLSTATE 22018] It was necessary...
-
Executing a t-sql statement with a convert function convert(datetime, my_date_column) , threw an arithmetical overflow error with the message : Message Arithmetic overflow error converting expression to data type datetime. [SQLSTATE 22003] (Error 8115) The statement has been terminated. [SQLSTATE 01000...
-
There are many aggregate functions available in SQL Server. One thing that most of the people forget is that Aggregate functions always return atleast a row no matter if there are rows in the table or where clause returns or does not return any resultset Consider the following example declare @t table...
-
Quotename() is a SQL Server String function. It accepts an input string of of up to 128 characters. Which is a limitation, although you could easily create a workaround with a UDF Returns a Unicode string of a valid delimited identifier. Why would you use Quotename()? 1) Reviewing for SQL Injection Attacks...
-
This follows my other three posts at http://beyondrelational.com/blogs/madhivanan/archive/2011/05/03/sql-server-s-equivalent-of-oracle-functions-part-i.aspx http://beyondrelational.com/blogs/madhivanan/archive/2011/05/03/sql-server-s-equivalent-of-oracle-functions-part-ii.aspx http://beyondrelational...
-
This follows my other two posts at http://beyondrelational.com/blogs/madhivanan/archive/2011/05/03/sql-server-s-equivalent-of-oracle-functions-part-i.aspx http://beyondrelational.com/blogs/madhivanan/archive/2011/05/03/sql-server-s-equivalent-of-oracle-functions-part-ii.aspx ORACLE SQL Server bfilename...
-
This follows my part I at http://beyondrelational.com/blogs/madhivanan/archive/2011/05/03/sql-server-s-equivalent-of-oracle-functions-part-i.aspx ORACLE SQL Server Decompose Cast or Convert (Ex cast(string as nvarchar(8000)) numtodsinterval select datename(dayofyear,DATE)-1,CONVERT(varchar(18),date,108...
-
Often you may need to know what are the SQL Server's equivalent of ORACLE's function when you migrate your Database from ORACLE to Server.In this series of post, I will show you the SQL Server's equivalent of ORACLE functions. ORACLE SQL Server Decompose Cast or Convert (Ex cast(string as...
-
I have already posted two posts about extracting numbers from a string http://beyondrelational.com/blogs/madhivanan/archive/2007/12/18/extract-only-numbers-from-a-string.aspx http://beyondrelational.com/blogs/madhivanan/archive/2010/04/22/extracting-numbers-part-2.aspx Loana in her blog posted a post...
-
Someone in the forums asked for finding out a string in which each character is same. Consider the following example declare @t table(data varchar(20)) insert into @t select '222222222222' as data union all select '666666663466' union all select 'aaaaaaaa'+CHAR(32) union all select...
-
Modulus operator is used to find the remainder after the division. All programming languages have specific operators to find a remainder like mod, rem, etc. In SQL Server, we can use modulus operator %. However we can also use general approach to find a remainder. Here are two methods Method 1 : Use...
-
In Part I of this series SQL Server's equivalent of MS Access functions, I have posted some direct equivalents. In this post, I post other functions that dont have direct equivalent Choose : Returns a value from the list based on a given position declare @list varchar(1000) declare @select varchar...
-
Sometimes when you want to migrate from MS Accesss to SQL Server, you need to rewrite the queries compatible to SQL Server. As you know the basic systax is same but the functions used in Access should be replaced with their equivalent in SQL Server. Here are some Access functions and their equivalent...
-
Sometimes back, my friend told me that they had an application where users update their timesheets. He suspected that some users who had access to the database directly update some entries. He wanted to know whether some users update entries using a query analyser and not using the application. You can...