SQLserverÉú³Éinsert into´øÊý¾Ý½Å±¾.
ÓÐʲô¹¤¾ß¿ÉÒÔ°ÑsqlserverµÄÊý¾ÝÉú³Éinsert intoµÄ½Å±¾?ÏñmysqlÄÇÑùµ¼³ö.sqlÎļþ.
mssqlÖ»¿ÉÒÔÉú³É±í½á¹¹µÄsqlÎļþ.²»´øÊý¾ÝµÄ.
Èç¹û±íÉٵĻ°
×Ô¼ºÆ´°É
Â¥Ö÷˵µÄÊÇÒª°ÑÊý¾Ý¿âÄÚµÄÒѲåÈëµÄÊý¾ÝתΪSQL½Å±¾?
SQL×Ô´øµÄ¹¤¾ß¿ÉÒÔÉú³É±í½á¹¹ÐÅÏ¢½Å±¾.
SQL code:
****************************************************************************
Èí¼þÃû³Æ: May Flower Erp
°æȨËùÓÐ: (C) 2005-2006 May Flower ERP ¿ª·¢×é
¹¦ÄÜÃèÊö: »ñÈ¡Ö¸¶¨±íµÄ´´½¨½Å±¾,°üÀ¨±íºÍ×ֶεÄÊôÐÔ¡¢Íâ¼ü(×¢Ê͵ôµÄ)
----------------------------------------------------------------------------
²ÎÊýÁбí:
1: @TableName ÐèÒª´´½¨½Å±¾µÄ±íµÄÃû³Æ
****************************************************************************
|</PRE>*/
CREATE PROCEDURE [dbo].[sp_HelpTable](@TableName sysname)
AS
SET NOCOUNT ON
DECLARE @ObjectID int
DECLARE @TableScript table(Iden int IDENTITY(1, 1), ScriptLine nvarchar(4000))
SET @ObjectID = object_id(@TableName)
IF @ObjectID IS NULL OR OBJECTPROPERTY(@ObjectID, 'IsTable') = 0
BEGIN
RAISERROR('Ö¸¶¨µÄ¶ÔÏó²»ÊDZí¶ÔÏó', 16, 1)
RETURN
END
--»ñÈ¡±íµÄ´´½¨½Å±¾
--²åÈë±íÍ·
INSERT INTO @TableScript(ScriptLine)
SELECT N'CREATE TABLE [' + USER_NAME(OBJECTPROPERTY(@ObjectID, N'OwnerId')) + N'].[' + object_name(@ObjectID) + N']('
--²åÈë×Ö¶Î
INSERT INTO @TableScript(ScriptLine)
SELECT N'
Ïà¹ØÎÊ´ð£º
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class QueryTest&n ......
Ҫת³ÉÒ»ÑùµÄЧ¹û£¬ÓÃpowerdesignerÔõôת£¿ÄÜתÂð£¿
create table publishers (
publisherID int identity,
publisherName varchar (30) NOT NULL,
constraint pk_publishers primary key (publisherID)
)& ......
ÒÔÏ´úÂëÊÇÌí¼ÓÊý¾Ý°´Å¥µÄ´úÂ룬Ïë°Ñtestid£¬ºÍtestnameÁ½¸ötxt´«µÝµ½Êý¾Ý¿âÖÐ
Êý¾Ý¿âÁ¬½Ó¿Ï¶¨Ã»ÎÊÌâ
¾ÍÊǺìÉ«²¿·ÖÀϱ¨´í
²»ÖªµÀΪʲô-£¬-
Çë¸÷λ¸ßÈË°ïæ¿´¿´£¡
лл£¡
Java code:
private void new ......
´ó¼ÒºÃ ×î½üÓöµ½µãÂé·³ Çë´ó¼Ò°ïæ ÈçÏ £º
ÎÒÔÚÒ»¸öѧÉúµÄÊý¾Ý¿â STU ÖвéѯSTUDENTS ±íÖÐ Ïà¹ØµÄÊý¾Ý
CREATE TABLE STUDENTS
(
ID INT IDENTITY(1,1) PRIMARY KEY ,
[NAME] VARCHAR(20) N ......
ÎÒÍùSqlServerÖмÓÊý¾ÝµÄʱºò,Ëû¸øÎÒ±¨Á˸ö´í
˵:"µ± IDENTITY_INSERT ÉèÖÃΪ OFF ʱ£¬²»ÄÜÏò±í 'O_TRAIN_CATEGORY' ÖеıêʶÁвåÈëÏÔʽֵ¡£"
ÒòΪÎÒÕâ¸ö±íµÄÖ÷¼üÉèÖõÄÊÇ×ÔÔöµÄ!ÊDz»ÊÇ×ÔÔöû¿ª°¡?Ôõô¸ ......