Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Ms access to sql server

Author  Topic 

Gopaldxb
Starting Member

1 Post

Posted - 2012-05-08 : 17:12:48
Which is the best converter tool to use to convert queries from Ms access to sql server ?

Here is my code and I want it to convert to sql server:



Select command = "Select c.album From [Album] c,[Artist1] cr Where(c.ArtistID = cr.ArtistID) AND(cr.Artist=?) Order By c.Album"

<Select Parameter>

<asp:Parameter Name =”?”/>

</Select Parameter>

It shows an error : Incorrect syntax near ?

Incorrect syntax near ?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-05-08 : 17:24:49
Your question is more of a programming question than a SQL Server one as that's not T-SQL code. Yes the part inside command is T-SQL, but ? is not T-SQL. You'll need to do a parameterized query here.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-05-10 : 08:54:36
In SQL Server you need to use a parameter in place ? and pass value to it

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -