I wanted to concatinate multiple address fields as a single field separated by comma. Here is the solution which is doing job for me. 8000 is the Max length of varchar data type in sql server. Using COALESCE() function saves lot of IF or CASE decision logics. This function Returns the first nonnull expression among [...]
I was using following query select top 10 * from [sqlserver02\sqlserver02].mydatabase.dbo.aspnet_membership (nolock) whereas “sqlserver02″ was a remote serever and I found following errro Msg 4122, Level 16, State 1, Line 1 Remote table-valued function calls are not allowed. Then I remove (nolock) from the query and it worked. Does any one know why remote serever [...]
Today I used Managed Assembly to use Regular Expression in SQL server 2005. I wanted to search for all records which contain special characters in my data and some foreign characters so I was using following SQL Query Select OrganisationId,organisationname from organisation Where organisationname like ‘%-%’ OR OrganisationName like ‘%&%’ OR OrganisationName like ‘%(%’ OR [...]
We were facing a problem in searcing the exact data from Microsoft sql server 2005 database, Our database is containng foreign language characters ,çéèêëñòóôõöà áâãäåìÃîïùúûüŵŷýÿ as you can see in following data, I was wondering how we can solve this problem, I tried to search it on the google and posted this in some forums. The Coleg Sir Gâr  [...]
Linked Servers + Distributed Queries Linking to External Data Sources Following stored procedure will allow you to create a link to another SQL Server. Link server name would be “SECOND†EXEC sp_addlinkedserver @server=‘myservername’,–name you will be using to refer link server @srvproduct = ‘Excel’, –Product name i.e excel @provider = ‘Microsoft.Jet.OLEDB.4.0′, –Jet engine @datasrc = [...]
Note : T=Table, C=Column, C2 for T1 and T2 got same values.  I want to update T1.C1 values from T2.C1. What would be the SQL Query. update T1 set T1.C1=T2.C1 from T2inner join T1 on T2.C2=T1.C2 Above sql query will update all values from table 2 column 1 to table 1 column1 where table1 and table2 [...]