Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

All Blogs

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

Search

XML Feeds

Google Ads

Tags: tip

comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

This post is based on a question I answered earlier today, someone wanted to check all columns that allow NULL for NULL values in all tables. The reason people might want to do this check is that they want to make all the columns not nullable in a database (after all we all know that developers hate NULLs).

The Stored Procedure below is based on the code that George Mastros wrote for the following blog post:

Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

Someone gives you a backup of a database, you restore it and the first thing you notice is that the column names have percent signs and underscores in them.

It would be easy to fix this if it was one table but in this case there are hundreds of tables.

The solution is to loop over information_schema.columns, find all the columns that have those characters and then rename those columns by using the sp_rename procedure. I will show you two ways to do this, one way that executes the code and one way that generates a script that you then can execute.





E...

Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

This question came up again yesterday in our SQL Server forum so I decided to create a short blog post about it.

The version of SQL Server Management Studio that ships with SQL Server2008 comes with IntelliSense enabled, I still think IntelliSense is sometimes more in my way than it is useful but I won't bore you with that.

What will eventually happen is that if you create new tables and stored procedures IntelliSense will not know about those, when this happens you have to refresh the local IntelliSen...

Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

This is just a quick post in case you run into this problem. This is an interesting error and it had a coworker worry about table corruption. This coworker connected to a database on a fairly new server, he then executed a query like the following

tsql Sample Code (See Article for Rest)
Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

I have a bunch of processes that run at then end of the day. Some of these processes are configured dynamic since table names, server names, database names and a whole bunch of other stuff might change.

SO you migh have a (over simplified here) table like this

Typeid	        TypeName		TypeValue
1		ActiveServerName	SQLDenisDB1
1		DatabaseName		MyDB
1		LogTableName		LogFileTable

And there might be a dozen more configurations for a process

In general people will do 3 selects if there are 3 values, let's take a look at what I mean. First create this table

Read More...

:: Next >>