Android在adb上操作sqlite3修改表数据

在调试过程中,需要修改数据库中的数据,此时就要用到sqlite3工具,可以方便我们调试

由于在界面上无法打开“数据连接”,只能通过修改数据库来打开

下面先来看下如何修改表global中的mobile_data数据

[email protected]:~$ adb root
adbd is already running as root
[email protected]:~$ adb remount
remount succeeded
[email protected]:~$ adb shell
[email protected]:/ # cd data/da
dalvik-cache/   data/           data_tmpfs_log/
[email protected]:/ # cd data/dat
data/           data_tmpfs_log/
[email protected]:/ # cd data/data/com.android.providers.settings
[email protected]:/data/data/com.android.providers.settings # ls
databases
lib
[email protected]:/data/data/com.android.providers.settings # cd databases
[email protected]:/data/data/com.android.providers.settings/databases # ls
settings.db
settings.db-journal
qlite3 settings.db                                                            <
SQLite version 3.8.6 2014-08-15 11:46:33
Enter ".help" for usage hints.
sqlite> .table
android_metadata   bookmarks          secure
bluetooth_devices  global             system
sqlite> select * from global;
1|airplane_mode_on|0
2|airplane_mode_radios|cell,bluetooth,wifi,nfc,wimax
3|airplane_mode_toggleable_radios|bluetooth,wifi,nfc
4|assisted_gps_enabled|1
5|auto_time|1
6|auto_time_zone|1
7|stay_on_while_plugged_in|0
8|wifi_sleep_policy|2
9|mode_ringer|2
10|package_verifier_enable|1
12|wifi_networks_available_notification_on|1
13|bluetooth_on|0
14|cdma_cell_broadcast_sms|1
15|data_roaming|0
18|netstats_enabled|1
19|install_non_market_apps|0
20|usb_mass_storage_enabled|1
21|wifi_max_dhcp_retry_count|9
22|wifi_display_on|0
23|lock_sound|/system/media/audio/ui/Lock.ogg
24|unlock_sound|/system/media/audio/ui/Unlock.ogg
25|trusted_sound|/system/media/audio/ui/Trusted.ogg
26|power_sounds_enabled|1
27|low_battery_sound|/system/media/audio/ui/LowBattery.ogg
28|dock_sounds_enabled|0
29|desk_dock_sound|/system/media/audio/ui/Dock.ogg
30|desk_undock_sound|/system/media/audio/ui/Undock.ogg
31|car_dock_sound|/system/media/audio/ui/Dock.ogg
32|car_undock_sound|/system/media/audio/ui/Undock.ogg
33|wireless_charging_started_sound|/system/media/audio/ui/WirelessChargingStarted.ogg
34|dock_audio_media_enabled|1
35|set_install_location|0
36|default_install_location|0
37|emergency_tone|0
38|call_auto_retry|0
40|subscription_mode|0
41|low_battery_sound_timeout|0
42|wifi_scan_always_enabled|1
43|heads_up_notifications_enabled|1
44|device_name|GN9006
45|guest_user_enabled|1
46|data_roaming_2|0
47|auto_time_gps|0
48|wifi_passpoint_on|1
49|wifi_auto_join|1
50|telephony_misc_feature_config|2
51|ims_switch|1
52|wifi_watchdog_on|1
53|wifi_display_display_toast_time|20
54|wifi_display_notification_time|60
55|wifi_display_sqc_info_on|0
56|wifi_display_qe_on|1
57|wifi_display_auto_channel_selection|0
58|wifi_display_max_resolution|2
59|wifi_display_power_saving_option|1
60|wifi_display_power_saving_delay|10
61|wifi_display_latency_profiling|2
62|wifi_display_chosen_capability|
63|wifi_display_wifi_info|0,0,0,0
64|wifi_display_wfd_latency|0,0,0
65|wifi_display_security_option|1
66|adb_enabled|1
67|network_scoring_provisioned|1
68|device_provisioned|1
69|world_phone_auto_select_mode|1
70|world_phone_fdd_modem_timer|60
71|multi_sim_common|1
72|multi_sim_sms|1
73|multi_sim_voice_call|1
75|audio_safe_volume_state|3
76|mobile_data|1
77|wifi_country_code|cn
81|multi_sim_data_call|1
85|require_password_to_decrypt|1
86|preferred_network_mode|9
87|user_preferred_network_mode|9
89|wifi_on|1
sqlite>
sqlite> update global set value='0' where name='mobile_data';
sqlite>
sqlite> select * from global;
1|airplane_mode_on|0
2|airplane_mode_radios|cell,bluetooth,wifi,nfc,wimax
3|airplane_mode_toggleable_radios|bluetooth,wifi,nfc
4|assisted_gps_enabled|1
5|auto_time|1
6|auto_time_zone|1
7|stay_on_while_plugged_in|0
8|wifi_sleep_policy|2
9|mode_ringer|2
10|package_verifier_enable|1
12|wifi_networks_available_notification_on|1
13|bluetooth_on|0
14|cdma_cell_broadcast_sms|1
15|data_roaming|0
18|netstats_enabled|1
19|install_non_market_apps|0
20|usb_mass_storage_enabled|1
21|wifi_max_dhcp_retry_count|9
22|wifi_display_on|0
23|lock_sound|/system/media/audio/ui/Lock.ogg
24|unlock_sound|/system/media/audio/ui/Unlock.ogg
25|trusted_sound|/system/media/audio/ui/Trusted.ogg
26|power_sounds_enabled|1
27|low_battery_sound|/system/media/audio/ui/LowBattery.ogg
28|dock_sounds_enabled|0
29|desk_dock_sound|/system/media/audio/ui/Dock.ogg
30|desk_undock_sound|/system/media/audio/ui/Undock.ogg
31|car_dock_sound|/system/media/audio/ui/Dock.ogg
32|car_undock_sound|/system/media/audio/ui/Undock.ogg
33|wireless_charging_started_sound|/system/media/audio/ui/WirelessChargingStarted.ogg
34|dock_audio_media_enabled|1
35|set_install_location|0
36|default_install_location|0
37|emergency_tone|0
38|call_auto_retry|0
40|subscription_mode|0
41|low_battery_sound_timeout|0
42|wifi_scan_always_enabled|1
43|heads_up_notifications_enabled|1
44|device_name|GN9006
45|guest_user_enabled|1
46|data_roaming_2|0
47|auto_time_gps|0
48|wifi_passpoint_on|1
49|wifi_auto_join|1
50|telephony_misc_feature_config|2
51|ims_switch|1
52|wifi_watchdog_on|1
53|wifi_display_display_toast_time|20
54|wifi_display_notification_time|60
55|wifi_display_sqc_info_on|0
56|wifi_display_qe_on|1
57|wifi_display_auto_channel_selection|0
58|wifi_display_max_resolution|2
59|wifi_display_power_saving_option|1
60|wifi_display_power_saving_delay|10
61|wifi_display_latency_profiling|2
62|wifi_display_chosen_capability|
63|wifi_display_wifi_info|0,0,0,0
64|wifi_display_wfd_latency|0,0,0
65|wifi_display_security_option|1
66|adb_enabled|1
67|network_scoring_provisioned|1
68|device_provisioned|1
69|world_phone_auto_select_mode|1
70|world_phone_fdd_modem_timer|60
71|multi_sim_common|1
72|multi_sim_sms|1
73|multi_sim_voice_call|1
75|audio_safe_volume_state|3
76|mobile_data|0
77|wifi_country_code|cn
81|multi_sim_data_call|1
85|require_password_to_decrypt|1
86|preferred_network_mode|9
87|user_preferred_network_mode|9
89|wifi_on|1
sqlite> 

