Viewing 15 posts - 166 through 180 (of 268 total)
You could put a constraint on the field to limit what values are allowed.
Jeremy
April 30, 2003 at 6:59 am
SQL Server stores both dates and times in a single datetime datatype. It there is no time, SQL Server defaults to midnight (00:00:00). Similarly, if there is no...
April 30, 2003 at 6:38 am
I've solved this by creating a temporary stored procedure:
declare @sqlstring nvarchar(1000), @table varchar(25), @count int
set @table = 'table'
select @sqlstring = 'create procedure #count @count int output
as
select @count = count(*)
from...
April 30, 2003 at 3:35 am
One way would be to search for char(93) which is the ascii code for ].
You can use select ascii(']') to get the ascii value.
Jeremy
April 29, 2003 at 7:16 am
Rajesh,
No problems - at least we came up with essentially the same answer. Great minds think alike or Fools seldom differ?
Jeremy
April 29, 2003 at 6:30 am
declare @datevar varchar(10), @command_string varchar(255)
/* Get current date in yyyymmdd format*/
set @datevar = convert(varchar,getdate(),112)
set @command_string = 'mkdir D:\MSSQL\BACKUP\' + @datevar
/* Create directory */
exec master..xp_cmdshell @command_string
If you want the...
April 29, 2003 at 6:19 am
Within the stored procedure, you could use xp_cmdshell (with an appropriate parameter) to issue the mkdir command to create the new directory.
Jeremy.
April 29, 2003 at 5:32 am
Roland,
If you do this a lot, you might want to consider a user defined function:
/* Returns date only */
CREATE FUNCTION [dbo].[fn_DateOnly] (@date datetime)
RETURNS smalldatetime AS
BEGIN
...
April 29, 2003 at 2:50 am
David,
Your right - I hadn't spotted that. Converting everything to yyyy-mm-dd is best.
Jeremy
April 29, 2003 at 2:41 am
In your sql try this:
select convert(varchar,chargedate,101), sum(chargeAmount)
from charges
group by convert(varchar,chargedate,101)
order by convert(varchar,chargedate,101)
Converting the chargedate like this removes the time element and so the rows will be grouped and summarised by...
April 29, 2003 at 2:25 am
I have been having a similar problem and also getting 'insufficient system memory' errors.
I have found this on the MS website about memory leaks. It only applies to SQL...
April 29, 2003 at 1:50 am
I have been having a similar problem and also getting 'insufficient system memory' errors.
I have found this on the MS website about memory leaks. It only applies to SQL...
April 29, 2003 at 1:50 am
I have been having a similar problem and also getting 'insufficient system memory' errors.
I have found this on the MS website about memory leaks. It only applies to SQL...
April 29, 2003 at 1:49 am
Have you tried to shrink the database?
Jeremy
April 28, 2003 at 8:13 am
I've got the answer.
Apparently I had a corrput index on a table (found it using DBCC checkdb). Recreated the index and it now works fine.
Strange error message for a...
April 28, 2003 at 8:10 am
Viewing 15 posts - 166 through 180 (of 268 total)