自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Tony Fu's Blog

Beginner, and Always Beginner

  • 博客(16)
  • 收藏
  • 关注

原创 How to Use 'Exec Sp_executesql' to Read SQL String with Data Exchange(Interface)

if object_id('finaltest') is not null    drop proc finaltest   go    create proc finaltest  @student_number INT output, @lastfirst varchar(50) output, @input_

2016-12-05 16:14:47 217

原创 Interlude: Troubleshooting for Failed to Declare Table-type Variables

When you declare like:   select * into @testitout from students  or  DECLARE @TESTITOUT TABLE  select * into @testitout from students  or 

2016-12-02 13:01:52 175

原创 How to Use Temporary Variable

Some time, we need some variable to transfer number, date or even table.  For accomplish tasks like that , I will introduce some build-in function of sql server in this instruction.  

2016-12-02 13:00:43 173

原创 Try It Out! Mix Them Up! Input & Output!

Try to make a script   To get full info   For a random Female (or Male) student.

2016-12-02 13:00:02 255

原创 How to Use Output-type Variable

--Create Procedure-- if object_id('outputtest') is not null drop proc outputtest Go  create proc outputtest --This is proc declare, NOT variable declare-- @

2016-12-02 12:59:25 225

原创 How to Use Input-type Variable

--Create Procedure--  if object_id('inputtest') is not null  drop proc inputtest  Go  create proc inputtest  --This is proc declare, NOT variable declare--

2016-12-02 12:58:26 173

原创 Interlude: Troubleshooting for 'no corresponding BEGIN TRANSACTION'

When you exec script like   begin tran exec tonytest rollback tran commit tran  You will see an error like   Msg 3902, Level 16, State 1, Li

2016-12-02 12:57:09 336

原创 How to Use Procedure

SQL give you the capability to define your own procedure, Here is an example.  create procedure Tonytest --after create this Procedure, you can use alter instead of create to

2016-12-02 12:55:30 166

原创 How to Use Cursor

Below link is a good source for learning cursors in sql http://www.cnblogs.com/moss_tan_jun/archive/2011/11/26/2263988.html   And I already made a little script for  example. T

2016-12-02 12:54:13 280

原创 Solution for Cut & Divide Text by ',' without Declare or Create Procedure

with Core as  (select co.course_number, (case  when termid=((substr('&param1',1,4))-'1990') *100 then substr('&param1',1,9) when termid=((substr('&param1',1,4))-'1990')

2016-12-02 12:53:33 203

原创 Solution for calculate & Output without Declare (Useful for SQL Developer)

select t0.family_ident,ss.student_number,ss.first_name,ss.last_name,ss.grade_level,to_char(ss.DISTRICTENTRYDATE,'MM/DD/YYYY'),to_char(ust.CUST_VISAEXPIRE,'MM/DD/YYYY'),to_char(ust.CUST_PASSPORTEXPIRE,

2016-12-02 12:51:28 160

原创 Interlude: Troubleshooting for 'Invalid object name'

When you login, and enter your first script,  you may see this: Msg 208, Level 16, State 1, Line 1 Invalid object name 'ONE'.  For some reason, database may not recognize

2016-12-02 12:47:49 213

原创 Tips: Create An Empty Table Has Same Columns with Existed Table

Sometime we need a new empty table has same columns with existed Table to store some components in, But re-design a new table is a demanding task, then try this out!  select * into

2016-12-02 12:46:23 180

原创 How to Create Tables

It's easy to create tables in sql server.   There are 2 ways to accomplish this task.   Right click Tables, in the menu, select Table. Design your table on

2016-12-02 12:45:37 192

原创 How to Setup A Database

When login, you will see this  Please leave it by default and click Connect.  Then you can see this window, then right click  Databases.  Give it

2016-12-02 12:44:29 264

原创 How to get SQL server 2016

https://www.microsoft.com/en-us/download/details.aspx?id=52679  It is easy to get SQL server 2016 on Baidu or Google, or click this link to download. To set up SQL server 201

2016-12-02 12:43:00 138

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除