SQL 判断字段类型语句
SQL 判断字段类型语句实现代码。
-->Title:Generating test data-->Author:wufeng4552
-->Date :2009-09-25 09:56:07
if object_id('tb')is not null drop table tb
go
create table tb(ID int,name text)
insert tb select 1,'test'
go
--方法1
代码如下:
select sql_variant_property(ID,'BaseType') from tb
--方法2
代码如下:
select object_name(ID)表名,
c.name 字段名,
t.name 数据类型,
c.prec 长度
from syscolumns c
inner join systypes t
on c.xusertype=t.xusertype
where objectproperty(id,'IsUserTable')=1 and id=object_id('tb')

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP email detection: Determine whether the email has been sent successfully. When developing web applications, you often need to send emails to communicate with users. Whether it is registration confirmation, password reset, or sending notifications, the email function is an indispensable part. However, sometimes we cannot ensure whether the email is actually sent successfully, so we need to perform email detection and determine whether the email has been sent successfully. This article will introduce how to use PHP to implement this function. 1. Use SMTP server to send emails. First, we need to use SM

Use Java's File.isDirectory() function to determine whether a file exists and is of directory type. In Java programming, you often encounter situations where you need to determine whether a file exists and is of directory type. Java provides the File class to operate files and directories. The isDirectory() function can help us determine whether a file is a directory type. The File.isDirectory() function is a method in the File class. Its function is to determine the current File

Use Java's Character.isDigit() function to determine whether a character is a numeric character. Characters are represented in the form of ASCII codes internally in the computer. Each character has a corresponding ASCII code. Among them, the ASCII code values corresponding to the numeric characters 0 to 9 are 48 to 57 respectively. To determine whether a character is a number, you can use the isDigit() method provided by the Character class in Java. The isDigit() method is of the Character class

How to use the isInfinite() method of the Double class to determine whether a number is infinity. In Java, the Double class is a wrapper class used to represent floating point numbers. This class provides a series of methods that can conveniently operate on floating point numbers. Among them, the isInfinite() method is used to determine whether a floating point number is infinite. Infinity refers to positive infinity and negative infinity that are so large that they exceed the range that floating point numbers can represent. In computers, the maximum value of a floating point number can be obtained through the Double class

jQuery is a JavaScript library widely used in web development. It provides many simple and convenient methods to operate web page elements and handle events. In actual development, we often encounter situations where we need to determine whether a variable is empty. This article will introduce several common methods of using jQuery to determine whether a variable is empty, and attach specific code examples. Method 1: Use the if statement to determine varstr="";if(str){co

Question: How to determine whether the date is the previous day in Go language? In daily development, we often encounter situations where we need to determine whether the date is the previous day. In the Go language, we can implement this function through time calculation. The following will be combined with specific code examples to demonstrate how to determine whether the date is the previous day in Go language. First, we need to import the time package in the Go language. The code is as follows: import("time") Then, we define a function IsYest

PHP is a scripting language widely used in website development. For developers, it is often necessary to determine whether a field is empty. In PHP, determining whether a field is empty can be achieved through some simple methods. This article will introduce how to determine whether a field is empty in PHP, and provide specific code examples for your reference. In PHP, you can usually use the empty() function or isset() function to determine whether a field is empty. Next, we introduce the usage of these two functions respectively. Use the empty() function

PHP is a widely used server-side scripting language that is flexible, powerful, and easy to learn. In the process of using PHP for string processing, it is a common requirement to determine whether a string contains Chinese characters and numbers. This article will introduce how to implement a simple function of determining whether a string contains Chinese characters and numbers in PHP, with specific code examples. First, let's take a look at how to determine whether a string contains Chinese characters. The range of Chinese character encoding is: [x{4e00}-x{9fa5}].
