tags:

views:

840

answers:

3

I am looking for a way to set the width on the returned column result from a SQL query.

I run a query like Select Product from ConfigScheduling where Product is an Nvarchar(Max) column. The result in SQL Server Management Studio with Results to Grid is a 90 char wide visible column, with the full result present, but not visible.

Thank you

A: 

If I remember correctly, SQL Server Management Studio cannot pull the whole nvarchar(max) field into display and won't attempt to either. The only way to fully access the resultset is to use a third party tool or display it in a gridview or something in a webapp.

achinda99
+2  A: 

Couldn't find it by default, but if you double-click on the right part of the Column Header it will stretch like in Excel.

Jeff O
+1  A: 

Tools>Options>Query Results>SQL Server>Results to Grid>Non XML data Tools>Options>Query Results>SQL Server>Results to Text>Maximum number of characters displayed in each column.

If these still don't suit your needs, you'll need to use another tool such as bcp or sqlcmd/osql.

Cadaeic