I’m experiencing weird behaviour using sqlcmd (powershell cmdlet). If I use a
select * in the query I get proper result, if I specify a column (n)varchar(max) I get three dots (…)
Invoke-Sqlcmd -ServerInstance $ SQLServer -Database $ DBName -Username $ UserDB -Password $ WW -Query "SELECT * FROM [admin].[datafactory_Generated_ET]"
Result:
TABLE_NAME : datafactory_sourcetables GENERATED_ET : IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[BICC].[admin_datafactory_sourcetables_ET]') AND type in (N'U')) DROP EXTERNAL TABLE [BICC].[admin_datafactory_sourcetables_ET];
The output actually continues pasting the generated sql script but you get the idea. But If I specify the column with select [column] from ..:
Invoke-Sqlcmd -ServerInstance $ SQLServer -Database $ DBName -Username $ UserDB -Password $ WW -Query "SELECT [GENERATED_TABLE] FROM [admin].[datafactory_Generated_ET]"
All I get is dots (3 per row):
GENERATED_ET ... ... ...
Am I doing something wrong? Hope you can help. Thanks!