• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

select into

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
homnath_sharma
Asked:
homnath_sharma
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
DECLARE @Pub CHAR(10);
SELECT @Pub = RowPub FROM DBO.XXX_SecurityRight WHERE RightID=0;
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
SELECT @Pub = RowPub FROM DBO.XXX_SecurityRight WHERE RightID=0;

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now