『壹』 怎麼樣在asp中建立sql臨時表
如果用臨時表的,你還純信不如用存儲過程,還得直做慎輪接.
在Adodb.Connection中用孝碧臨時表,不是好方法
『貳』 ASP 如何執行SQL建表,並回入默認值
create table 表帆梁 ( 
[ID] int Default(0), 
[Title] varchar(20) Default ('Default後面的就是告毀默認襪轎備值')
)
『叄』 用ASP寫向SQL2000資料庫創建一個新表的語句
<% 
set conn=server.createobject("adodb.connection") 
set rs=server.createobject("adodb.recordset")
'連接MS Server 
connstr="driver={sql server};server=198.74.101.247;uid=koko1211;pwd=111111;database=koko1211"
 
conn.open connstr
'創尺舉臘建表test 
sql="create table KeyList (mykey char(20) null" 
rs.open sql,conn,3,3
'插入數據陵滑 
sql="insert into KeyList (mykey) values('電子')" 
rs.open sql,conn,3,3
'刪除表test 
'sql="drop table Test"答衫 
'rs.open sql,conn,3,3 
%>
『肆』 asp在mssql中建立表
把 use beta 去掉。
create database beta 創建資料庫後,信並要關閉迅昌數據源連接,並且要使用新的連接字元串畝坦扒(連接字元串中指定「新的資料庫名稱」)重新打開數據源連接,這樣創建數據表才行。
『伍』 用asp 語句,在頁面里通過什麼方法能在SQL資料庫里創建一個表
sql="虧和create table table1(id int not null,name char(30) not null)"銷悉盯陸乎
『陸』 如何在asp.net中 創建SQL表
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[表名]'碧搜) and OBJECTPROPERTY(id, N'IsUserTable'桐啟) = 1)
drop table [dbo].[表名局慧如]
create table 表名
『柒』 asp 創建mssql資料庫
方法一:
<%
' ************ 使用ADODB.Connect對象創建 ************************
Dim oConn
Dim sDatabaseName
sDatabaseName = "CodeCreateDB"
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=SQLOLEDB;Data Source=(local);User ID=sa;Password=;"
oConn.Execute "CREATE DATABASE " & sDatabaseName
%>
方法二:
<%@ Language=VBScript %>
<%
' ******************* 使用 SQLDMO Object 對象庫 *******************
Dim oSQLServer
Dim oDatabase
Dim oDBFileData
Dim oLogFile
Dim sDatabaseName
Dim sDatapath
'資料庫名字
sDatabaseName = "CodeCreateDBTest"
'數據文件保存路徑
sDatapath = "D:"
'創建Sql Server對象並進行鏈接,(local)處為Server名字
Set oSQLServer = Server.CreateObject("SQLDMO.SQLServer")
'  oSQLServer.LoginSecure = True       ' 使用集成驗證integrated security
'  oSQLServer.Connect "(local)"
oSQLServer.Connect "(local)", "sa", "" ' 使用標准驗證 standard security
' 創建Database對象
Set oDatabase =  Server.CreateObject("SQLDMO.Database")
oDatabase.Name = sDatabaseName
' 創建db文件對象
Set oDBFileData =  Server.CreateObject("汪襲粗SQLDMO.DBFile")
With oDBFileData
    .Name = sDatabaseName & "_data"
    .PhysicalName = sDatapath & "" & sDatabaseName & "_data.mdf"
    .PrimaryFile = True
    .FileGrowthType = SQLDMOGrowth_MB
    .FileGrowth = 1
End With
' 創建日誌文件對象
Set oLogFile =  Server.CreateObject("SQLDMO.LogFile")
With oLogFile
    .Name = sDatabaseName & "_log"
    .PhysicalName = sDatapath & "" & sDatabaseName & "_log.ldf"
End With
'把DB文件對象和日誌文件對象添加到DataBase資料庫對象
oDatabase.FileGroups("PRIMARY").DBFiles.Add oDBFileData
oDatabase.TransactionLog.LogFiles.Add oLogFile
' 把資料庫添加到Sql server(create the database)
oSQLServer.Databases.Add oDatabase
' 關閉連接
oSQLServer.Close
' 釋困鎮放對象
Set oLogFile = Nothing
Set oDBFileData = Nothing
Set oDatabase = Nothing
Set oSQLServer = Nothing
%>
創建表就執禪山行conn.execute("create table [table](id int identity primary key)")
『捌』 asp創建sql資料庫表問題
直接通過那個語句是不行的。
Public   function   CreateDBfile(byVal   dbFileName,byVal   DbVer,byVal   SavePath)     
  '建立資料庫文行嫌耐件     
  'If   DbVer   is   0   Then   Create   Access97   dbFile     
  'If   DbVer   is   1   Then   Create   Access2000   dbFile     
  On   error   resume   Next     
  If   Right(SavePath,1)<>"\"   Or   Right(SavePath,1)<>"/"   Then   SavePath   =   Trim(SavePath)   &   "\"     
  If   Left(dbFileName,1)="\"   Or   Left(dbFileName,1)="/"   Then   dbFileName   =   Trim(Mid(dbFileName,2,Len(dbFileName)))     
  If   DbExists(SavePath   &   dbFileName)   Then     
  Response.Write   ("對不起,該資料庫已經存在!")     
  CreateDBfile   =   False     
  Else     
  Dim   Ca     
  Set   Ca   =   Server.CreateObject("ADOX.Catalog")     
  If   Err.number<>0   Then     
  Response.Write   ("無法建立,請者友檢查錯檔春誤信息   
  "   &   Err.number   &   "   
  "   &   Err.Description)     
  Err.Clear     
  Exit   function     
  End   If     
  If   DbVer=0   Then     
  call   Ca.Create("Provider=Microsoft.Jet.OLEDB.3.51;Data   Source="   &   SavePath   &   dbFileName)     
  Else     
  call   Ca.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data   Source="   &   SavePath   &   dbFileName)     
  End   If     
  Set   Ca   =   Nothing     
  CreateDBfile   =   True     
  End   If     
  End   function
『玖』 怎麼用ASP代碼新建SQL表!
執行一條 SQL 語句 ...
內容是 CREATE TABLE ........
『拾』 asp.net sql 語句創建表 變數做表名
string s='create table '+表名+' ('+欄位名變數+' '+欄位稿吵凳類型變鍵旅量+')';
SqlCommand cmd=new SqlCommand(s,連接);
cmd.ExecuteNoQuery(); 
連接沒有碰亮被open。
在execute前:
conn.open
