Wednesday, October 24, 2012

How do you debug your stored procedures?

Well, perhaps 'Debugging' is not the best way to describe it. If you need to debug a procedure step-by-step, there are tools within SQL Server (or Visual Studio) that will, in most cases, allow you to do so.

But in real life (or let's just say - production), we often face a different situation where Stored-Procedures are being executed by the Application side (DAL's in most cases)
And sometimes, we don't just need to see which procedure was executed when (if we want to do this Profiler is there to help) - we need to track certain activities inside the stored procedures.

While application developers have a lot of logger libraries (such as Log4Net, for example), SQL Developers don't have an out-of-the-box solution.

So SQL Developers write their own solutions, and sometimes even use PRINT (god forbid!) within the procedures to track the output (yes, even today!)

This is why we've created Log Table Viewer.
The solution includes a simple table/procedure to write the log message (+severity and some other optional properties), and a client viewer to easily see and explore the written messages.

After deploying the solution (which is done automatically by the viewer app - by clicking this button):

you get a new procedure, which can be executed as simple as that:



EXEC usp_write_to_log @source='TestScript', @message='Hello World', @severity=1

What happens (by default) is this:
1:
You see an immediate output to the screen (if executed by SSMS) with the message
[Oct 24 2012  4:06:13:397AM] Hello World
The console does not use "PRINT" (which does not flush immediately into the screen), but rather a RAISERROR(@console_message,10,1) WITH NOWAIT statement, which is better in these cases

2:
A log message is written to our log table (tblLog)


There are many other option parameters when executing the procedures, here's the actually interface:
usp_write_to_log( 
 @source VARCHAR(255),
 @message VARCHAR(4192), -- 4k
 @severity INT = 1, /*0=Debug, 1=Informational, 2=Warning, 3=Critical*/
 @category INT = 1, /*1=Databases. For future use if more clients use this usp*/
 @write_to_console BIT = 1, /*New: Only write to console, not table*/
 @write_to_table BIT = 1, /*New: Only write to table not console */
 @write_to_sql_log BIT = 1, /*New: output to SQL errorlog as well (only for warning, error)*/
 @write_to_sql_log_minimum_severity INT = 3,
 @suppress BIT = 0 /*New emergency option; When compiled with (1) no actual writes to tblLog are made.*/
                           )


So now, you can easily use this procedure to write various messages inside your SQL Code.
Here's a screenshot for one of my servers, with some recent messages (just so you get the look & feel)
You can see the "Hello World" message we just wrote on the previous example:

Log Table Viewer - Real-time display


Tuesday, October 16, 2012

Triple release day!

3 Updates are being released today, for ClipTable, Database File-Explorer & Log-table Viewer

Here's the change-log:


ClipTable:
- BCP (insert) mode is now available! ClipTable can generate a BCP IN statement of any CSV file
- Added an option to turn any column into a string (after clipboard import is done)
- Data in grid can automatically extend on edit
- Better white-spaces handling on string analysis
- Improved XML detection
- SQL Text highlight feature implemented
- Multiple UI improvements
- v1.0.3.2 Released

Database File-Explorer:
- Log file is now being recycled when over a configured size (currently 10mb)
- Added ChangeLog (inside the About Window)
- Core classes updated
- SQL Text highlight feature implemented
- Shared Repository:
- Added SQL Profiler integration
- If multiple versions are installed, SSMS/Profiler will launch at the newest version
- Multiple UI improvements
v1.0.2.3 released


LogTableViewer:
- Main Engine updated
- SQL Text highlight feature implemented
- Multiple UI improvements
v2.0.1.6 Released


Shared Repository: (which means, all of the above)
   - Added SQL Profiler integration
   - If multiple versions are installed, SSMS/Profiler will launch at the newest version
   - Multiple UI improvements

Download all for free: 



Wednesday, October 3, 2012

(ClipTable) INSERT solutions

Hey ClipTable users!

