Posts

Limit your responses , please.

When you are faced with request from users who will ask things like... i want to know the top 2 machines of every model type that have active leads, you may find yourself baffled and stunned to find that the Select TOP n does very little to help you out. The following article address the issue completely whether you're a sql developer or NOT. For myself it was a new look at existing solutions that we had employed all which were cumbersome and tedious to maintain, the solutions in the article describe the best approach which is easily extensible and flexible. Limit Groups by Number Using Transact-SQL or MS Access

MSDE enable TCP/IP or Named Pipes

When you inherit a new server sometimes you find that you can't connect to the server, to fix that you may need to simply enable the protocol via Sql Server Network Utility (svrnetcn) that is listening For MSDE. In Windows, click Start and Run . Enter svrnetcn and click OK . Under the General tab , verify that the correct instance for the server is displayed in the Instance(s) on this server box. Highlight your desired protocol and click Enable (double clicking the name also moves the protocol to the enabled protocols box). Click OK . Restart the Sql Server Instance In Windows, click Start and Run . enter services.msc Locate the MSSQLSERVER instance you modified in the Sql Server Network Utility and Restart the service. You may wish to ensure that your users are not logged on or at least notified of this change as it will kick them out of the application

SSIS SOS!

If you have been regretting making the move from Sql Server 2000 to Sql Server 2005, you will be in complete shock and awe when you find that you no longer have DTS to move your data around. The good news is that in Sql Server 2005 you get Sql Server Integration Services (SSIS) a full feature ETL product for Sql Server 2005. If you want to move things moving quickly take a look at the Sql Server 2005 Import / Export Wizard short article which outlines just how easy shuffling your data around can really be.

Comma delimited Lists

Take the post about finding columns and incorporate it with this post from a college of mine. http://www.artfulsoftware.com/infotree/tip.php?id=753 Now you're off and running turning lists to comma lists, in corporate that with the list table function I posted sometime back, and you can go backwards and forwards!

Find me a column...

Forgive the fact that the following SQL is not formatted , but this topic came up today on a list that I frequent, which was how to get all the fieldnames of a view (or table etc). this dandy little select statement will gather just that and all you need to really parse it for is your table name or column name... maybe you want to know how many times you named something "EntryTime" this is an easy way to find all that information at a glance. This is a Sql Server 2005 version (If you need it I can post a Sql Server 2000 version as well.) SELECT t.name AS TableName, sc.name AS SchemaName, c.name AS ColumnName, c.column_id AS ColumnID, c.precision AS [Precision], types.name AS TypeName, basetypes.name AS BaseTypeName, st.name AS TypeSchemaName, CASE WHEN c.max_length>=0 AND basetypes.name IN (N'nchar', N'nvarchar') THEN c.max_length/2 ELSE c.max_length END AS Length, c.scale AS Scale, CONVERT(bit, c.is_identity) AS [Identity], CONVERT(bit, c.is_computed) AS...

Turbo Charge Your SSMS

The other day a co-worker mentioned one of his biggest pet peeves about Sql's new IDE. Of course he likes the old IDE, but what he detested the most was the slow bloat time it took to get his SSMS loaded on the screen. When we timed the boot time for his Enterprise Manager to load it took nearly 7 seconds. Not bad, but then proceeded to tell me how much longer SSMS (Sql Server Management Studio) took to load. I guessed that it could possibly be about 10 seconds (only 3 more seconds) but I was shocked to see it load in nearly 25 seconds. it was nearly 3x less productive just loading the thing before you could connect to do anything. I couldn't believe that it was nearly that slow on his computer, I had never timed it on my pc. So when I returned I had to try it. Again the load time was nearly 20 seconds on my machine (about 18 seconds to be exact). I was not entirely pleased with my results but thankfully Google provided the answer, one quick search for "Turbo char...

One sandwich short of a picnic

I had an issue at work the other day, something that seems kind of odd to me. You see in Sql Server 2000 you could setup a view with an order by. Of course this required a TOP 100 PERCENT to be specified at the top of the query. You could then take that view and base new views off of it and all results would be ordered by the original view. In Sql Server 2005 (SP1 or even SP2) everything changed, now you could no longer get the correct order by if you coupled it w/ the TOP 100 PERCENT in your view, but then again, if you do not use a the TOP keyword you can't save your view. The solution to how to get around the issue is in the following blog article. http://executioniseverything.blogspot.com/2007/01/order-by-in-views-sql-server-2005.html A proposed solution has been placed on the MSDN site so you can vote on it. It seems the proposal is to do away with the ability to create ordered by views which technically go against the rules of rational theory.... https://connect.microso...