上面的过程就把settings.db数据库表global中数据mobile_data从1改为0

下面来看下查看数据库的一些命令:

.database 查看数据库信息

sqlite> .database
seq  name             file
---  ---------------  ----------------------------------------------------------
0    main             /data/data/com.android.providers.media/databases/external.
sqlite>

.table 查看表名称

sqlite> .table
album_art              audio_genres           log
album_info             audio_genres_map       search
albums                 audio_genres_map_noid  searchhelpertitle
android_metadata       audio_meta             thumbnails
artist_info            audio_playlists        video
artists                audio_playlists_map    videothumbnails
artists_albums_map     files
audio                  images
sqlite>

.schema 命令可以查看创建数据表时的SQL命令

sqlite> .schema
CREATE TABLE album_art (album_id INTEGER PRIMARY KEY,_data TEXT);
CREATE TABLE albums (album_id INTEGER PRIMARY KEY,album_key TEXT NOT NULL UNIQUE,album TEXT NOT NULL, album_pinyin_key TEXT);
CREATE TABLE android_metadata (locale TEXT);
CREATE TABLE artists (artist_id INTEGER PRIMARY KEY,artist_key TEXT NOT NULL UNIQUE,artist TEXT NOT NULL, artist_pinyin_key TEXT);
CREATE TABLE audio_genres (_id INTEGER PRIMARY KEY,name TEXT NOT NULL);
CREATE TABLE "audio_genres_map" (_id INTEGER PRIMARY KEY,audio_id INTEGER NOT NULL,genre_id INTEGER NOT NULL,UNIQUE (audio_id,genre_id) ON CONFLICT IGNORE);
CREATE TABLE audio_playlists_map (_id INTEGER PRIMARY KEY,audio_id INTEGER NOT NULL,playlist_id INTEGER NOT NULL,play_order INTEGER NOT NULL);
CREATE TABLE "files" (_id INTEGER PRIMARY KEY AUTOINCREMENT,_data TEXT UNIQUE COLLATE NOCASE,_size INTEGER,format INTEGER,parent INTEGER,date_added INTEGER,date_modified INTEGER,mime_type TEXT,title TEXT,description TEXT,_display_name TEXT,picasa_id TEXT,orientation INTEGER,latitude DOUBLE,longitude DOUBLE,datetaken INTEGER,mini_thumb_magic INTEGER,bucket_id TEXT,bucket_display_name TEXT,isprivate INTEGER,title_key TEXT,artist_id INTEGER,album_id INTEGER,composer TEXT,track INTEGER,year INTEGER CHECK(year!=0),is_ringtone INTEGER,is_music INTEGER,is_alarm INTEGER,is_notification INTEGER,is_podcast INTEGER,album_artist TEXT,duration INTEGER,bookmark INTEGER,artist TEXT,album TEXT,resolution TEXT,tags TEXT,category TEXT,language TEXT,mini_thumb_data TEXT,name TEXT,media_type INTEGER,old_id INTEGER,storage_id INTEGER,is_drm INTEGER,width INTEGER, height INTEGER,drm_content_uri TEXT,drm_offset INTEGER,drm_dataLen INTEGER,drm_rights_issuer TEXT,drm_content_name TEXT,drm_content_description TEXT,drm_content_vendor TEXT,drm_icon_uri TEXT,drm_method INTEGER,title_pinyin_key TEXT,name_pinyin_key TEXT,file_name TEXT,file_type INTEGER DEFAULT 0,group_id INTEGER DEFAULT 0,group_index INTEGER DEFAULT 0,focus_value_high INTEGER DEFAULT 0,focus_value_low INTEGER DEFAULT 0,is_best_shot INTEGER DEFAULT 0,group_count INTEGER DEFAULT 0,is_live_photo INTEGER DEFAULT 0, slow_motion_speed TEXT, is_record INTEGER DEFAULT 0);
CREATE TABLE "log" (time DATETIME, message TEXT);
CREATE TABLE thumbnails (_id INTEGER PRIMARY KEY,_data TEXT,image_id INTEGER,kind INTEGER,width INTEGER,height INTEGER);
CREATE TABLE videothumbnails (_id INTEGER PRIMARY KEY,_data TEXT,video_id INTEGER,kind INTEGER,width INTEGER,height INTEGER);
CREATE VIEW album_info AS SELECT audio.album_id AS _id, album, album_key, album_pinyin_key,MIN(year) AS minyear, MAX(year) AS maxyear, artist, artist_id, artist_key, artist_pinyin_key,count(*) AS numsongs,album_art._data AS album_art FROM audio LEFT OUTER JOIN album_art ON audio.album_id=album_art.album_id WHERE is_music=1 GROUP BY audio.album_id;
CREATE VIEW artist_info AS SELECT artist_id AS _id, artist, artist_key, artist_pinyin_key,COUNT(DISTINCT album_key) AS number_of_albums, COUNT(*) AS number_of_tracks FROM audio WHERE is_music=1 GROUP BY artist_key;
CREATE VIEW artists_albums_map AS SELECT DISTINCT artist_id, album_id FROM audio_meta;
CREATE VIEW audio as SELECT * FROM audio_meta LEFT OUTER JOIN artists ON audio_meta.artist_id=artists.artist_id LEFT OUTER JOIN albums ON audio_meta.album_id=albums.album_id;
CREATE VIEW audio_genres_map_noid AS SELECT audio_id,genre_id from audio_genres_map;
CREATE VIEW audio_meta AS SELECT _id,_data,_display_name,_size,mime_type,date_added,is_drm,date_modified,title,title_key,duration,artist_id,composer,album_id,track,year,is_ringtone,is_music,is_alarm,is_notification,is_podcast,bookmark,album_artist,drm_content_uri,drm_offset,drm_dataLen,drm_rights_issuer,drm_content_name,drm_content_description,drm_content_vendor,drm_icon_uri,drm_method,title_pinyin_key,is_record FROM files WHERE media_type=2;
CREATE VIEW audio_playlists AS SELECT _id,_data,name,date_added,date_modified,name_pinyin_key FROM files WHERE media_type=4;
CREATE VIEW images AS SELECT _id,_data,_size,_display_name,mime_type,title,date_added,date_modified,description,picasa_id,isprivate,latitude,longitude,datetaken,orientation,mini_thumb_magic,bucket_id,bucket_display_name,width,height,is_drm,drm_content_uri,drm_offset,drm_dataLen,drm_rights_issuer,drm_content_name,drm_content_description,drm_content_vendor,drm_icon_uri,drm_method,group_id,group_index,focus_value_high,focus_value_low,is_best_shot,group_count FROM files WHERE media_type=1;
CREATE VIEW search AS SELECT _id,'artist' AS mime_type,artist,NULL AS album,NULL AS title,artist AS text1,NULL AS text2,number_of_albums AS data1,number_of_tracks AS data2,artist_key AS match,'content://media/external/audio/artists/'||_id AS suggest_intent_data,1 AS grouporder FROM artist_info WHERE (artist!='<unknown>') UNION ALL SELECT _id,'album' AS mime_type,artist,album,NULL AS title,album AS text1,artist AS text2,NULL AS data1,NULL AS data2,artist_key||' '||album_key AS match,'content://media/external/audio/albums/'||_id AS suggest_intent_data,2 AS grouporder FROM album_info WHERE (album!='<unknown>') UNION ALL SELECT searchhelpertitle._id AS _id,mime_type,artist,album,title,title AS text1,artist AS text2,NULL AS data1,NULL AS data2,artist_key||' '||album_key||' '||title_key AS match,'content://media/external/audio/media/'||searchhelpertitle._id AS suggest_intent_data,3 AS grouporder FROM searchhelpertitle WHERE (title != '');
CREATE VIEW searchhelpertitle AS SELECT * FROM audio ORDER BY title_key;
CREATE VIEW video AS SELECT _id,_data,_display_name,_size,mime_type,date_added,date_modified,title,duration,artist,album,resolution,description,isprivate,tags,category,language,mini_thumb_data,latitude,longitude,datetaken,mini_thumb_magic,bucket_id,bucket_display_name,bookmark,width,height,is_drm,drm_content_uri,drm_offset,drm_dataLen,drm_rights_issuer,drm_content_name,drm_content_description,drm_content_vendor,drm_icon_uri,drm_method,is_live_photo,slow_motion_speed,orientation FROM files WHERE media_type=3;
CREATE INDEX album_id_idx ON files(album_id);
CREATE INDEX album_idx on albums(album);
CREATE INDEX albumkey_index on albums(album_key);
CREATE INDEX albumpinyinkey_index on albums(album_pinyin_key);
CREATE INDEX artist_id_idx ON files(artist_id);
CREATE INDEX artist_idx on artists(artist);
CREATE INDEX artistkey_index on artists(artist_key);
CREATE INDEX artistpinyinkey_index on artists(artist_pinyin_key);
CREATE INDEX bucket_index on files(bucket_id,media_type,datetaken, _id);
CREATE INDEX bucket_name on files(bucket_id,media_type,bucket_display_name);
CREATE INDEX format_index ON files(format);
CREATE INDEX image_id_index on thumbnails(image_id);
CREATE INDEX media_type_index ON files(media_type);
CREATE INDEX parent_index ON files(parent);
CREATE INDEX path_index ON files(_data);
CREATE INDEX sort_index ON files(datetaken ASC, _id ASC);
CREATE INDEX title_idx ON files(title);
CREATE INDEX titlekey_index ON files(title_key);
CREATE INDEX video_id_index on videothumbnails(video_id);
CREATE TRIGGER albumart_cleanup1 DELETE ON albums BEGIN DELETE FROM album_art WHERE album_id = old.album_id;END;
CREATE TRIGGER albumart_cleanup2 DELETE ON album_art BEGIN SELECT _DELETE_FILE(old._data);END;
CREATE TRIGGER audio_genres_cleanup DELETE ON audio_genres BEGIN DELETE FROM audio_genres_map WHERE genre_id = old._id;END;
CREATE TRIGGER audio_playlists_cleanup DELETE ON files WHEN old.media_type=4 BEGIN DELETE FROM audio_playlists_map WHERE playlist_id = old._id;SELECT _DELETE_FILE(old._data);END;
CREATE TRIGGER files_cleanup DELETE ON files BEGIN SELECT _OBJECT_REMOVED(old._id);END;
sqlite>

