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.
Your profile
Tag cloud
.net .net 4.0 asp.net asp.net mvc azure backup book bug business intelligence c# cloud computing community database dmv excel google gotcha help high availability how to howto interview linq mirroring mvc nhibernate nunit performance programming reportviewer rhino mocks security silverlight sql sql friday sql server sql server 2000 sql server 2005 sql server 2008 sql server 2008 r2 ssis structuremap t-sql tip trick vb.net visual studio 2010 vmware windows 7 wpf
Authors
- SQLDenis (297)

- chrissie1 (234)

- Ted Krueger (onpnt) (130)

- George Mastros (35)

- Alex Ullrich (29)

- tarwn (28)

- naomi (11)

- thatrickguy (11)

- chaospandion (8)

- ca8msm (8)

- damber (7)

- emtucifor (7)

- More...
Main Categories
Search
Google Ads
Tags: tip
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:
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...
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...
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
Three different ways of populating variables with configuration values in SQL Server
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
:: Next >>


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