Oct
29
2015
SQL // Hadoop

Uniqueidentifier data type in SQL Server not supported in Hive

Recently, while using Sqoop to pull data into Hadoop from MS SQL Server, I found an issue with a table whose primary key was a uniqueidentifer column (GUID).  The problem was nicely documented on StackOverflow here.

As a result I’ve taken the approach of designing the data load routines in Java to alternate between using –split-by and –num-mappers depending the table schemas and it is working beautifully.

Jan
14
2015
SQL // Tools

SQL Query to search databases for object by name

I didn't write this, as usual I found it on Stack Overflow and other places. I had a need to search a SQL database for tables, views, and columns that contained certain key words.  This has been very helpful.

 

 Declare @ObjectName VarChar (100)

Set @ObjectName = '%post%'

Select 'QTR_CC_SEA' as DatabaseName, [name] as ObjectName, Type as ObjectType
From QTR_CC_SEA.Sys.Objects
Where 1=1
and [Name] like @ObjectName
and Type in ('U', 'P')

SELECT COLUMN_NAME, TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE @ObjectName
AND COLUMN_NAME not like 'tbl_aud%'

 

Calendar

<<  May 2017  >>
MoTuWeThFrSaSu
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

Page List

    RecentComments

    None