ÓÃC#¶ÁSQL SERVERµ½¿ØÖÆÌ¨µÄ¼òµ¥Ê¾Àý
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
//sqlserverÉí·ÝÑéÖ¤
//string sqlconn = "server=(local);database=keede1228;user id=sa;password=123;";
//windowsÉí·ÝÑéÖ¤
string sqlconn = "server=(local);database=keede1228;integrated security=SSPI;";
string select = "select * from dbo.lmShop_City";
SqlConnection conn = new SqlConnection(sqlconn);
Console.WriteLine("33");
conn.Open();
Console.WriteLine("11");
SqlCommand cmd = new SqlCommand(select, conn);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
Console.WriteLine("cityid:{0} city:{1} area:{2}", reader[0], reader[1], reader[2]);
}
conn.Close();
Console.WriteLine("22");
Console.ReadKey();
}
}
}
ÓÐÒ»µãÒÉÎÊ£º×îºóÊä³öµ½¿ØÖÆÌ¨µÄʱºò£¬Èç¹û²»¼Ó"cityid:{0} city:{1} area:{2}"¾Í»á±¨´í£¬²»ÖªµÀÊÇΪʲô£¬ºÃÏñÊÇÀàÐÍת»»µÄÊ£¬ÓÐÃ÷°×µÄ°ïÎÒ½â´ðһϣ¬Ð»Ð»¡£
Ïà¹ØÎĵµ£º
ÁÙʱ±íÓëÒ»°ãµÄ±í²»Í¬£¬ËüÊDZ£´æµ½tempDb±íÖС£ÁÙʱ±íµÄ±íÃûÓëÄãËù½¨µÄ±íÃûÒ²²»Ò»Ñù£¬ÒòΪËûҪΪ²»Í¬È˵ÄÏàͬ²Ù×÷´´½¨²»Í¬µÄÁÙʱ±í¡£
1¡¢´íÎóµÄɾ³ý²Ù×÷£º
--´íÎóµÄÁÙʱ±íɾ³ý²Ù×÷£¬ÒòΪËùÔÚÊý¾Ý¿â²»Í¬
IF EXISTS (SELECT * from sysobjects WHERE object_id = OBJE ......
2009-10-08 16:05
ʲôÊÇÊÓͼ
´ó¼Ò¶¼ÖªµÀ£¬ÎÒÃǹú¼ÒÏÖÔÚ“ÉñÆß”ÉÏÌìÁË¡£´ÓÃÀ¹úµÄÔÂÇòµÇÔ¿ªÊ¼£¬ÈËÀàÉÏÌì²»ÔÙÊÇÉñ»°¡£Ìý˵£¬ÔÚÃÀ¹ú£¬ÄãÖ»Òª³ö¼¸Ê®ÍòÃÀÔª£¬Äú¾Í¿ÉÒÔÉÏÒ»´ÎÔÂÇò½øÐÐÌ«¿ÕÂÃÐУ¬ËùÒÔ£¬ÎÒÃÇÏàÐÅ£ºÔÚ²»¾ÃµÄ½«À´£¬ÉÏÌìÂÃÐн«×ß½øÎÒÃǰÙÐÕµÄÉú»î£¬ÄÇÊÇÒ»¼þ¶àôÐÂÏÊÉñÆæµÄÊÂÇé° ......
sql server ¸ü¸Ä±íµÄËùÊôÓû§µÄÁ½¸ö·½·¨
--¸ü¸Äij¸ö±í
exec sp_changeobjectowner 'tablename','dbo'
--´æ´¢¸ü¸ÄÈ«²¿±í
CREATE PROCEDURE dbo.User_ChangeObjectOwnerBatch
@OldOwner as NVARCHAR(128),
@NewOwner as NVARCHAR(128)
AS
DECLARE @Name as NVARCHAR(128)
DECLARE @Owner as NVARCHAR(128)
D ......
http://topic.csdn.net/u/20100113/17/b52a1ef4-54a8-4333-8119-a161869c1eef.html
---------------------------------
-- Author: liangCK СÁº
-- Title : ²éÿ¸ö·Ö×éǰNÌõ¼Ç¼
-- Date : 2008-11-13 17:19:23
---------------------------------
--> Éú³É²âÊÔÊý¾Ý: #T
IF OBJECT_ID(' ......
Oracle µÄSQL*LOADER¿ÉÒÔ½«ÍⲿÊý¾Ý¼ÓÔØµ½Êý¾Ý¿â±íÖС£ÏÂÃæÊÇSQL*LOADERµÄ»ù±¾Ìص㣺
1£©ÄÜ×°È벻ͬÊý¾ÝÀàÐÍÎļþ¼°¶à¸öÊý¾ÝÎļþµÄÊý¾Ý
2£©¿É×°Èë¹Ì¶¨¸ñʽ£¬×ÔÓɶ¨½çÒÔ¼°¿É¶È³¤¸ñʽµÄÊý¾Ý
3£©¿ÉÒÔ×°Èë¶þ½øÖÆ£¬Ñ¹ËõÊ®½øÖÆÊý¾Ý
4£©Ò»´Î¿É¶Ô¶à¸ö±í×°ÈëÊý¾Ý
5£©Á¬½Ó¶à¸öÎïÀí¼Ç¼װµ½Ò»¸ö¼Ç¼ÖÐ
6£©¶ÔÒ»µ¥¼Ç¼·Ö½âÔÙ×°Èëµ½± ......