Showing posts with label force. Show all posts
Showing posts with label force. Show all posts

Monday, March 12, 2012

How do I get decimal set to 2 in a column?

I am getting frustrated that I can't force a column to display .50 or .00
thus allowing numbers (double) to line up properly? now I have units in the
column NEXT to this one so I don't want to apply formatting to all columns
:)
This is a C# form based report if that means anything different in the
answer.
Thanks.Select the textbox that you want to format, right click, go to properties,
select custom format and type N2
"SRussell" wrote:
> I am getting frustrated that I can't force a column to display .50 or .00
> thus allowing numbers (double) to line up properly? now I have units in the
> column NEXT to this one so I don't want to apply formatting to all columns
> :)
> This is a C# form based report if that means anything different in the
> answer.
> Thanks.
>
>|||"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:922D10BD-EE7E-40BD-93FA-7274C71700AE@.microsoft.com...
> Select the textbox that you want to format, right click, go to properties,
> select custom format and type N2
Thanks!

How do I force upper case in a select statement

I want all of the columns in a select statement to be converted to upper
case. What is the proper syntax for that?SELECT UPPER(col1), UPPER(col2), UPPER(col3), ...
FROM dbo.YourTable;
"Thirsty Traveler" <nfr@.nospam.com> wrote in message
news:ubO0jhqeGHA.3692@.TK2MSFTNGP03.phx.gbl...
>I want all of the columns in a select statement to be converted to upper
>case. What is the proper syntax for that?
>

How do I force new databases to be created on another drive on same server?

I successfuly installed SQL Server 2005 Enterprise Edition today (on the first shot!) but can't figure out how to force new databases, etc to be created on another drive on the server. SQL installed on the c: drive (I had no choice!) but it is a very small partition. I need to install Sharepoint Portal 2003 next (on a different server) and want to make sure everything goes on the other drive.

Help me, please!!

Thanks :-)

As far as I can remember Sharepoint let you choose the destination of the data files. Anyway the default data directory can be changed in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||Thanks, I'll give it a try.|||

I just tried it and it is still creating new databases on c: drive. We had to slick the server for another reason, so I have a fresh install and told it to install to d:\Program Files\.... during installation and the registry entry did not change; it still pointed to c: drive. I created a d:\Program Files\Microsoft SQL Server\Data directory and changed the registry and no joy. Even restarted the server a few times and it didn't matter.

Shouldn't there be a way to change this default in the Server Management Studio?!?

If any can help me, it would be appreciated! This problem is holding up installation of a few more apps.

Thanks!!

|||Sorry for that I copied the wrong key :-(

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=407351&SiteID=1

HTH, jens Suessmeyer.

http://www.sqlserver2005.de
|||

Hi,

Thanks. I actually found out where to do it in the SQL Server Management Studio!

SERVER--PROPERTIES--DATABASE SETTINGS

The path for databases and logs are blank. After I selected my folders on the D: drive I created a new db and it went to the correct path! Whew. Glad that's over with :-)

how do I force connections to close before detaching a DB

Hi,
I need to detach a DB, but need to force any current connections to be
disconnected as I am getting an error saying that I cannot detach the DB as
it is being used.
What is the best way of doing this?
I am using DMO to detach at the moment.
ThanksALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
(Why are you detaching the database? Why are you detaching a database that
is in use?)
"Jason Fischer" <jason.fischer@.micropay.com.au> wrote in message
news:OTM174ZkFHA.1948@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I need to detach a DB, but need to force any current connections to be
> disconnected as I am getting an error saying that I cannot detach the DB
> as it is being used.
> What is the best way of doing this?
> I am using DMO to detach at the moment.
> Thanks
>

How do I force a job to fail ?

Hi
I think this is quite simple, but how do I force a job to fail using a TSQL
command?
I have a job that copies a backup to another server and then it starts
another job that restore the backup. What I'd like to do, is to put a step
in the first job, that e.g. runs RESTORE HEADERONLY FROM DISK=...... and if
this doesn't return the correct value the job should quit with a failure.
Regards
SteenDo a RAISERROR with severity > 10.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Steen Persson (DK)" <spe@.REMOVEdatea.dk> wrote in message
news:uVV$UWxnFHA.3256@.tk2msftngp13.phx.gbl...
> Hi
> I think this is quite simple, but how do I force a job to fail using a TSQ
L command?
> I have a job that copies a backup to another server and then it starts ano
ther job that restore
> the backup. What I'd like to do, is to put a step in the first job, that e
.g. runs RESTORE
> HEADERONLY FROM DISK=...... and if this doesn't return the correct value
the job should quit with
> a failure.
> Regards
> Steen
>|||why dont you use continue, break in procedure that is getting executed
instead of stopping job on condition.
"Steen Persson (DK)" wrote:

> Hi
> I think this is quite simple, but how do I force a job to fail using a TSQ
L
> command?
> I have a job that copies a backup to another server and then it starts
> another job that restore the backup. What I'd like to do, is to put a step
> in the first job, that e.g. runs RESTORE HEADERONLY FROM DISK=...... and
if
> this doesn't return the correct value the job should quit with a failure.
> Regards
> Steen
>
>|||R.D wrote:
> why dont you use continue, break in procedure that is getting
> executed instead of stopping job on condition.
>
well...good question. It was just the first idea that came to my mind. If I
"force" the job to fail, I'd get a notification just like if the job was
failing in the "normal" way, so I saw it as the easiest way of doing it.
My next issue (which I thought I knew how to do...) is how I fetch the
result set I get from running "RESTORE HEADERONLY..." so I can evaluate on
e.g. the BackupName field?
Regards
Steen|||> My next issue (which I thought I knew how to do...) is how I fetch the result set I get f
rom
> running "RESTORE HEADERONLY..." so I can evaluate on e.g. the BackupName field?[/
color]
CREATE TABLE r (...)
INSERT INTO r(...)
EXEC('RESTORE HEADERONLY ...')
You can find the structure of the table you need to create, and the overall
technique at
http://www.karaszi.com/SQLServer/ut...ll_in_file.asp.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Steen Persson (DK)" <spe@.REMOVEdatea.dk> wrote in message
news:%23ky1olxnFHA.3316@.tk2msftngp13.phx.gbl...
> R.D wrote:
> well...good question. It was just the first idea that came to my mind. If
I "force" the job to
> fail, I'd get a notification just like if the job was failing in the "norm
al" way, so I saw it as
> the easiest way of doing it.
> My next issue (which I thought I knew how to do...) is how I fetch the res
ult set I get from
> running "RESTORE HEADERONLY..." so I can evaluate on e.g. the BackupName
field?
> Regards
> Steen
>