.schema table_name 查看创建表table_name时的SQL的命令

sqlite> .schema files
CREATE TABLE "files" (_id INTEGER PRIMARY KEY AUTOINCREMENT,_data TEXT UNIQUE COLLATE NOCASE,_size INTEGER,format INTEGER,parent INTEGER,date_added INTEGER,date_modified INTEGER,mime_type TEXT,title TEXT,description TEXT,_display_name TEXT,picasa_id TEXT,orientation INTEGER,latitude DOUBLE,longitude DOUBLE,datetaken INTEGER,mini_thumb_magic INTEGER,bucket_id TEXT,bucket_display_name TEXT,isprivate INTEGER,title_key TEXT,artist_id INTEGER,album_id INTEGER,composer TEXT,track INTEGER,year INTEGER CHECK(year!=0),is_ringtone INTEGER,is_music INTEGER,is_alarm INTEGER,is_notification INTEGER,is_podcast INTEGER,album_artist TEXT,duration INTEGER,bookmark INTEGER,artist TEXT,album TEXT,resolution TEXT,tags TEXT,category TEXT,language TEXT,mini_thumb_data TEXT,name TEXT,media_type INTEGER,old_id INTEGER,storage_id INTEGER,is_drm INTEGER,width INTEGER, height INTEGER,drm_content_uri TEXT,drm_offset INTEGER,drm_dataLen INTEGER,drm_rights_issuer TEXT,drm_content_name TEXT,drm_content_description TEXT,drm_content_vendor TEXT,drm_icon_uri TEXT,drm_method INTEGER,title_pinyin_key TEXT,name_pinyin_key TEXT,file_name TEXT,file_type INTEGER DEFAULT 0,group_id INTEGER DEFAULT 0,group_index INTEGER DEFAULT 0,focus_value_high INTEGER DEFAULT 0,focus_value_low INTEGER DEFAULT 0,is_best_shot INTEGER DEFAULT 0,group_count INTEGER DEFAULT 0,is_live_photo INTEGER DEFAULT 0, slow_motion_speed TEXT, is_record INTEGER DEFAULT 0);
CREATE INDEX album_id_idx ON files(album_id);
CREATE INDEX artist_id_idx ON files(artist_id);
CREATE INDEX bucket_index on files(bucket_id,media_type,datetaken, _id);
CREATE INDEX bucket_name on files(bucket_id,media_type,bucket_display_name);
CREATE INDEX format_index ON files(format);
CREATE INDEX media_type_index ON files(media_type);
CREATE INDEX parent_index ON files(parent);
CREATE INDEX path_index ON files(_data);
CREATE INDEX sort_index ON files(datetaken ASC, _id ASC);
CREATE INDEX title_idx ON files(title);
CREATE INDEX titlekey_index ON files(title_key);
CREATE TRIGGER audio_playlists_cleanup DELETE ON files WHEN old.media_type=4 BEGIN DELETE FROM audio_playlists_map WHERE playlist_id = old._id;SELECT _DELETE_FILE(old._data);END;
CREATE TRIGGER files_cleanup DELETE ON files BEGIN SELECT _OBJECT_REMOVED(old._id);END;
sqlite>

