Import tab delimited data files directly into SQL Server via SSMS

Recently, I wanted to bring data into a SQL Server table, and I wanted to do so w/o SSIS. I know that I had done this before, but, of course, I had forgotten the details. I found the best answer here:

The solution requires putting a “Schema.ini” file in the same directory as the file you are attempting to upload, and the file HAS TO BE NAMED “schema.ini” (case insensitive). The contents of the simple text file should be as follows:

Continue reading “Import tab delimited data files directly into SQL Server via SSMS”

Programmatically act on SQL Version

I often have scripts that run across multiple versions of SQL … more and more 2008’s and less and less 2000’s.  In doing so, i need to take different actions based on that version.  Here’s the simple technique that i have developed … it currently depends on Microsoft continueing to use periods in their version naming scheme… i don’t think that that will change soon!

select ltrim(substring(@@version,CHARINDEX(‘.’,@@version)-2,2))


Why can’t I see more job history?

I’ve been a DBA for a long time… and it still takes me a minute of thinking before I remember how to see more job history.  Furthermore, it takes a second try before I remember that the “Maximum job history rows per job” is the number of steps * the number of job runs. So, if each job run has 100 steps, and your setting (as below) is “200” for the “Max rows per job”, then you’re only going to see 2 job runs in history. Continue reading “Why can’t I see more job history?”