Can anyone tell me whats wrong with my script?

sql server 2005

Error: Incorrect syntax near ')'.

I have a feeling there is more wrong than that.

SELECT a.*
FROM OPENROWSET('Data Source=10.10.1.31;Initial Catalog=RFDG;User Id=admin;Password=342ds2sa12e;',
   'SELECT * FROM location') AS a

Edit your post and remove IP Address and administrators password ASAP. Next time don't include them in any post or your problem might not matter (after a malicious attack).

PS: Specify a provider on your openrowset. Read here for info: http://msdn.microsoft.com/en-us/library/ms190312.aspx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.