» Cast collation of nvarchar variables in t-sql
Cast collation of nvarchar variables in t-sql
|October 27, 2009
Posted by forumadmin
I need to change the collation of an nvarchar variable. By documentation:
3. The COLLATE clause can be specified
at several levels. These include the
Casting the collation of an
expression. You can use the COLLATE
clause to apply a character expression
to a certain collation. Character
literals and variables are assigned
the default collation of the current
database. Column references are
assigned the definition collation of
the column. For the collation of an
expression, see Collation Precedence
However I can’t figure out the correct syntax for the usage of CAST(), CONVERT() or variable declaration with DECLARE for this purpose.
More Related Questions
- How Can I get Pivot Type Data using T-Sql I got requirement that needs to display top 3 salary Employee. It got query which displaying top 3 employee names like this:
select top 3 [Employee First Name]+' '+[Employee Surname] as […]
- Group By Multiple Columns, SUM at the first Group By Column I am writing a query that groups over two columns. this means, it will put Col1 and Col2 in the same group.
How can I do a SUM of records based on Group Col1 ?
I have this so far: […]
- Getting row count with other columns I need to get some columns which are LinkID, ReplyCount and the most important one is TotalRowCount.
This is my code:
TOP(10) link.LinkID, mesaj.ReplyCount
- How to delete completely duplicate rows Say i have duplicate rows in my table and well my database design is of 3rd class :-
Insert Into tblProduct (ProductId,ProductName,Description,Category) Values (1,'Cinthol','cosmetic […]
- How to change column name based on given month in sql server 2008R2 i want to show my pivot table column name as Monday 1,Tuesday 2 based on the month from the given date...i.e if it is July the month then Monday 1 Tuesday 2 so on for all days of the […]
- SQL: Creating aging buckets based on last payment date for financial reporting I need to create an aging report of credit balances on the customer-level.
Aging is based on customer's last payment date.
A customer can have multiple accounts, and there are […]
- How to group time by hour or by 10 minutes like when I do
GROUP BY [Date]
how can I specify the group period ?
MS SQL 2008
SELECT MIN([Date]) AS […]
- Workaround to RAISERROR WITH NOWAIT buffering I'm using RAISERROR to produce progress output from stored procedures rather than using PRINT, to avoid PRINT's buffering of the output. Now I've discovered that RAISERROR will start […]
- Is having an OR in an INNER JOIN condition a bad idea? In trying to improve the speed of an immensely slow query (several minutes on two tables with only ~50,000 rows each, on SQL Server 2008 if it matters), I narrowed down the problem to an […]
- SQL SELECT top row and aggregate counts I can't wrap my head around this. I have a client-staff communication system. On the admin side, I'm trying to retrieve a list of users, which contains total number of messages, total new […]