 |
 |
 |
 |
 |
 |
 |
 |
|
|
|
Untitled-1
 |
 |
|
 |
 |
|
|
|
| Saturday, June 09, 2007 |
|
Jamie Thomson - Katmai: New T-SQL enhancements
By drsql@hotmail.com @ 6:58 PM :: 528 Views ::
0 Comments :: SQL Server 2005
|
|
Katmai: New T-SQL enhancements
SQL Server | Microsoft | T-SQL | katmai
A very short post here showing some of the new T-SQL constructs in katmai.
Check out the following code snippet:
declare @i int = 1;
set @i += 1;
create table t1 (col1 int);
insert t1 values (@i),(@i+1);
There are actually three syntax enhancements in there. Can you spot them? No? Let me fill you in:
-
Initialisation at the same time as declaration
-
+= operator (which works in the SET clause of an UPDATE statement as well)
-
Multiple row predicates in the VALUES clause
Of course, none of these enhancements enable you to do something you can't do already - but they do mean less typing. Upon seeing this for the first time SQL MVP Kent Tegels was overheard muttering "Its T-SQL#"
-Jamie
|
| Read
More.. |
|
|
|
|
| Wednesday, February 21, 2007 |
|
Tara Duggan - Database Mail on a cluster
By drsql@hotmail.com @ 11:48 PM :: 968 Views ::
0 Comments :: SQL Server 2005
|
|
In our production environment, we have two 4-node clusters. One cluster runs at the primary site; the other cluster runs at our disaster recovery site. Each cluster is running 11 SQL Server 2005 instances.
We setup Database Mail on all of the instances at both sites, so that we could e-mail internal customers the results of various ad-hoc queries. It was soon realized that Database Mail was not working properly at the primary site on any of the 11 instances. We got our Exchange, server, and network administrators involved, but we were unable to figure out what was wrong. We never received any errors but yet no e-mail was ever received. Since we were unable to resolve the issue, we decided to open a case with Microsoft. One of the things that they had me to do was increase the logging level of Database Mail so that it was more verbose. After the configuration change was made, I attempted to send an e-mail with Database Mail. As usual, no error was returned but also the e-mail never made it out of SQL Server. Microsoft wanted me to send them the Application Log in Event Viewer. While preparing to do this, I noticed the following error in it:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
Since remote connections was enabled on all of the instances, I decided to add an alias for one of the instances on all 4 nodes of the cluster. This worked, so I reported my findings back to Microsoft. After a bit of time, they reported back to me that the SQL Browser service was the culprit.
They don't have an exact reason as to why the SQL Browser service is unable to connect to a local instance (meaning an instance that is on the node where the service is running), but they did provide possible reasons:
Clustering
SQL Server Browser is not a clustered resource and does not support failover from one cluster node to the other. Therefore, in the case of a cluster, SQL Server Browser should be installed and turned on for each node of the cluster. On clusters, SQL Server Browser listens on IP_ANY.
Note: When listening on IP_ANY, when you enable listening on specific IPs, the user must configure the same TCP port on each IP, because SQL Server Browser returns the first IP/port pair that it encounters.
Using a Firewall
To communicate with the SQL Server Browser service on a server behind a firewall, open UDP port 1434, in addition to the TCP port used by SQL Server (e.g. 1433). For information about working with a firewall, see "How to: Configure a Firewall for SQL Server Access" in SQL Server Books Online.
If you are unable to get Database Mail to send e-mails when the SQL Server 2005 instance is on a cluster, try adding an alias for the virtual server. You can easily add aliases using the SQL Server Configuration Manager tool.
|
| Read
More.. |
|
|
|
|
| Saturday, February 10, 2007 |
|
Jamie Thomson - T-SQL: Generate a list of dates
By drsql@hotmail.com @ 12:56 AM :: 1215 Views ::
0 Comments :: SQL Server 2005
|
|
T-SQL: Generate a list of dates SQL Server 2005 | SQL Server | SQL | Common Table Expression | T-SQL | List of dates Sometimes we can be working and we write or find a ridiculously simple bit of code that we know will be useful in the future, then we just go ahead and plain forget all about it. When I find such stuff I like to stick it on my blog so that I know where to find it in the future and also on the off chance that someone else might find it useful. Here is one such example.
The following bit of code uses a common table expression (CTE) to generate a contiguous list of dates in SQL Server.
1 with mycte as 2 ( 3 select cast('1900-01-01' as datetime) DateValue 4 union all 5 select DateValue + 1 6 from mycte 7 where DateValue + 1 < '2050-12-31' 8 ) 9 select DateValue 10 from mycte 11 OPTION (MAXRECURSION 0)
Read on
|
|
|
|
|
| Thursday, February 08, 2007 |
|
Greg Low - Improving ASP.NET Session State database performance by reducing blocking
By drsql@hotmail.com @ 12:50 AM :: 895 Views ::
0 Comments :: SQL Server 2005
|
|
Improving ASP.NET Session State database performance by reducing blocking On a recent consulting engagement, I was working with a client that had significant performance issues with their ASP.NET session state database. They had a combination of both large session state and a large number of concurrent sessions. They were regularly experiencing command timeouts on that database.
In my investigation, curiously I found that a DELETE statement was the culprit. I tracked it to the DeleteExpiredSessions stored procedure. Looking at it, it seems tame enough:
CREATE PROCEDURE DeleteExpiredSessions AS DECLARE @now DATETIME SET @now = GETUTCDATE()
DELETE ASPState..ASPStateTempSessions WHERE Expires < @now
RETURN 0
GO
Read On
|
|
|
|
|
| Wednesday, March 01, 2006 |
|
|
|
| Sunday, September 25, 2005 |
|
|
|
| Monday, September 19, 2005 |
|
Bill Graziano - Integrating .NET and SQL (LINQ)
By drsql@hotmail.com @ 4:17 PM :: 848 Views ::
0 Comments :: PASS Member, PASS Summit Attendee 2005, Volunteer, SQL Server 2005, Summit Speaker 2005
|
From the Visual Studio Data Team blog ... At the PDC Microsoft announced LINQ (Language Independant Query) Framework. This gives you the ability to use a SQL-like language on your collections (anything IEnumerable). The example from the blog is:
Dim SmallCountries = Select Country _ From Country In Countries _ Where Country.Population < 1000000
This is certainly an interesting option for collections. This will make it much easier to cache data on the client side and use it in a flexible manner. I've been hearing for years that we're just about to see the end of relational databases and OO databases are the wave of the future. Instead we're looking at a relationalal “language” coming to an OO environment. Ha!
Read More
|
|
|
|
|
| Monday, September 19, 2005 |
|
|
|
| Monday, September 19, 2005 |
|
|
|
|
|
 |
 |
 |
 |
|
|
|
|
 |