Forum Replies Created

Viewing 15 posts - 166 through 180 (of 268 total)

  • RE: Forcing specific values for a field

    You could put a constraint on the field to limit what values are allowed.

    Jeremy

  • RE: Problem with the type datetime

    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...

  • RE: How to retrieve a result from a dynamic sql statem

    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...

  • RE: searching with like for ]

    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

  • RE: Urgent

    Rajesh,

    No problems - at least we came up with essentially the same answer. Great minds think alike or Fools seldom differ?

    Jeremy

  • RE: Urgent

    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...

  • RE: Urgent

    Within the stored procedure, you could use xp_cmdshell (with an appropriate parameter) to issue the mkdir command to create the new directory.

    Jeremy.

  • RE: datetime function

    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

    ...

  • RE: datetime function

    David,

    Your right - I hadn't spotted that. Converting everything to yyyy-mm-dd is best.

    Jeremy

  • RE: datetime function

    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...

  • RE: SQLSERV.EXE eating up all memory

    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...

  • RE: SQLSERV.EXE eating up all memory

    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...

  • RE: SQLSERV.EXE eating up all memory

    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...

  • RE: tempdb is not getting recreated

    Have you tried to shrink the database?

    Jeremy

  • RE: Error message from Job

    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...

Viewing 15 posts - 166 through 180 (of 268 total)