As a user, you probably already know how ClipTable can quickly turn any data into a SQL Table.
The main-stream option would be:
- Copying a tabular data into your clipboard
- Pressing the magical "Import" button
- Defining a destination server
- Execute!

But there is more to it; Today I'm going to cover some other INSERT options ClipTable supports


For the demo I'm going to use a simple query against AdventureWorksLT2008:
select from AdventureWorksLT2008.SalesLT.CustomerAddress
I'm taking the result and saving it as a CSV file, and also copying the result into the clipboard.


The first one is the "Generate INSERT Statement" option; which, instead of pumping the data into the table, creates an insert script you can launch anywhere.
Here's how you use it:

Copying the above query data into the clipboard, I click "Import from Clipboard", and the query data now appears in ClipTable (see screenshot):





























Next, I'm going to jump right to the "Setup & Go" tab, but instead of clicking "Execute", I'm going to click the other part of the button, which contains additional insertion options (see screenshot):


Now, select the "Generate INSERT statements only", and the following window appears:

From this point, simply copy the data and execute anywhere you want.
Easy, isn't it?

Now let's move on to the other option: BULK INSERT.
On this option, you let ClipTable perform a field analysis on a CSV file, and then creating a complete BULK INSERT statement to load this file into a table, without having ClipTable to read the entire content into the memory first.
Needless to say, this feature is not 100% bullet-proof due to some known differences with BULK INSERT behavior  as well as the fact that the default option is to not analyzing to entire file (speed & memory considerations), so field types may need some additional tune-ups.

OK, Let's go back to the "Import Clipboard Data" tab, only this time, we'll select the "Import from File" option (see screenshot):


Now, let's choose the CSV we've prepared earlier.
Before doing so, as a preparation for the bulk insert, there are two options we're going to change:
1. Make sure "Treat NULL strings as DbNull" option is unchecked
2. Uncheck "Data contains Headers" (since the CSV file does not contain headers on the 1st line)
(see screenshot):

Now, let's jump to the "Setup & Go" tab again and choose the "Generate BULK INSERT" option.
The following window appears:

Again, you can now use this data from your Management Studio (or equivalent) in order to load the data into your table.


Ready to give it a shot?
Get the latest version (for free) here: http://www.doccolabs.com/products_cliptable.html

Cheers

Monday, September 24, 2012

Calling all SQL Azure users!

Today, we've released two new versions for both ClipTable & Log Table Viewer which, for the first time, enable full support for Windows Azure environment, SQL Azure in specific.

What this means is -
In Log Table Viewer - you can now apply the logger solution directly into your SQL Azure database, and use the client directly with the database to explore your log messages

In ClipTable - every table you create on-the-fly using ClipTable's superb import engine, can be created directly on your SQL Azure

Both new versions are available here:

Here's the full changelog for both versions:

Log Table Viewer:
- SQL Azure support. Full compatibility with Azure enables you to apply the logger solution on your Azure servers/databases
- Fixed GMT+0 reporting
v2.0.1.5 Released


ClipTable
- Added an option to generate an INSERT statement (content button next to "Execute")
- Boolean (BIT) datatype support/detection
- Tighter SQL Azure support, including:
  - Automatic recognition
  - Automatic Primary key check when Azure is detected
- Fixed BOOLEAN type on PostgreSQL
v1.0.3.0 Released

Wednesday, September 12, 2012

Triple Release day!

We have 3 updates today:

  • Database File Explorer v1.0.2.2 <link>
  • Log Table Viewer v2.0.1.4 <link>
  • ClipTable v1.0.2.9 <link>

And behind the scenes, some updates to our Shared Repository, which now supports integration and direct connectivity with Remote Desktop (RDP) and SQL Server Management Studio (SSMS)

Both available by right-clicking any server from within the repository:



Get your updates and enjoy!


Tuesday, September 4, 2012

Database File Explorer v1.0.2.1 has been released

Fresh out of the oven - a new version of Database File Explorer (product link)

Recent changes include:

- Added free disk space info (for each drive)
- Databases Graph/Pie - system databases are hidden by default (configurable)
- Fixed a small bug regarding viewing a table in reverse order (TOP N DESC)

