Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - SQL
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SQL

 Post Reply Post Reply
Author
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Topic: SQL
    Posted: 07 June 2003 at 12:46pm

What changes do I need to make to my scripts SQL querys to make them compatible with SQL server?

any URL's, handy tips greatly appreciated!

many thanks

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2003 at 4:27pm

No changes needed, the same queries you use for access will work fine on ms sql but to get better performace and security you should use stored procedures

 

 



Edited by fernan82
FeRnAN
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2003 at 4:48pm

ok thanks! they seem pretty cool

ok 1 more thing, when I put a url in a text field, any characters not used up have space bars after them, if you know what i mean, so when I pull out the url to redirect to it has loads of %20 after it preventing it from redirecting! anyone know why?

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2003 at 10:15am
The problems is that either you datatype is a fixed character firld type or was at one time. For example if you field is char or nchar  (50)  the entries are always 50 characters long. if it is e.g. varchar(50) it can be up to 50 but does not add spaces if it is shorter.
If you imported the data or changed the fieldtype from char to varchar at one point it keeps the spaces as SQL sees them as data. So if you you change you fieldtype to a variable type like varchar you can use a simple query to get rid of the spaces in your field.
Update tablename Set field = RTrim(field)
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2003 at 1:34pm
Thank you very much!  One more question, I had a field in the old access database which took binary data for users to upload images, in access its datatype was OLE Object, whats the equivalent in SQL?  Many thanks
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2003 at 6:32pm
SQL Server has a Datatype called image which you could use to store I believe up to 2GB of data per field. Thus you might want to consider storing the file somewhere and just point to it from the db
Back to Top
ctscott View Drop Down
Senior Member
Senior Member


Joined: 27 May 2003
Location: United States
Status: Offline
Points: 246
Post Options Post Options   Thanks (0) Thanks(0)   Quote ctscott Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2003 at 6:44am

Originally posted by michael michael wrote:

The problems is that either you datatype is a fixed character firld type or was at one time. For example if you field is char or nchar  (50)  the entries are always 50 characters long. if it is e.g. varchar(50) it can be up to 50 but does not add spaces if it is shorter.
If you imported the data or changed the fieldtype from char to varchar at one point it keeps the spaces as SQL sees them as data. So if you you change you fieldtype to a variable type like varchar you can use a simple query to get rid of the spaces in your field.
Update tablename Set field = RTrim(field)

Thank you michael. that's exactly what i was wanting to know.

______________________
College Football Trivia
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2003 at 7:52am
The biggest differences between SQL and Access are:
1) date format and the date function. SQL surrounds dates with single quotes not #
2) stored procedures
3) the ability to return multiple recordsets with one call to the database.

#1 is important.
#2 can improve the efficiency of your application
#3 will improve the efficiency of your application
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.