Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
chbala85
Starting Member
49 Posts |
Posted - 2013-06-19 : 01:50:47
|
Hi ,DECLARE @CompanyNameTest AS VARCHAR(50)GoSET @CompanyNameTest = 'Exact help' The above script giving error .....please explain Go keyword ............ |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-19 : 01:56:41
|
GO keyword is a batch separator. SO usage in above case cause the batch to end. When you use variable again after it it becomes out of scope as variable has scope only inside batch it was created. Thats why you get the errorit should be thisDECLARE @CompanyNameTest AS VARCHAR(50)SET @CompanyNameTest = 'Exact help' ... other code using @CompanyNameTextGo ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|