Thanks for all the feedback! we're always happy to hear how our products help you on the daily SQL tasks.

Get the latest version here : http://www.doccolabs.com/products_dbfileexplorer.html


Tuesday, August 14, 2012

Recent ClipTable usage - exciting

I usually don't share statistics, but this is just amazing:

With no budget, a bit of "Guerrilla marketing", ClipTable alone, has reached over 1,000 unique users from around the world in a bit over two months!


I am very excited to see this, and know this is only the beginning!

Let's continue spreading the word (I said Guerrilla, right?)
My objective is that every DBA (SQL Server, Oracle, MySQL, PostgreSQL) who deals with importing data into their databases (and that means - 99% of them) - Will work with ClipTable!

The other products also have amazing stats, which I'll share in the future. But today the honor goes to ClipTable.

If you're new here - get more information (& download) here: http://www.doccolabs.com/products_cliptable.html

Here's a static map from the past two months: (one marker per country, state/region-level not shown)

ClipTable usage over the globe



Digital Signatures and Certificates

A partially off-topic:

If you download our products with Internet Explorer (which I haven't been using for years, but still), you're probably getting a message that looks like this: (depends on your IE version)

IE Message


This message appears because we did not purchase a digital certificate attached to our installation process. Mostly because it costs quite a few $$$ and we're currently running on a completely free model.

So if you see that, don't be alarmed. All of our products are 100% clean and safe, containing pure (yet awesome :P) .Net code


/Adi


Thursday, August 2, 2012

New versions for ClipTable & DbFileExplorer


We've released new versions for both ClipTable & Database File Explorer this week, here's some of the change logs -

ClipTable:

- Applying limit buffer when importing directly from text files
- Fixed Oracle offline error message
- Added the following fields to summary: Database name & Estimated table size
- Added Cancel option for both Clipboard Import & Table Export
- Updated SQL Engine
- v1.0.2.6 Released


Database File Explorer:
- Added Table Properties (new window with extended table details, check it out by right-clicking any table)
- Better exception handling/reporting (during connection, data fill etc...)
- Minor UI fixes
- Few compatibility issues with SQL Server 2005 were addressed. However, it's time to upgrade people!
v1.0.2.0 released

Download or upgrade today, it's totally free!
http://www.doccolabs.com/products.html

As always, keep on sharing your experience with us; we always love to hear and respond.

Have a great week/weekend :)


Tuesday, July 10, 2012

Our Presentation, SQL User Group, Microsoft

Hi,
Yesterday, I've had the pleasure of presenting my products at the Israeli SQL User Group (hosted on/by Microsoft)

Here's a picture from the event (that's me standing there...) --


Here's another link to the presentation itself (minus the hands-on session)
https://t.co/j7Jt9CgN (may take some time to load...)

I'd like to thank everyone who attended!

Waiting for your feedback, as always (that includes everyone actually :P )

Monday, July 2, 2012

SQL Stripes 2012 has been released













We have an exciting announcement -
SQL Stripes 2012 has been officially released!

Just to make sure we're on the same page - SQL Stripes is our enterprise solution for SQL Server monitoring. It's easy to use, yet quite powerful & featured solution.

So, it did take a while, but it's finally here.
Some of the changes include:
  •           Full compatibility/native mode with SQL Server 2012
  •           UI enhancements
  •           Main core engine updated
  •           Multiple cross-server compatibility fixes
  •           SQL Process (CPU) window fix
  •           Fixed various installation issues
  •           Single-click permission fix for hard disk monitoring
  •           Help access fixed
  •           And more…


* SQL Stripes 2012 beta users - it is recommended to uninstall the beta version before installing the new one

Join many SQL Server DBA's around the world and get the new version today - http://www.doccolabs.com/products_SqlStripes.html


SQL Stripes 2012


Tuesday, June 19, 2012

ClipTable v1.0.2.2 is fresh out the oven!

