Viewing 15 posts - 11,986 through 12,000 (of 13,469 total)
it's pretty simple...you'd use a BETWEEN statemnt for 2004 AND YEAR(GETDATE())...but you need to select it from a table, right?
once again, Jeff Moden's Tally Table would be the ideal tool...
October 17, 2008 at 6:43 am
your going to be mad at yourself...you did everything except CAST/CONVERT your answer to the desired decimal:
create table test(
Price decimal(5,2),
QuotedCost decimal(5,2),
OrigCalc AS ([Price]-[QuotedCost])/[Price] *(100)...
October 17, 2008 at 6:18 am
duplicate thread;
follow the answered thread here:
http://www.sqlservercentral.com/Forums/Topic587537-359-1.aspx
October 17, 2008 at 6:09 am
you've show us just part of your stored procedure, it looks like...the line you posted wil certainly only display a single column, "Records", so there must be a line in...
October 17, 2008 at 6:05 am
this sounds very much like a homework assignment....
aside from that...
you want to do a few things....
you said only three specific values.... as you suspected, read about CHECK CONTRAINTS in you...
October 17, 2008 at 5:56 am
try something like this:
select gpsdata_history.*
from gpsdata_history
inner join
(SELECT
REGISTRATIONNO, MAX(GPS_DATETIME)
FROM ...
October 17, 2008 at 5:50 am
here's how i would do it:
first id read everything into a single string, instead of line by line.
then i could use substring functions to find what we need instead.
...
October 17, 2008 at 5:24 am
there is a free open source project that is a 2005 profiler, independant of MS;
I use it all the time and it is very good.: very small footprint and you...
October 17, 2008 at 5:00 am
i have this code saved in my snippets hat might help you; it featues two of the things you might want: BCP of data, and appending multiple files together.
the original...
October 15, 2008 at 11:56 am
i've pasted a script below that shows how to get the listening port by reading the registry, and as the previous poster said, you could write to that spot as...
October 15, 2008 at 11:04 am
something like htis might help:
it detects the compatibility level...
IF EXISTS(SELECT cmptlevel from master.dbo.sysdatabases WHERE master.dbo.sysdatabases.name =db_name() AND cmptlevel...
October 14, 2008 at 10:09 am
a backup created on 2008 can only be restored on a 2008 instance; theactual format of the file is different due to the new features.
this is true of all backups...while...
October 12, 2008 at 7:38 am
compatibility level sets what set of syntax rules will be used for commands agains the database; it does not change "how" the data is stored or backed up. think about...
October 11, 2008 at 4:40 pm
abstract examples are harder to help wiht, but here's an example:
--does this return data?
SELECT
OtherDatabaseT2.RowID,
OtherDatabaseT2.StaffID,
OtherDatabaseT3.SSo_RowID,
OtherDatabaseT3.LogonStaffNo
FROM Otherdatabase.dbo.[Table 2] OtherDatabaseT2
INNER JOIN Otherdatabase.dbo.[Table 3] OtherDatabaseT3
...
October 10, 2008 at 11:13 am
i've got this saved in my snippets of code; i added the bolded where statement to ignore clustered indexes:
[font="Courier New"]
SELECT TOP 100
REPLICATE(' ',4000) AS COLNAMES ,
OBJECT_NAME(I.ID) AS TABLENAME,
I.ID AS TABLEID,
I.INDID...
October 10, 2008 at 9:04 am
Viewing 15 posts - 11,986 through 12,000 (of 13,469 total)