Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql select data type of query

SELECT x.* INTO TMP1
FROM ( SELECT TOP 1 /* rest of your query expression here */ ) as x;

SELECT o.name AS obj_name, TYPE_NAME(c.user_type_id) AS type_name, c.*  
FROM sys.objects AS o   
JOIN sys.columns AS c  ON o.object_id = c.object_id  
WHERE o.name = 'TMP1';

DROP TABLE TMP1;
Comment

sql data type of query

DECLARE @query nvarchar(max) = 'select 12.1 / 10.1 AS [Column1]';
EXEC sp_describe_first_result_set @query, null, 0;
Comment

sql server select query datatype

 --Microsoft SQL Server 2019

 DECLARE @query nvarchar(max) = '
    SELECT TOP (1000) [id]
      ,[name]
      ,[lastname]
      ,[age]
      ,[createdate]
	  , cast(createdate as date) as data_date
  FROM [Z_Test].[dbo].[userDemo]
';
EXEC sp_describe_first_result_set @query, null, 0; 
Comment

PREVIOUS NEXT
Code Example
Sql :: get only one row in mysql 
Sql :: sql table 
Sql :: mysql sql.gz 
Sql :: oracle sql developer 
Sql :: how to delete last row in sql 
Sql :: select count distinct multiple columns sql server 
Sql :: changing column names in sql query results 
Sql :: oracle step procedure 
Sql :: find the all the constraints in a specific table 
Sql :: generate series sybase 
Sql :: get number of rows in every table mysql 
Sql :: get from database the most recent data limit by 5 
Sql :: how to check common records in 2 table 
Sql :: trunc sysdate in oracle 
Sql :: Unable to locate package libmysql-java 
Sql :: psql concat string and int 
Sql :: how to show current database in mysql 
Sql :: create atable copy in pgsql 
Sql :: Write the order of execution of all the SQL clauses and statements 
Sql :: index postgres 
Sql :: sql server get date of previous sunday 
Sql :: sql asc 
Sql :: except in sql 
Sql :: how to convert null to float in mysql 
Sql :: how to fetch data from database without last column 
Sql :: function plsql 
Sql :: initcap in mysql 
Sql :: mysql privileges 
Sql :: sql injection 
Sql :: can sqldatareader be null 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =