Solved

SQL statement completion

Posted on 2007-03-21
2
263 Views
Last Modified: 2010-03-19
I have an SQL statement and am unsure how to declare two variables:

select @sitecode = ThisSiteCode, @siteid='ScopeId_'+substring(ThisSiteGuid, 2, 36) from SMSData

Can you give me a hand with how to declare @sitecode and @siteid?

Thanks!
JD
0
Comment
Question by:johndarby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 18766257
for example, like this:

declare @sitecode int
declare @siteid varchar(200)
select @sitecode = ThisSiteCode, @siteid='ScopeId_'+substring(ThisSiteGuid, 2, 36) from SMSData

note however, that only values of 1 row will be stored in the variables.
if you want more rows to be handled, you will need a different solution.

please explain in more details what you are trying to acheive
0
 
LVL 1

Author Comment

by:johndarby
ID: 18766324
That does it! Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question