score:4
Accepted answer
/*
set @query = 'select ' + char(13) + 'case when a.location is not null then
upper(left(a.location, 1)) + right(a.location, len(a.location) - 1)
else ''all'' end as location' + char(13) + @strsql + 'group by '
+ char(13) + 'rollup(location)' + char(13)
*/
select 'a' as location, 'b' as othercol, 'c' as col3
Source: stackoverflow.com
Related Query
- c# linq to sql with a stored procedure containing dynamic sql
- Getting a multi-dimensional result out of a stored procedure with LINQ to SQL
- Is using Linq with Stored Procedure perform better than Linq with Generated SQL ?
- MVC4 return a stored procedure output with linq to sql
- Linq stored procedure with dynamic results
- Calling a stored procedure using LINQ to SQL with a Custom Entity Class
- Calling a SQL Server stored procedure with linq service through c#
- Stored Procedure return values with linq data context
- Getting stored procedure output parameter with LINQ and Entity Framework
- Lost decimal precision and scale using LINQ and stored procedure with output parameters
- Dynamic Where Clause over relational tables with LINQ to SQL
- Issue with dynamic LINQ queries containing brackets
- Using LINQ to SQL with Dynamic tables
- How to use a system stored procedure in LINQ to SQL
- Retrieve and print data from dynamic sql query with linq
- Performance of Linq on entity framework vs SQL stored procedure
- Mix Entity Framework Linq with stored procedure
- Prevent nullable parameter in stored procedure with LINQ
- LINQ to SQL Calling stored procedure
- Using LINQ with stored procedure that returns multiple instances of the same entity per row
- Stored Procedure Multiple-Table Output With LINQ and ASP.NET MVC
- How to convert decimal? to decimal while using LINQ with a stored procedure
- LINQ to Stored Procedure. Can I call the SP with a dynamic list of parameters instead of strongly typing them?
- Concurrency with Linq To Sql Stored Procedures
- Unable to cast nvarchar to datetime when calling SQL Server stored procedure from LINQ to SQL
- Dynamic Linq To Sql With ComboBox and Column.Contains
- How to query a stored procedure object with Linq
- Using Attach with Linq To Sql and Stored Procs
- How to retrieve multiple rows from a stored procedure with Linq to SQL?
- LINQ 'System.String' is not a valid return type for a mapped stored procedure method. SQL Function
More Query from same tag
- Is there a way to more easily combine Expressions and lambdas?
- Performing a Parent then Child sort in Linq
- SQL Query on Parent Include Child on EF
- Xml, Linq to Class
- grouping a linq statement, doesnt seem to group
- Converting generic collection sort to utilize Linq
- Using LINQ to Filter Multi Dimensional Criteria
- Select from list where not appear in second list
- Dynamic Linq Build Where Clause many Parameters
- can not convert type func<T,bool> to bool
- How to Translate SQL "WHERE expr IN (query)" into LINQ?
- How to programmatically hide a linq-to-sql column on a datagridview?
- Using Linq to combine two lists and get total quantity
- LINQ: Split Where OR conditions
- Change items bool property in a collection if they match/not match the index containing in other list using LINQ
- map objects of two tables with keys
- How to include a entity specific property in Entity Framework?
- search database table record using two parameters in linq
- how to use T-SQL Max inside of linq query in entity framework 6
- join multiple tables using LINQ
- How to Linq query against combobox using c#
- LINQ Error: Method not recognized
- LINQ merging 2 lists, keeping seqeunce and origin
- Linq-to-NHibernate OrderBy Not Working
- Get index of next non-whitespace character in string
- C# How to parse XML File
- Partition data based on condition ("where") in a single query?
- Parsing xml with inner nodes
- How can replace all case in value of column using linq.js?
- Linq, use "variable" inside a anonymous type