.quit 退出命令行接口

sqlite> .quit
[email protected]:/data/data/com.android.providers.media/databases #

时间: 2024-10-10 11:36:38

Android在adb上操作sqlite3修改表数据的相关文章

像修改表数据一样修改视图数据

摘要:像修改表数据一样修改视图数据,具体思路是通过给视图增加触发器来实现修改实体表数据 实现效果: Update dbo.[视图] set [字段]=''   等价于  Update dbo.[表] set [字段]='' 备注:数据库使用的是Sql Server 2008 1)用户表 basicdata..[user]USE [BasicData]GO /****** Object:  Table [dbo].[user]    Script Date: 07/20/2015 16:22:31

Sap SE16n 修改表数据

SAP中直接修改表.视图的Tcode有SE16N和SM30. 其中使用SE16N修改表需要先输入命令&SAP_EDIT, 回车左下角显示激活SAP编辑功能后,就可以对相应的表进行新增.删除.修改的操作. 有时输入&SAP_EDIT后还是不能激活,是因为另有地方限制,执行程序RKSE16N_EDIT,选中激活编辑功能后,问题得以解决. 另外,在EHP5版本中,激活编辑功能是不被允许的,不过程序中是通过一个判断语句来限制的,可以通过将相关的判断值判断前加断点,手工修改赋予值之后,问题也迎刃而解

android进入adb shell步骤及修改sqlite数据库文件的权限

1 准备工作 (1)将adb.exe从  \Sdk\platform-tools目录下移动到 \Sdk\tools目录下(主要是看emulator这几个文件在哪个文件夹就把adb.exe移动到哪个文件夹): (2)将sqlite3.exe从  \Sdk\platform-tools目录下移动到 \Sdk\tools目录下(同上) 2 打开CMD界面,cd到 \Sdk\tools目录下,运行指令 adb shell进入adb界面内 3 定位到数据库所在的位置,chmod 777 file 修改文件

sql 数据库中用创建好的视图修改表数据

只要满足下列条件,即可通过视图修改基础基表的数据: 1.任何修改(包括 UPDATE.INSERT 和 DELETE 语句)都只能引用一个基表的列. 2.视图中被修改的列必须直接引用表列中的基础数据.不能通过任何其他方式对这些列进行派生,如通过以下方式: 1)聚合函数:AVG.COUNT.SUM.MIN.MAX.GROUPING.STDEV.STDEVP.VAR 和 VARP.2)计算.不能从使用其他列的表达式中计算该列.使用集合运算符 UNION.UNION ALL.CROSSJOIN.EXC

mysql update与select结合修改表数据

在遇到需要update设置的参数来自从其他表select出的结果时,需要把update和select结合使用,不同数据库支持的形式不一样,在mysql中如下: update A inner join(select id,name from B) c on A.id = c.id set A.name = c.name; 根据AB两个表的id相同为条件连接两表,  把A表的name修改为B的name,sql语句就如上所示. 参考原文:https://blog.csdn.net/qq_3682391

JDBC修改表数据

修改数据时用到update语句,使用这个语句时也要有条件的,指定修改某一行的数据,没有条件判断,则修改全部. 1 package qddx.JDBC; 2 import java.sql.*; 3 public class UpdatebbsVo { 4 5 public void update(bbsVo vo){ 6 Connection conn = null; 7 PreparedStatement pst = null; 8 String sql = "update article s

修改表的操作

修改表操作 1.修改表类型 alter table tb01 modify name varchar(30); 2.增加表字段 alter table tb01 add column city varchar(20); 3.删除表字段 alter table tb01 drop column city; 4.字段改名 alter table tb01 change city new_city varchar(20); 注意:change和modify都可以修改表的定义,不同的是change后面需

SQL语句修改表名和字段名

今天有个临时任务,修改生产环境的数据库表名和字段名.以前要修改表名字段名都是在开发环境,直接打开 SQL Server找到对应的表或字段重命名就OK啦,可是这是线上数据库,再想直接F2修改是不可能的啦.怎么办?乖 乖写脚本呗.上网了解了一些相关资料,结合我自己操作过程中出现的一些实际问题简单作个总结,再次加深下印 象. SQL自带了一系列的系统存储过程.其中sp_rename就具有修改表名和列名的功能.对于sp_rename是这样定 义的:更改当前数据库中用户创建对象(如表.列或用户定义数据类型

SQL Server 的表数据简单操作

--表数据操作----添加表数据----向现有表添加数据--[use 要操作数据表的数据库名称go]insert [into] 数据表 [(字段名1,字段名2,字段名3, ...)] values(值1,值2,值3, ...) 例:use 商品管理数据库goinsert 客户信息表(客户姓名,客户编号,联系电话)values('刘培群','021','13927112594') --把查询到的表数据生成(添加到)一张新数据表--[use 要操作数据表的数据库名称go]select 字段名列表 i