SET TEXTSIZE number

When you using sqlcmd to export some data by a query, you will found some column data is truncated if it is a ntext/text/varch(max)/nvarchar(max).

the command set textsize 2147483647 can help you out.

from http://msdn.microsoft.com/en-us/library/ms186238.aspx

Specifies the size of varchar(max), nvarchar(max), varbinary(max), text, ntext, and image data returned by a SELECT statement.

 

argument(number)

Is the length of varchar(max), nvarchar(max), varbinary(max), text, ntext, or image data, in bytes. number is an integer and the maximum setting for SET TEXTSIZE is 2 gigabytes (GB), specified in bytes. A setting of 0 resets the size to the default (4 KB).

 

note:

Setting SET TEXTSIZE affects the @@TEXTSIZE function.

The SQL Server Native Client ODBC driver and SQL Server Native Client OLE DB Provider for SQL Server automatically set TEXTSIZE to 2147483647 when connecting.

The setting of set TEXTSIZE is set at execute or run time and not at parse time.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,下面是一个简单的Android Studio计算器应用的实现。 1. 创建一个新的Android Studio项目,选择Empty Activity。 2. 打开activity_main.xml文件,在布局中添加一些按钮和TextView组件,如下所示: ``` <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:id="@+id/display" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="36sp" android:text="0" android:gravity="end" android:padding="16dp" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/button_1" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="1" android:textSize="24sp" /> <Button android:id="@+id/button_2" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="2" android:textSize="24sp" /> <Button android:id="@+id/button_3" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="3" android:textSize="24sp" /> <Button android:id="@+id/button_add" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="+" android:textSize="24sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/button_4" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="4" android:textSize="24sp" /> <Button android:id="@+id/button_5" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="5" android:textSize="24sp" /> <Button android:id="@+id/button_6" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="6" android:textSize="24sp" /> <Button android:id="@+id/button_subtract" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="-" android:textSize="24sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/button_7" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="7" android:textSize="24sp" /> <Button android:id="@+id/button_8" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="8" android:textSize="24sp" /> <Button android:id="@+id/button_9" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="9" android:textSize="24sp" /> <Button android:id="@+id/button_multiply" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="×" android:textSize="24sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/button_clear" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="C" android:textSize="24sp" /> <Button android:id="@+id/button_0" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="0" android:textSize="24sp" /> <Button android:id="@+id/button_equals" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="=" android:textSize="24sp" /> <Button android:id="@+id/button_divide" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="÷" android:textSize="24sp" /> </LinearLayout> </LinearLayout> ``` 3. 打开MainActivity.java文件,添加以下代码: ``` public class MainActivity extends AppCompatActivity { private TextView display; private String currentNumber = ""; private String operator = ""; private String result = ""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); display = findViewById(R.id.display); Button button0 = findViewById(R.id.button_0); Button button1 = findViewById(R.id.button_1); Button button2 = findViewById(R.id.button_2); Button button3 = findViewById(R.id.button_3); Button button4 = findViewById(R.id.button_4); Button button5 = findViewById(R.id.button_5); Button button6 = findViewById(R.id.button_6); Button button7 = findViewById(R.id.button_7); Button button8 = findViewById(R.id.button_8); Button button9 = findViewById(R.id.button_9); button0.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addNumber("0"); } }); button1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addNumber("1"); } }); button2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addNumber("2"); } }); button3.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addNumber("3"); } }); button4.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addNumber("4"); } }); button5.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addNumber("5"); } }); button6.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addNumber("6"); } }); button7.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addNumber("7"); } }); button8.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addNumber("8"); } }); button9.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addNumber("9"); } }); Button buttonAdd = findViewById(R.id.button_add); buttonAdd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setOperator("+"); } }); Button buttonSubtract = findViewById(R.id.button_subtract); buttonSubtract.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setOperator("-"); } }); Button buttonMultiply = findViewById(R.id.button_multiply); buttonMultiply.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setOperator("×"); } }); Button buttonDivide = findViewById(R.id.button_divide); buttonDivide.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setOperator("÷"); } }); Button buttonEquals = findViewById(R.id.button_equals); buttonEquals.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { calculate(); } }); Button buttonClear = findViewById(R.id.button_clear); buttonClear.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { clear(); } }); } private void addNumber(String number) { currentNumber += number; display.setText(currentNumber); } private void setOperator(String newOperator) { if (!currentNumber.equals("")) { operator = newOperator; result = currentNumber; currentNumber = ""; } } private void calculate() { if (!currentNumber.equals("") && !operator.equals("")) { double number1 = Double.parseDouble(result); double number2 = Double.parseDouble(currentNumber); double resultValue = 0; switch (operator) { case "+": resultValue = number1 + number2; break; case "-": resultValue = number1 - number2; break; case "×": resultValue = number1 * number2; break; case "÷": resultValue = number1 / number2; break; } currentNumber = String.valueOf(resultValue); operator = ""; result = ""; display.setText(currentNumber); } } private void clear() { operator = ""; result = ""; currentNumber = ""; display.setText("0"); } } ``` 4. 运行应用程序,在计算器上点击数字和运算符,即可进行简单的计算。 注意:这只是一个简单的计算器应用程序,它并没有实现完整的计算器功能。如果您需要更复杂的计算器功能,请进行必要的更改和添加。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值