Viewing 14 posts - 121 through 134 (of 134 total)
for the number column col1 : ( result has length 14 )
select col1 = case when col1 < 0 then '-' else '' end + right(replicate('0',14) + convert(varchar(255),abs(col1)),14)
for the date column :
select col2...
March 17, 2004 at 12:08 am
Maybe you should verify sp_configure 'media retention'. You could add RETAINDAYS = 5 to make sure you can overwrite the file, or you could use the SKIP option ...
Important If...
March 10, 2004 at 1:44 am
You can copy/paste the following lines. Whiles explaining the query, I changed it a little bit. This new "explained" (?) query should do it :
/*
Shankar query :
I will try to...
March 9, 2004 at 7:27 am
Oops, you do not want the max(dte) fro the first month ? :
select dte from
(
select top 6 B.dte
from
(
select id='999999999',dte = min(dte) from...
March 8, 2004 at 2:40 pm
19 Mar 2004 is not in the input ... I supposed only records in the input table should come up ?
March 8, 2004 at 2:25 pm
the query I posted should do this, but will not work if the dates are not in the same year. This new query should do the job.
query :
select dte...
March 8, 2004 at 1:48 pm
As mentioned in the stored procedure, I did not understand the requirements for that part.
This query should do it :
select top 6 B.dte
from
(
select id=1,dte = min(dte) from dbo.tst
union all
select...
March 8, 2004 at 1:21 pm
This query should do exactly the same as my stored procedure :
select top 6 B.dte
from
(
select id=1,dte = min(dte) from dbo.tst
union all
select id=2,dte =...
March 8, 2004 at 1:00 pm
Just change the first 'order dte asc' to 'order by dte desc' :
create procedure dbo.Shankar as
begin
set nocount on
declare @result_table table
( dte datetime not null UNIQUE clustered )
declare @mindte datetime,
@maxdte datetime,
@curdte datetime,
@count...
March 8, 2004 at 10:21 am
What do you mean with 'i need to use SQL's only'. Do you want anly select statements ? I do not think it is possible to do this without some...
March 8, 2004 at 8:45 am
I would suggest to use a extra identity column to handle this. Here is the output of 2 possible solutions you can find in my test script :...
March 5, 2004 at 1:06 am
A new database is a copy of the model database.
So drop the stored procedures you do not need from model, and the newly created databases want have them.
March 5, 2004 at 12:38 am
select TABLE_NAME,COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where DATA_TYPE = 'datetime'
March 5, 2004 at 12:33 am
I even tried the statement
sp_tableoption Employee, 'text in row', 2000
on a test table, and this statement is also correct. I realy do not understand what 's wrong doing this in...
March 2, 2004 at 12:19 am
Viewing 14 posts - 121 through 134 (of 134 total)