Viewing 15 posts - 12,121 through 12,135 (of 13,465 total)
yeah that binary AND-ING of a value isn't obvious;
basically, a binary array of zeros and ones, representing like 2^16 or something is used in status to keep track of on...
February 13, 2008 at 12:13 pm
I have this laying around from a post i replied to previously: it does all the databases in one shot on a server, instead of calling sp_dboption repeatedly:
select name as...
February 13, 2008 at 11:38 am
I agree, it's a poor idea. It sounds more like the DBA gets confused with seeing thousands of tables, and to make it more "bitesize" he wants to move...
February 13, 2008 at 5:23 am
the Command SET XACT_ABORT ON makes error handling superfoulous.
This command rolls back the transaction, AND DISCONTINUES FURTHER PROCESSING, if any error is encountered....
so if any error is encountere,d it would...
February 12, 2008 at 9:25 pm
I do something kind of similar using the SPACE function to reserve a certain amount of space in a string; I used a default of 20 in this example, but...
February 12, 2008 at 10:03 am
much easier to do that from an application.
from sql server 2000, it's difficult to do in TSQL because you must use an object with sp_oacreate to get the text of...
February 11, 2008 at 11:17 am
thekingironfist (2/11/2008)
Example:
I type:
2/11/2008 12:00:00...
February 11, 2008 at 10:56 am
the freespace will just get larger as you cleanup your data, until you shrink the database...when you shrink the database, only then will the actual amount used get smaller. until...
February 11, 2008 at 10:50 am
Tim ffitch (2/11/2008)
We have a Select statement in a stored procedure that uses the IN Operator.
When we use the following style it works:
WHERE IN ('Value1', 'Value2', 'Value3')
However we have a...
February 11, 2008 at 10:15 am
there's so many variables, it's hard to give a good answer without reviewing the code;
In general, here's something to look at:
A lot of times, dynamic sql is used in order...
February 9, 2008 at 9:35 pm
if the database is version 80, the script is not valid for the part i highlighted below...that part is 2005 /90 database only:
CREATE TABLE [dbo].[Primes](
[Prime] [int] NOT NULL,
CONSTRAINT [PK_Prime] PRIMARY...
February 5, 2008 at 9:56 am
you need to post more specific details. the code i posted will do what you asked; so you are most likely not converting the final answer.
here's a more detailed example:
declare...
February 5, 2008 at 9:53 am
Mike Levan (2/5/2008)
when am doing thissum(convert(decimal(8,1),t.duration)/360000) as Duration
am getting
51.00000000
12.40000000
30.80000000
15.00000000
48.10000000
1.60000000
but i need only 1 decimal point
you divided the converted value by 360000.
you want the final result to be a decimal.
try
...
February 5, 2008 at 8:15 am
COALESCE would help you in this case...it's really just a CASE WHEN construct:
SELECT COALESCE(HOMEPHONE,CELLPHONE,EMERGENCYPHONE,'911')
FROM SOMETABLE.
it returns the first non-null item...so if homephone is null, it returns the cellphone, but...
February 5, 2008 at 7:47 am
you need to cast or convert the value that's in the field as a decimal.
declaration is size,number of decimals:
so SELECT CONVERT(DECIMAL(8,1),YOURCOLUMN FROM YOURTABLE wouold do what you ask.
example:
SELECT CONVERT(DECIMAL(8,1),23.00001)
,CONVERT(DECIMAL(8,1),12.9)
, CONVERT(DECIMAL(8,1),16)
,CONVERT(DECIMAL(8,1),14.567)
Results:
(No...
February 5, 2008 at 7:38 am
Viewing 15 posts - 12,121 through 12,135 (of 13,465 total)