Tuesday, December 20, 2005

Does anyone get sample of code doing transformation and manipulating character strings (string tokenizer) ? You can find an example [Handling Different Row Types In The Same File] on http://www.sqlis.com/default.aspx?54

Interpreting Execution Plans of Partitioned Objects

The Web refresh of SQL Server 2005 Books Online contains a new topic, "Interpreting Execution Plans of Partitioned Objects" which should answer your question. You can download the latest version of Books Online at the following URL:
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
I have two server running SQL 2005 – both are configured to support remote connection via named pipe and TCP/IP. However they can’t connect to one another with either osql.exe or the mgmt studio. Any idea?

Check out
http://blogs.msdn.com/sql_protocols/

Message 10: [SQL Native Client]Unable to complete login process due to delay in opening server connection.
Reasons could be:
- There are spaces after Instance name in the connection string eg. osql /S”\Instance “ /E, to resolve this, you need to remove the trailing space.
- Connect through 127.0.01.
- Remote connection and WINS was disabled on the client machine and you connect using FQDN as server name. To resolve this, one way, turn on “File and Printer sharing” and explicitly use name pipe protocol. Another is enlarge the connect timeout to around 30 seconds.

Monday, December 19, 2005

Script with IF NOT EXISTS - SQL 2005

Is there a way to generate script (with IF NOT EXISTS) of stored procedures in a SQL Server 2005 database?
In the Object Explorer (Management Studio/WorkBench)
Right Click on the DatabaseName
Select Tasks
Generate Scripts
Select the Database Name from the list (again!) and click Next. This will show you list of options.
Make sure “Include IF NOT Exists” option is set to true
Check “Stored Procedures” from the list

Deprecated Features in SQL Server 2005

Does the SQL Server 2005 client files use the ntwdblib.dll driver when connecting to a SQL Server 2005 server and database?
None of the SQL Server 2005 client tools have any dependency on ntwdblib.dll and it is no longer shipped with SQL Server 2005. Ntwdblib.dll is the DLL for the old DB-Library API. DB-Library is deprecated with SQL Server 2005.
More Details:
http://msdn2.microsoft.com/en-us/library/ms143729(en-US,SQL.90).aspx
Download SQL Server 2005 code samples to get a jump start in your database application development.
http://msdn.microsoft.com/sql/downloads/samples/default.aspx
When I run DBCC CHECKDB on master database, there will be messages on Service Broker as below:
Service Broker Msg 9675, State 1: Message Types analyzed: 14.
Service Broker Msg 9676, State 1: Service Contracts analyzed: 6.
Service Broker Msg 9667, State 1: Services analyzed: 3.
Service Broker Msg 9668, State 1: Service Queues analyzed: 3.

...
Just wonder if this msg can be skipped in DBCC CHECKDB results?

Use WITH NO_INFOMSGS to skip all the informational messages and only print the errors.
How can I turn on Database Mail without having to go through Surface Area Configuration in SQL 2005?
sp_configure 'Database Mail XPs', 1
-- followed by,
RECONFIGURE WITH OVERRIDE

Thursday, December 15, 2005

Easy way to check does this version of Excel support XML?
With Application
If .Version >= 11 And .ArbitraryXMLSupportAvailable Then
' Yes it does...
End If
End With

Tuesday, December 13, 2005

SQL 2005/2000 Cluster

Can we install an instance of SQL 2005 onto a cluster that already has an instance of SQL 2000 running on it?
you should be able to install a Yukon clustered instance on a cluster that already has SQL2K. A SQL Server 2005 failover cluster can reside on the same cluster as a SQL Server 2000 cluster. The only caveat is that if you remove the SQL Server 2005 failover cluster instance then you have to make sure the SQL Server SNAC (SQL Native Access Components) remains .. SNAC is what the SQL Server 2005 resource DLL uses to connect to SQL Server; the same resource DLL is used for both SQL Server 2005 clusters and SQL Server 2000 clusters (once SQL Server 2005 has been installed) and it’s left behind on uninstall for the remaining SQL Server 2000 failover cluster .. so SNAC has to be there for your SQL Server 2000 failover cluster to continue working.

Thursday, December 01, 2005

What is IMEX=1? [Excel to SQL - SSIS]

While importing data from Excel to SQL Server using SSIS data is not coming through when we have mixed data type in Excel column. How to resolve this issue?
To resolve this issue, we can set an option IMEX=1 to the ConnectionString for Excel. This will force the column to be treated all as text.
Connection String Look Like:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ExcelSheet.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""""HDR=Yes;""IMEX=1;"

http://msdn2.microsoft.com/en-us/library/ms254500.aspx