Viewing 15 posts - 12,121 through 12,135 (of 13,460 total)
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...
Lowell
February 11, 2008 at 11:17 am
thekingironfist (2/11/2008)
Example:
I type:
2/11/2008 12:00:00...
Lowell
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...
Lowell
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...
Lowell
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...
Lowell
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...
Lowell
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...
Lowell
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
...
Lowell
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...
Lowell
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...
Lowell
February 5, 2008 at 7:38 am
search for "DBA Toolkit" hereon SSC:
http://www.sqlservercentral.com/articles/Security/sql2000dbatoolkitpart1/2361/
It's got encryption/decryption, regular expressions and more.
Lowell
January 31, 2008 at 5:42 pm
Interesting; I'd like to know how a PRINT statement affects the other procedures;I haven;t tripped over that yet, and do a lot of programming.
Can you explain what goes wrong?
Another idea:...
Lowell
January 31, 2008 at 10:55 am
I've got a collection of functions like that that strip out certain characters, html encode data, etc, all based on Jeff Moden's Tally Table concept.
Try this out for size: it's...
Lowell
January 31, 2008 at 8:49 am
don't forget the SQL DBA Toolkit here on SSC: it contains stored procedures to encrypt/decrypt data, as well as other goodies:
http://www.sqlservercentral.com/articles/Security/sql2000dbatoolkitpart1/2361/
Lowell
January 31, 2008 at 8:11 am
In SQL 2000, you can use a trick to order the contents of a view; In 2005, you cannot use the trick anymore, because logically, the select statement should contain...
Lowell
January 31, 2008 at 7:41 am
Viewing 15 posts - 12,121 through 12,135 (of 13,460 total)