Solved

select into

Posted on 2006-10-27
3
270 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 142

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 142

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Space Delimited Sql File 4 82
Client backup and data retention? 3 55
Quick and High level SQL Server 2012 Performance check 8 51
Cassandra Select Query 1 56
This article describes some very basic things about SQL Server filegroups.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

895 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

15 Experts available now in Live!

Get 1:1 Help Now