摘要:Using SQL Server Management Studio To configure the user connections option 1.In Object Explorer, right-click a server and click Properties. 2.Click t
阅读全文
摘要:print convert(varchar, getdate(), 121) declare @callID as intdeclare @errCode as intdeclare @msg as nvarchar(200) exec [sp_Test_alwayRetTrue] @callID,
阅读全文
摘要:1 : 日期 + 1DECLARE @date DateTimeSET @date = GetDate()SET @date = DateAdd(day, 1, @date)SELECT @date
阅读全文
摘要:1 : c#代码是 SqlConnection connNew = null; connNew = new SqlConnection(@"Data Source="XXX"); ...
阅读全文
摘要:bigint 的数据范围是 从 -2^63 (-9223372036854775808) 到 2^63-1 (9223372036854775807) 的整型数据但是 ,如果这么写 print CAST(POWER(3, 20) AS BIGINT) 会报这个错误 Msg 232...
阅读全文
摘要:Arvixe主机是看不到c盘或d盘的, 所有操作都是通过 Control Panel ,地址是Address: http://cp.meijinaiwo.comAlternate Address: http://cp.dock.arvixe.comAlternate ...
阅读全文
摘要:如果这样用UPDATE Accounts SET Balance = Balance + @Amount WHERE AccountID = @ID_AIF (@@ERROR > 0) GOTO PROBLEM需要注意: When using the @@ERROR value in Transact-SQL, you must be careful tocheck it immediately after each operation. That’s because @@ERROR is reset to 0 when a successfulSQL statement is comp
阅读全文
摘要:A 表 (充值记录表) 有以下的字段 -------hisreload 表ID (递增) , ToMobile(冲往哪个手机号) ,refID (guid ,表示一次事务) ......----------------------------------------------B表(transactions)有以下字段refID(与A表关联) , opTime (操作时间) ........--------------------------------------------想实现的功能是: 查询 所有手机号及其最后一次充值记录 , 并对操作时间过滤, 例如去掉 最后一次充值在 2013-9
阅读全文
摘要:inner join :The INNER JOIN keyword selects all rows from both tables as long as there is a match between the columns in both tables.left join :The LEFT JOIN keyword returns all rows from the left table (table1), with the matching rows in the right table (table2). The result is NULL in the right side
阅读全文
摘要:例如以下的sql语句select * from Tags where Name in('ruby','rails','scruffy','rubyonrails')写成这样, 编译不通过declare @nameList nvarchar(100)select @nameList = 'aaa,bbb,ccc,ddd'select * from Tags where Name in @nameList如果还是想简单的传入一个字符串代表 in 的目标 , 可以:一 : 先建一个函数 , split传入的参数 , 存到
阅读全文
摘要:在维护以前的程序时,遇到这样的情况,需要向远程数据库写非常多的记录。原先的实现是这样的 :一 : 用datagridview显示要写入的记录,假设有10000条二:循环每一条记录,调用存储过程,将该条记录写入 ,代码如下 for (int i = 0; i @EnrollDate设 传进来的记录为 row意思是找出当前表中所有rateplanid 和row的@RatePlanID相同 ,且ExpiryDate大于row的@EnrollDate的记录然后update 这些记录的 expiryDate 然后再insert row-----------------------...
阅读全文
摘要:@@rowcountAfter each Transact-SQL statement, the server sets the value of this variable to the total number of records affected by it. It can be used to verify the success of selected operations: select Make, Model, EqTypeid into OldEquipment from Equipment where EqTypeid = 2 if ...
阅读全文
摘要:1 : ExecuteNonQuery() Executes non-SELECT commands, such as SQL commands that insert,delete, or update records. The returned value indicates the number of rows affected by the command. You can also use ExecuteNonQuery() toexecute data-definition commands that create, alter, or delete database object
阅读全文
摘要:一种是:让 sql server 2008 支持.net 4.0,但如何实现不知道简单方法是 : 用 vs 2005 build程序集或者在 project---->property---->application----->Target Framework 选 .net framework 3.5vs各版本使用的.net 版本分别是1.0: Visual Studio .NET1.1: Visual Studio .NET 20032.0: Visual Studio 2005 / 20083.0 / 3.5: Visual Studio 20084.0: Visual S
阅读全文
摘要:declare @ct as datetimeselect @ct=GETDATE()print @ctselect @ct=dateadd(month,datediff(month,0,@ct), '00:00:00')print @ct
阅读全文
摘要:select 'a' as column1 name1 : wrongselect 'a' as [column1 name1] : ok[] : brackets
阅读全文
摘要:Just to clear up... or sum up...nchar and nvarchar can store Unicode characters.char and varchar cannot store Unicode characters.char and nchar are fixed-length which will reserve storage space for number of characters you specify even if you don't use up all that space.varchar and nvarchar are
阅读全文
摘要:function Binary_CheckSum对大小写敏感,想忽略大小写可用CheckSum.These functions are also valuable for comparing and indexing long string columns. Instead of creating an index on such column, you can add a column based onthe checksum or binary checksum of the value in the string column and index it instead. This typ
阅读全文