diff --git a/bi_sql_editor/models/bi_sql_view.py b/bi_sql_editor/models/bi_sql_view.py
index f02d8a4e..3a62d357 100644
--- a/bi_sql_editor/models/bi_sql_view.py
+++ b/bi_sql_editor/models/bi_sql_view.py
@@ -570,3 +570,9 @@ class BiSQLView(models.Model):
sql_view.view_name)
self.env.cr.execute(req)
sql_view.size = self.env.cr.fetchone()[0]
+
+ @api.multi
+ def button_preview_sql_expression(self):
+ self.button_validate_sql_expression()
+ res = self._execute_sql_request()
+ raise UserError('\n'.join(map(lambda x: str(x), res[:100])))
diff --git a/bi_sql_editor/views/view_bi_sql_view.xml b/bi_sql_editor/views/view_bi_sql_view.xml
index b4f13063..9b7a4d04 100644
--- a/bi_sql_editor/views/view_bi_sql_view.xml
+++ b/bi_sql_editor/views/view_bi_sql_view.xml
@@ -29,6 +29,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+