批处理安装SQL SERVER 脚本文件
createdb.bat文件
@echo off
echo ╬ ╱◥███◣╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
echo ╬ ︱田︱田 田 ︱ ╬
echo ╬ 绿色佳软 ╬
echo ╬ Copyright (c) 咏南工作室 ╬
echo ╬ Author: 陈新光 ╬
echo ╬ ToDo: 安装数据库 ╬
echo ╬ Date: 2006.11.10 ╬
echo ╬ Note: 安装SQL SERVER 2000 ╬
echo ╬ 数据库名:ynpos ╬
echo ╬ 数据库文件将安装到c:\yndata目录 ╬
echo ╬ 终止操作,请按ctrl+c键 ╬
echo ╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
pause
md c:\yndata
osql -U sa -P -i createdb.sql
相关文档:
Sql代码:Powered by chenjiazi
--查询当天:
select * from info where DateDiff(dd,datetime,getdate())=0
--查询24小时内的:
select * from info where DateDiff(hh,datetime,getDate())<=24
--info为表名,datetime为数 ......
D:\projects\openi\misc\xxxx_data_20090828>bcp [xxxxolap].[dbo].[wdb_cxbz] in wdb_xxx.txt -c -T
SQLState = 37000, NativeError = 4060
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot open database "xxxolap" requested by the login. The login failed.
S ......
1
、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断
select
*
from
people
where
peopleId
in
(
select
peopleId
from
people
group
by
peopleId
having
cou ......
update t1 set t1.value=t2.value from t2 where t1.id=t2.id
update jbsite_class set topicnum = count
from (select t2.classid,count from (
select distinct classid,count(*) as count
from jbsite_product ......
ALTER PROCEDURE [dbo].[GetUsersList]
@BigClassID int=0,--大类别ID
@SmallClassID int=0 ,--小类别ID
@pageindex int=1,
@pagesize int=3,
@ret int output --共几条
AS
set rowcount @pagesize
if @SmallClassID>0
begin
select * from(
select id,BigClassName,SmallClassName,UserName,Corporation,r ......