Solved

Using sql variable in Trigger

Posted on 2011-03-07
1
219 Views
Last Modified: 2012-05-11
Hi all
I have a trigger , which should read values from a table and call a storeprocedure,,

What is the best way to store these variable retrive from a table.

E.g
SELECT LastName,Firstname
INTO @Lastname, @Firstname
FROM Persons
WHERE City='Sandnes'

execute sp_myPersons @Lastname, @FirstName

Thanks in advance
0
Comment
Question by:ZURINET
1 Comment
 
LVL 15

Accepted Solution

by:
derekkromm earned 500 total points
ID: 35056679
declare @lastname varchar(100), @firstname varchar(100)
select @lastname = lastname, @firstname = firstname
from persons
where city='sandnes'

exec sp_myPersons @Lastname, @FirstName
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now