![]() While <= N'select = ' + + ', from #PrintSQLResultsTempTable where ID12345XYZ = ' + as varchar(3))Įxample: exec. This worked for me on SQL Server 2014 ALTER procedure int = int = 20 print sp_executesql char(2), nvarchar(max) output', = output While <= N'select = ' + + ' + from #PrintSQLResultsTempTable where ID12345XYZ = ' + as varchar(3)) + ' ' This worked for me on SQL Server 2012 ALTER procedure int = int = 20 While <= N'select = ' + + ' + from #PrintSQLResultsTempTable where ID12345XYZ = ' + as varchar(3)) + ' print sp_executesql char(2), nvarchar(max) output', = output (select space(1) + LEFT(name + as įOR XML PATH(''), root('str'), type int = (select count(*) from int = int = case when < then else end It is enough to print the selected range. We are not touching any of the parameters. Code: Sub PrintExample1 () Range ('A1:D14').PrintOut End Sub. Code: Sub PrintExample1 () Range ('A1:D14') End Sub. (select ' + space(1) + (LEFT( (CAST( as nvarchar(max)) + space('+ as nvarchar(4)) +')), as nvarchar(4))+')) ' as įOR XML PATH(''), root('str'), type ).value('/str','nvarchar(max)')) Enter the range in the VBA code to access the PrintOut method. Object_id('tempdb.#PrintSQLResultsTempTable') print ROW_NUMBER() OVER (ORDER BY (select Null)) AS ID12345XYZ, * into #PrintSQLResultsTempTableįrom where object_id = ![]() Set = 'from', ' into #PrintSQLResultsTempTable from') If exists (select * from where name = '#PrintSQLResultsTempTable') drop table #PrintSQLResultsTempTable ![]() ![]() This worked for me on SQL Server 2008 R2 ALTER procedure int = int = 20ĭeclare AS char(2) = char(13) + AS char(9) = char(9) I wrote this SP to do just what you want, however, you need to use dynamic sql. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |