July 1, 2002 at 2:58 am
I have run into a problem after upgrading SQL Server 7.0 SP3 to SQL Server 2000 SP2.
I had a piece of working code in SQL 7 that was basically a snipit of the xp_logininfo stored procedure within the MASTER database.
Insert MyTable(MyColumn)
selectdomain+N'\'+name
from OpenRowset(NetGroupGetMembers, @acctname)
If I try and run this in SQL2000 I get an error message
Server: Msg 156, Level 15, State 17, Line 4
Incorrect syntax near the keyword 'OPENROWSET'.
I have tried copying the entire xp_logininfo code and pasting it into a new stored procedure in my user database and get exactly the same error message.
Has anyone got any ideas why and how I can correct it?
July 2, 2002 at 4:36 am
Hi,
from bol: OPENROWSET does not accept variables for its arguments.
In the xp_logininfo in sql 2000 they used an other solution.
July 2, 2002 at 4:53 am
Thanks, but my SQL2K box uses OPENROWSET with parameters and it works.
My extracted code will not work even if I hard code the values of the parameters.
I've had to get around the problem by using
INSERT #TempTable
exec master.dbo.xp_logininfo @sNTGroup , 'members'
I would have used a udf but for backwards compatibility I have to use the old fashioned method.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply