Showing posts with label quot. Show all posts
Showing posts with label quot. Show all posts

Wednesday, March 7, 2012

how can i use the " use " statement with database-name contains spaces in sql2000

example :

i cann't write :

use [my db]

what can i do with this problem ?

That works for me:

use [master]

CREATE DATABASE [Some DB]

USE [Some DB]

SELECT DB_NAME()

-

Some DB

(1 row(s) affected)

USE MASTER

DROP DATABASE [Some DB]

What error are you getting back ? Regardless of the possibiliy to put a space in the name, this is NOT recommended. It might work in the most cases but you will run in many cases where this isn′t supported (liek third party vendors)

HTH, Jens Suessmeyer.

Friday, February 24, 2012

how can i use comma like a decimal separator?

"update product set price='1,99' where cod='001'"

I need COMMA... not DOT

In oracle i use "alter session set language='Brazil'"... but... in SQL SERVER?

i need help...

You would have to change your Windows collation. That is where the translation is occuring.

how can i use comma like a decimal separator?

"update product set price='1,99' where cod='001'"

I need COMMA... not DOT

In oracle i use "alter session set language='Brazil'"... but... in SQL SERVER?

i need help...

hi,

SQL Server just uses "dot" as decimal separator... you have to replace your strings removing the thousands separator, if present, and modify the decimal separator as indicated..

or just use a Command object instead of dynamic SQL, so that the command parameter's value(s) will be set accordingly to your locale settings and you do not have to deal with that kind of troubles... more, you completely bypass lots of SQL injection troubles as, for instance, a datetime parameter can not accept something like

param.Value = '20060101'''; DELETE FROM other_table'

or the like... and you can better check each parameter for validity..

regards

How can i use comma like a decimal separator?

"update product set price='1,99' where cod='001'"

I need COMMA... not DOT

In oracle i use "alter session set language='Brazil'"... but... in SQL SERVER?

You're in the wrong place. Go here: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=93&SiteID=1

-Jamie