Solved

select into

Posted on 2006-10-27
3
273 Views
Last Modified: 2008-02-01
Hi,

I used below stmt, its giving error. Could any one let me know.

DECLARE @Pub CHAR(10);
SELECT RowPub into @Pub FROM DBO.XXX_SecurityRight WHERE RightID=0;

Whats wrong in the above stmt. I am using above line of code inside my After insert trigger.

Error is as:

Msg 170, Level 15, State 1, Server SYS_034, Procedure TI_SecurityRight, Line 14
Line 14: Incorrect syntax near '@Pub'.

Regds.
~ HNS ~
0
Comment
Question by:homnath_sharma
[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
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 17818193
DECLARE @Pub CHAR(10);
SELECT @Pub = RowPub FROM DBO.XXX_SecurityRight WHERE RightID=0;
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17818195
SELECT @Pub = RowPub FROM DBO.XXX_SecurityRight WHERE RightID=0;

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17818196
the syntax SELECT INTO like you tried to use is Oracle Syntax, but you seem to be using SQL Server, looking at the error message.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

749 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