I don't always blog about new versions, however, this version contains some exciting changes and therefore worth mentioning.


Here's what's new:

- Major parts of main parsing engine rewritten - providing better speed, datatype detection and stability- Added UniqueIdentifier datatype support (relevant for SQL Server only)
- New options to remove rows/columns directly from the DataGrid (after import)
- New option to re-calculate data types after removing data from the grid
- Grid improvements
- Added On-the-fly column name renaming

Go get it!
http://www.doccolabs.com/products_cliptable.html


BTW, if you wonder how to follow new versions, here's a simplified list of sources/channels:


First, if you have any of our products installed, you'll either get a popup message about the new version, or will see it in the "About" screen (plus, a quick way to upgrade)
Second channel is our twitter page (https://twitter.com/#!/sqlstripes), which always contains such announcements
Third channel is our Google+ page (https://plus.google.com/107743657912692145524/posts?hl=en), make sure to add us to your circle in order to view all announcements
Last but not least is this blog (which is also accessible through our website @ www.doccolabs.com)


That's it, now you can be sure you're up to date!


Cheers,
Adi

Tuesday, May 29, 2012

ClipTable video now available

As promised, the 1st ClipTable intro video is now available!
So, if you're not familiar with ClipTable yet, take a few minutes to watch it.


Enjoy!

Thursday, May 17, 2012

ClipTable now supports Oracle databases!

Some great news coming to the Oracle community -
ClipTable v1.0.1.9 has been released, and the major change on this version is Oracle support!

What this basically means, is that now Oracle DBA's can too enjoy the benefits of the super-quick *Anything* to SQL Table import!

At this point, ClipTable supports most of the major relational databases available today:
SQL Server, MySQL, PostgreSQL & Oracle.


And so, we're proudly adding Oracle to the supported logo list :)


P.S.
Since this support is still in beta stage, we'd love to get some feedback. So while enjoying it, please tell us if anything doesn't work as expected.

Monday, May 14, 2012

ClipTable v1.0.1.8 released

I'm happy to announce a new release of ClipTable (v1.0.1.8)


This release has some new exciting features, including:

- Direct file import: while we focus on using the clipboard to turn any data into a table, we've added an option to use the same smart engine to import a file (as long as it's a readable text file) into a table. In order to use this, simply click the "more options" icon next to the import button (see image)





- Server info: when using the shared-repository, you can now get a quick essential information on each server by right-click and choosing the "Server Info" option (again, image...)

Here's the entire change-log for the v1.0.1.8:

- Added an option to import directly from a file (as long as it's a csv/text readable)
- New toggle option - treat empty strings as NULL or leave them as-is (in the database)
- New toggle option - remove invalid chars from column headers
- Repository instant groups works about x10 faster
- Repository version has been updated
- Fixed a bug in repository where not all instant groups were displayed in some cases
- Quick server info added to repository
- SQL Engine updated (faster async processing)
- Some UI changes

Go grab it now!



Tuesday, May 8, 2012

New versions + updated shared repository

Hey there,
There are new versions available for both ClipTable and Log Table Viewer

One of the many changes (for both) is a new version of our Shared Repository, which now introduces an 'instant grouping'.
What is it, you ask?
Well, it's a quick option to group your server list by either online status and SQL version

"No no... I mean, what's this shared repository??"

Oh, in that case - Shared repository is a component shared by all of our applications, which allows you to manage one central list for all of your (SQL) servers in your network.
The shared repository can be accessed from everywhere. So, if you install our products on various machines, you can still manage that one single list.

Here's a recent screenshot of the shared repository taken from the latest version (with the instant grouping)


Wednesday, April 18, 2012

Database File Explorer v1.0.1.7 has been released!

Database File Explorer v1.0.1.7 has just been released!

Here's the recent version changelog:
- Added SQL File statistics (static + real-time)
- Added Full file data grid (Advanced)
- Core engine bug fixed on some table details
- Timeout counter added on every connection (for better indication)
- Management Studio (SSMS) launch - preferring newer version (if, for example, two versions of SQL Server are installed)
- Repository: fixed a bug where default databases was ignored on load
- Fixed connection timeout configuration
- Minor Repository UI fixes

If you already have it installed, click the "About" to get the update,
If not - get it from here: http://www.doccolabs.com/products.html#DatabaseFileExplorer


Monday, April 9, 2012

New Releases!

Releases day is upon us!
ClipTable v1.0.1.5, Now also supports XML input.
In other words - you can copy almost any XML data into your clipboard and let ClipTable do the magic of turning this data into a table. (Need to check the option in "Advanced Options" tab.

In addition, we've released minor updates to Database File Explorer & Log Table Viewer - mostly around engine updates and native SQL2012 support.

Give it a shot
Feedback and Comments are welcome.

Tuesday, April 3, 2012

Domain changes

Hi,
As you may have noticed, sqlstripes.com now redirects to doccolabs.com (to a SQL Stripes product page)
This is done as part of a consolidation process we're doing which ends up by having all content under a single homepage (doccolabs.com, that is...)

So, from now on, download & purchase SQL Stripes here  - http://www.doccolabs.com/sqlStripes.html


Friday, March 16, 2012

SQL Stripes 2012 Edition is coming...

We're about to release SQL Stripes 2012, which, among other fixes & changes, introduces full support for SQL Server 2012, which recently came out.

Version is expected to be released in the upcoming month

Cheers :)

SQL Stripes 2012 Screenshot

Wednesday, March 14, 2012

Get to know - Database Log-Table Viewer (DLTV)

Let me begin by quickly describing the problem we're trying to solve -
When you develop in a SQL Server environment and reaching a point where your environment contains multiple Stored-Procedures, functions, Jobs and other T-SQL related scripts, you often need a simple logging solutions for tracking processes, progress or any other activity in your system.

I'm not taking about profiler-level tracking of just seeing *anything*, but a more pin-point messages such as:
"YYYY/MM/DD HH:MM:SS - Proc1: Started"
"YYYY/MM/DD HH:MM:SS - Proc1: Gathering new users data"
"YYYY/MM/DD HH:MM:SS - Proc1: Adding users to queue table"
"YYYY/MM/DD HH:MM:SS - Proc1: 20%"
"YYYY/MM/DD HH:MM:SS - Proc1: 60%"
"YYYY/MM/DD HH:MM:SS - Proc1: 100%"
"YYYY/MM/DD HH:MM:SS - Proc1: Done"

Now, consider you write such messages (which you simply store in a table created for the purpose), and would like to quickly access them, either by real-time, search, tree-based exploration etc...

Ta-da! That's exactly what we do!

The Log Table viewer project provides a unified logging interface for your SQL code.
A set of log-based procedures for your Server Side And a powerful log viewer/explorer for the client side

Setup is easy -
After installation, you jump right into the configuration screen, on which you define where the log table/procedure are located (tblLog / usp_write_to_log)
If they don't exist yet, you can easily create them using a single click; Save, and that's it - you're ready to go!

As a side-note, you can either specify your server using the regular SQL dialog, or use our "Server Repository", which hold your server collection and available as a shared list by all of our products. (Post about the repository is also coming soon)

So now, both client/server sides are ready. Next thing you do is start writing your log messages.

Test it - connect to the server/database you've configured the client to access, and write this:
EXEC usp_write_to_log @Source='MyScript', @message='Hello World', @severity=1

Execute...

Now go back to the client, click on the "Real-time" tab, and see your message.
Quite simple, wouldn't you say?

Get DLTV here: http://www.doccolabs.com/products.html#LogTableViewer


Here are some sample screenshots of the client in action:
Real-time view
Explorer



Enjoy! (it's free and all...)

Thursday, March 1, 2012

Database File Explorer v1.0.1.5 released


Database File Explorer, our revoluntioary database->file->disk space viewer, has a new version which just came out!

Some of the new features on the new versions are:
- Added quick search box
- Faster switching between view modes (Database-based / Drive-based)
- Added a new button to launch Management Studio (SSMS) with direct server connection
- UI improvements


I'm going to write an entire post on this app soon, in the meantime, feel free to grab it:
http://www.doccolabs.com/products.html#DatabaseFileExplorer


Here's a screenshot from the recent version:




Sunday, February 19, 2012

ClipTable now supports MySQL & PostgreSQL

This is a follow-up to our previous post was - Get to know ClipTable.
We've got a lot of feedback from SQL Server users who started using ClipTable on a daily basis.
In addition, the word has spread beyond the SQL Server community and we actually got some requests to have ClipTable support other database engines.

SO WE DID!
And even created a new/modified logo, here goes:


As from the latest version, ClipTable also supports MySQL and PostgreSQL!

Few things to keep in mind though,

  • This is only the first beta to support these engines, which means errors may occur. Be nice and report to us any misbehavior you find.
  • ClipTable is a Windows app, so apologies to all mysql/postgres who resent windows :)
  • Special connectors & drivers for each engine are not included within the setup. When loading the app you'll get links for each driver (if you already have them installed, nothing special to do)

Again, since this is quite preliminary, please let us know how your experience was like.

Thursday, February 2, 2012

Get to know – ClipTable


ClipTable objective is quite simple – 
revolutionize the way you’re importing data into your SQL Server.



New: ClipTable video is now available - Watch it!



Why:
I’ve been serving as a DBA for quite some time, performing production as well as development tasks.
One of the things I always found quite time-consuming was import data, any data, into a SQL table format for additional processing.
While it always works at the end, this type of task never became easier.

Here’s a typical scenario:
  • One of my customers hands me an Excel file containing his user data (let’s say, 50,000 users).
  • I open the Excel, see that it contains multiple sheets; one of them contains the data I need.
  • I choose the direct import option, using SSIS.
  • Trying to use Excel as input, getting an error and after a while, recalling that there’s an issue of reading Excel files when 64-bit office is not installed (hence missing the Jet/ODBC driver)
  • OK, giving up on the direct Excel->SQL path, going for the CSV->SQL
  • <Taking a deep breath, making another cup of coffee>
  • Saving sheet as CSV
  • Trying SSIS again with flat-file input
  • Battle continues with:
    •   Finding the right row/col delimiters
    •    Finding the best data-types (number, dates, text etc…)
    •    Finding the correct length for each column
    •    Hoping there are no “text qualifiers” (because this means further work and rules out working with bcp)
  • Importing… Finger crossed…
  • Worked? Great
  • Didn't work? Got an annoying unreadable SSIS error? Go back and try again…


Pardon for not drawing the above as a flowchart, but I hope you’re getting the point.
This is just one example. I’ve personally had so many of them I could write an entire article on the subject.
I could - but instead, I’ve spent my time simply writing a solution for this annoying problem.

So, the incentive was there, and my objective was to eliminate the frustration on this process.

How:
First, I wanted to eliminate the need of having input drivers for any format (my example above was Excel, but the table may come from PDF, Word, any webpage etc…)
So the natural solution was to use the clipboard. Instead of re-inventing the wheel, we let Windows do the work of translating anything to a readable text format.

Next, we need to “understand” the data;
This is where ClipTable’s smart engine is being used – analyzing the reverse-engineering the live data to understand the correct fields, types, delimiters etc…

And last – I wanted to quickly access any of the SQL Servers within my organizations (i.e. the “Destination”) and for that, I’ve implemented the Shared Repository component (which will be discussed on a different blog post)

The Result:
Taking the same example from the 1st paragraph, this could have taken way over an hour.
By using ClipTable, I simply:
  • Copy the users data from the relevant sheet
  • Letting ClipTable do the field/type analysis and turn it into a SQL formatted table
  • Choose my destination
  • Done!


That’s it – no more than 2 minutes and all done.

If you want to see more, go to our website (doccolabs.com) and get it – it’s totally free.
Hope we managed to help you save at least an hour on your next import task.

Let us know J