No announcements
Found 1815946 threads
-
0 Votes
How to use dynamic column name in sql select query?
declare @col as nvarchar(50) = 'RoleName' DECLARE @QUERY NVARCHAR(500) = 'select '+ @col+' from tblRole ' Exec (@query) ...Answered | 3 Replies | 1951 Views | Created by Waqas Zaheer - Sunday, January 11, 2015 6:22 AM | Last reply by Visakh16 - Monday, January 12, 2015 9:52 AM -
0 Votes
How to reuse SQL connection
No, there's currently no way to share a SQL connection across multiple queries.Answered | 5 Replies | 1163 Views | Created by md4fun - Thursday, September 1, 2016 12:47 PM | Last reply by Ehren - MSFT - Monday, September 19, 2016 5:55 PM -
2 Votes
How to use select * but rename selected column names
The first issue or Problem is "We can't Rename Column's names in Sql.Answered | 8 Replies | 4068 Views | Created by Isolda - Friday, September 14, 2012 7:54 PM | Last reply by Isolda - Monday, September 17, 2012 3:13 PM -
0 Votes
SQL Query Column Dynamic Alias Name Issue
Whenever i print the SQL it is displaying the complete query (PRINT @SQL) Whenever i was trying to execute @SQL, i am getting error, Seems it is exceeding ...Answered | 3 Replies | 19004 Views | Created by sreeni2219 - Monday, February 8, 2010 11:58 PM | Last reply by Ed Price - MSFT - Saturday, April 27, 2013 4:36 AM -
0 Votes
Customizing column names in queries
Just to make sure that WQL and SQL are not mixed up again: which "built-in queries have nice column titles"?Answered | 12 Replies | 8181 Views | Created by JamesHA-MCT - Wednesday, August 12, 2009 10:09 AM | Last reply by JamesHA-MCT - Wednesday, November 11, 2009 9:21 AM -
0 Votes
SELECT on column name from query's result set in same query?
I feel compelled to ask how did you end up here?Answered | 4 Replies | 1026 Views | Created by zogher - Saturday, May 9, 2015 6:27 PM | Last reply by Erland Sommarskog - Sunday, May 10, 2015 9:21 AM -
0 Votes
how to select data AND column name?
If I have to do something like this (dynamic tables) I prefer make the work by code, firstly obtaining the columns from table schema (with SQL ...Answered | 13 Replies | 5593 Views | Created by perner123 - Monday, January 28, 2013 9:06 AM | Last reply by Alessandro Piccione - Monday, January 28, 2013 11:21 AM -
2 Votes
columns in select query
Yes, you have write the 14 column names in the select query.Answered | 5 Replies | 5384 Views | Created by Sudeep Puvvadi - Friday, August 5, 2011 6:33 AM | Last reply by Kasturi Rajesh - Tuesday, August 9, 2011 6:30 AM -
0 Votes
how to select range of columns SQL
Then you may use these comma separated columns into your SELECT Script.Answered | 4 Replies | 17813 Views | Created by Wojciech Wojtulewski - Wednesday, November 24, 2010 12:29 PM | Last reply by Kent Waldrop - Wednesday, November 24, 2010 1:24 PM -
0 Votes
How to reuse subquery ?
Hi Hemkoe, You query is no difference from the below one with derived tables.Answered | 3 Replies | 3384 Views | Created by Hemkoe - Wednesday, July 29, 2015 7:47 PM | Last reply by Eric__Zhang - Thursday, July 30, 2015 7:50 AM -
1 Votes
SQL: How to extract table names from a SQL query in a column
[uspGetBillOfMaterials] @StartProductID=500,@CheckDate=''20090203''') INSERT INTO dbo.TSQL_Commands VALUES (6,'dbo.vw_test','select * from ...Answered | 4 Replies | 15944 Views | Created by Suresh Channamraju - Tuesday, August 17, 2010 8:57 PM | Last reply by Adam Haines - Wednesday, August 18, 2010 1:35 PM -
1 Votes
Prefix alias for columns in select query
Yes Kunal is right, by using Kalman's query you can get all the column names with out using '*', even though you need to specify alias names manually for each ...Answered | 6 Replies | 7286 Views | Created by nologin - Wednesday, November 11, 2009 8:30 AM | Last reply by nologin - Wednesday, November 11, 2009 11:42 AM -
2 Votes
Select column to filter dynamically (using the column name from another query)
The basic concept is that a user selects some parameters: environment, table, date column to filter, start date, end date and max number of rows to query.Answered | 1 Replies | 659 Views | Created by Silja M - Monday, August 31, 2020 6:16 AM | Last reply by Ehren - MSFT - Friday, September 4, 2020 6:11 PM -
1 Votes
Sql Invalid column name
Here is how a SELECT works in SQL ... at least in theory.Answered | 6 Replies | 4707 Views | Created by Ser_Mur - Friday, July 18, 2014 2:06 PM | Last reply by --CELKO-- - Friday, July 18, 2014 3:33 PM -
0 Votes
Selecting specific columns in a query
I've posted it today... but don't know how(if) I can post a link to it...Answered | 19 Replies | 2981 Views | Created by MF47 - Tuesday, June 23, 2015 9:30 AM | Last reply by MF47 - Monday, July 6, 2015 1:21 PM -
0 Votes
Is it possible to select columns conditionally in the SELECT clause of a T-SQL query?
> But it seems to me, it would make more logical sense to filter columns in the query of the SQL Server database versus pulling all the rows of data in and then just ...Answered | 11 Replies | 108398 Views | Created by BradleyA - Sunday, October 28, 2012 3:44 PM | Last reply by BradleyA - Wednesday, October 31, 2012 2:50 AM -
1 Votes
how to make a select * (all) except for columns with column name ending with "_memo"
Hi, You can refer to Uri’s query to generate the SELECT statement and execute the statement using dynamic SQL.Answered | 3 Replies | 4684 Views | Created by Hennie_Ergon - Monday, January 24, 2011 7:52 AM | Last reply by StefDBA - Monday, January 24, 2011 12:42 PM -
1 Votes
Different way of using Column Name Alias in Select query
You're right, MS documentation shows that syntaxAnswered | 11 Replies | 1488 Views | Created by harryss - Friday, May 15, 2020 4:12 AM | Last reply by --CELKO-- - Monday, May 18, 2020 12:54 AM -
0 Votes
find sql table name with a particular column in Multiple Join sql queries
Hi, I have a sql query with multiple joins,How can I get the selected columns to corresponding sql table name.Answered | 1 Replies | 1142 Views | Created by Krishnan L - Monday, February 24, 2020 11:10 AM | Last reply by Dave Patrick - Monday, February 24, 2020 1:28 PM -
0 Votes
execute 'Select' on a variable with the column name
use claim declare @reserved varchar(50) declare @Query varchar(200) set @reserved = 'sPolicyNbr' set @Query = ...Answered | 4 Replies | 3355 Views | Created by rodniko - Monday, July 13, 2009 2:46 PM | Last reply by K H Tan - Tuesday, July 14, 2009 6:16 AM - Items 1 to 20 of 1815946 Next ›
No announcements