Solved

select into

Posted on 2006-10-27
3
272 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
  • 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…

828 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