C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...









Uses of GO in SQL


Posted Date: 03 Jul 2008    Resource Type: Code Snippets    Category: SQL

Posted By: M. Irfan       Member Level: Gold
Rating:     Points: 4



This code sample shows the purpose of using GO statement in SQL:

DECLARE @Test1 int, @Test2 VARCHAR(20)

SET @Test1 = 1;

SET @Test2 = 'Character';

SELECT @Test1,@Test2

GO

SELECT @Test1,@Test2



- Either it through an error

- Or Give 1 Character twice.


Yes – It will throw error as @Test1 is undefined, because after GO it ends the scope of declaration of the variable.

Here we seen the scope of Variable declaring into SQL.

For more details, visit http://matespoint.blogspot.com/2008/02/uses-of-go-in-sql.html




Responses

Author: Pravin    07 Jul 2008Member Level: Bronze   Points : 0
Go is use to Deciede the scope of variable.


Author: M. Irfan    07 Jul 2008Member Level: Gold   Points : 1
Yes ofcourse it is used to define the scope of vatiable. And the same is shown with the example.

Thanks for your response.



Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: IF Exist vs Count
Previous Resource: Characters Count Function Without Looping
Return to Discussion Resource Index
Post New Resource
Category: SQL


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use