# ms sql syntax

**URL:** <https://forum.servoy.com/t/ms-sql-syntax/11926>\
**Category:** Classic Servoy\
**Created:** [March 18, 2010, 6:35pm UTC](https://forum.servoy.com/t/ms-sql-syntax/11926 "2010-03-18T18:35:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lesouef](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@lesouef](https://forum.servoy.com/u/lesouef)\
**Post date:** [March 18, 2010, 6:35pm UTC](https://forum.servoy.com/t/ms-sql-syntax/11926/1 "2010-03-18T18:35:03Z")

</div>

tried to use a mssql db for the 1st time:  
the default url syntax proposed by servoy 5.1 is:  
jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=\<database\_name\>;SelectMethod=cursor  
and should be:  
jdbc:sqlserver://localhost:1433;DatabaseName=\<database\_name\>;SelectMethod=cursor  
the driver path is:  
com.microsoft.jdbc.sqlserver.SQLServerDriver  
and should be:  
com.microsoft.sqlserver.jdbc.SQLServerDriver

also note that the driver to be used for sql2005 and sql2008 is sqljdbc4.jar only.

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [March 19, 2010, 9:15am UTC](https://forum.servoy.com/t/ms-sql-syntax/11926/2 "2010-03-19T09:15:47Z")

</div>

lesouef,

This link seems to describe the values we show as default, they don’t work with you sqlserver version?

[http://support.microsoft.com/default.as … -us;313100](http://support.microsoft.com/default.aspx?scid=kb;en-us;313100)

Rob

---

<div class="post-metadata">

**Author:** ![lesouef](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@lesouef](https://forum.servoy.com/u/lesouef)\
**Post date:** [March 19, 2010, 9:25am UTC](https://forum.servoy.com/t/ms-sql-syntax/11926/3 "2010-03-19T09:25:22Z")

</div>

this is for sql2000, I am using 2005 or 2008.

---

<div class="post-metadata">

**Author:** ![Foobrother](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Foobrother](https://forum.servoy.com/u/Foobrother)\
**Post date:** [March 19, 2010, 9:26am UTC](https://forum.servoy.com/t/ms-sql-syntax/11926/4 "2010-03-19T09:26:15Z")

</div>

> lesouef:  
> tried to use a mssql db for the 1st time:  
> the default url syntax proposed by servoy 5.1 is:  
> jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=\<database\_name\>;SelectMethod=cursor  
> and should be:  
> jdbc:sqlserver://localhost:1433;DatabaseName=\<database\_name\>;SelectMethod=cursor  
> the driver path is:  
> com.microsoft.jdbc.sqlserver.SQLServerDriver  
> and should be:  
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> 
> also note that the driver to be used for sql2005 and sql2008 is sqljdbc4.jar only.

+1

It is exactly what we use with MS SQL 2008

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [March 19, 2010, 9:39am UTC](https://forum.servoy.com/t/ms-sql-syntax/11926/5 "2010-03-19T09:39:54Z")

</div>

Will update the defaults,

Thanks,

Rob

---

<div class="post-metadata">

**Author:** ![lesouef](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@lesouef](https://forum.servoy.com/u/lesouef)\
**Post date:** [March 19, 2010, 9:54am UTC](https://forum.servoy.com/t/ms-sql-syntax/11926/6 "2010-03-19T09:54:08Z")

</div>

may be you should distinguish versions as I assume sql2000 is still widely used.  
I have none here so can’t check the right syntax for it.

---

<div class="post-metadata">

**Author:** ![Foobrother](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Foobrother](https://forum.servoy.com/u/Foobrother)\
**Post date:** [March 19, 2010, 11:10am UTC](https://forum.servoy.com/t/ms-sql-syntax/11926/7 "2010-03-19T11:10:13Z")

</div>

> lesouef:  
> may be you should distinguish versions as I assume sql2000 is still widely used.  
> I have none here so can’t check the right syntax for it.

You don’t need to, the new driver with the new syntax works for all MS SQL versions: 2000, 2005 and 2008 ![:mrgreen:]( "Mr. Green")

---

<div class="post-metadata">

**Author:** ![lesouef](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@lesouef](https://forum.servoy.com/u/lesouef)\
**Post date:** [March 31, 2010, 6:58am UTC](https://forum.servoy.com/t/ms-sql-syntax/11926/8 "2010-03-31T06:58:00Z")

</div>

add-on for domain accounts usage to jdbc mount MS SQL dbs:  
instead of specifying a user/passwd, leave it empty and add to the URL:  
;integratedSecurity=true  
url becomes: jdbc:sqlserver://ip:1433;DatabaseName=xxxxxxxxxx;SelectMethod=cursor;integratedSecurity=true  
if this does not work, there is an extra sqljdbc\_auth.dll to be installed in the system32 folder (in the windows path in fact), but for some reason I did not need that. this dll is in the microsoft package in “…\Microsoft SQL Server JDBC Driver 3.0\sqljdbc\_3.0\enu\auth\x86\sqljdbc\_auth.dll”  
also, I have not tested this on a server where servoy is a service: it probably requires to start the servoy service with a specific account. in theory it should work, but not done this yet. If someone does that before me, please complete the information here.

---

<div class="post-metadata">

**Author:** ![lesouef](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@lesouef](https://forum.servoy.com/u/lesouef)\
**Post date:** [March 31, 2010, 7:41am UTC](https://forum.servoy.com/t/ms-sql-syntax/11926/9 "2010-03-31T07:41:25Z")

</div>

correction: the sqljdbc\_auth.dll is required.  
the confusion comes from the fact that vista allows to move a dll around on the fly as long as you don’t delete it.  
so only the service mode is to be tested with this.
