Is there a way when executing a stored procedure in Management Studio to get the return data types of the returned result sets? I am looking for something like functionality when you pass the table name to sp_help
You can look at types, though, if you call a stored procedure through ADO, ADO.NET, ODBC or the like: the resulting record sets have the type information you are looking for. Are you really limited to Management Studio?
It would be best to change the stored procedure to a function. But this only works if your environment allows it.
, , . SP XML, XML_INFO , .
, SP:
EXEC ('if exists (select * from sys.tables where name = ''tmp_TableName'') drop table tmp_TableName') EXEC ('select * into tmp_TableName from MyTable') -- Grab the column types from INFORMATION_SCHEMA here EXEC ('if exists (select * from sys.tables where name = ''tmp_TableName'') drop table tmp_TableName')
, , .
, OPENROWSET proc , sp_help, .
,
select * into tmp_Results from openrowset( 'SQLOLEDB.1' , 'Server=your_server_name;Trusted_Connection=yes;' , 'exec your_stored_proc') exec sp_help 'tmp_Results' drop table tmp_Results
, garrenteed. kludge, . , .
if exists (select * from sys.tables where name = 'tmp_TableName') drop table tmp_TableName go select * into tmp_TableName from MyTable --do some stuff go if exists (select * from sys.tables where name = 'tmp_TableName') drop table tmp_TableName go
Source: https://habr.com/ru/post/1696575/More articles:Logo-based automatic image rotation - opencv"ypcat" and "ypmatch username passwd" do not agree after the change on the server - linuxEmail Delivery Question - emailIgnore automatically generated Emacs files - diffHow to use ASP.NET login controls when my Login.aspx is not at the root of my application? - asp.netWhat is the best way to handle role-based permissions using forms authentication in my ASP.NET web application? - asp.netCall onresize from ASP.NET content page - javascriptBest Usage Pattern for DataContext - .net-3.5Можете ли вы сделать пример использования Berkeley DB XML - berkeley-dbCreateProcessAsUser vs ShellExecute - winapiAll Articles