Forum Replies Created

Viewing 15 posts - 2,941 through 2,955 (of 3,615 total)

  • RE: Triggers and ASP pages

    Does your ASP page use SQL Authentication or Windows Authentication?

    I've found that in some cases I have to fully qualify a stored procedure name with the database.owner.storedprocedure.

  • RE: ascribe dbo to login ( in place of sa)

    exec sp_addalias 'domain\username' , 'dbo'

    These days the correct method is to make your user a member of the db_owner role.

    The downside (and I use the term loosely) is that they...

  • RE: Triggers on system tables

    Yes it is possible, just don't do it.

    http://www.sqlservercentral.com/columnists/rmarda/letsblockthedba.asp

    Change you SA password and see who complains, then shoot them.

  • RE: Date & Time Field

    If you don't want to go down to the second you could try SMALLDATETIME which has half the storage requirements.

    The strange thing is that both types store two numbers, in...

  • RE: SQL Profiler

    Yes, it is an unusually poor effort from Microsoft.

    One particularly annoying function is that when you script a trace one of the first comments is that you cannot script to...

  • RE: Removing Control Characters

    I tried the following

    DECLARE @sText VARCHAR(250) ,

     @sRep VARCHAR(250)

    SELECT @sText = 'This is'+CHAR(10)+CHAR(13)+'is a'+CHAR(10)+CHAR(13)+'test' ,

     @sRep = REPLACE(@sText,CHAR(10)+CHAR(13),' ')

    PRINT @sText

    PRINT @sRep

    You've probably tried this already but try replacing just the CHAR(10) and...

  • RE: Removing Control Characters

    I've not had a problem with

    DECLARE @vbCRLF CHAR(2)

    SET @vbCRLF = CHAR(10) + CHAR(13)

    SELECT REPLACE(@myVarChar,@vbCRLF,' ')

  • RE: Conditional Date selection - Help needed

    A psychopath likes money, power and sex?  Presumably normal people are happy with two out of the three?

    Actually, the more I read the article the more it sounded like Tony...

  • RE: Conditional Date selection - Help needed

    One thing to watch out for is the default language under which your server is configured.

    If it is US_English then CAST('01/05/2004' AS SMALLDATETIME) will give 5th January 2004.

    To get around...

  • RE: How to get all records with a parameter value of zero

    If it is your application that is submitting the SQL then why not  have a simple If statement in your code so that when category is not zero then the...

  • RE: How to get all records with a parameter value of zero

    It won't work in Enterprise Manager but it will in SQL Query Analyser.

  • RE: How to get all records with a parameter value of zero

    If you are doing it within a stored procedure then it is easy, however if you want to  do it as a simple query then try

    SELECT *

    FROM dbo.Categories

    WHERE CategoryId =...

  • RE: Help - Counting problem using INNER JOIN

    SELECT SUM(CASE table1.ID1 WHEN NULL THEN 1 ELSE 0 END) AS counter, table2.ID2, table2.ID3 FROM

    table2 LEFT JOIN table1

    ON

    table2.ID2 = table1.ID2

    AND

    table2.ID3 = table1.ID3

    GROUP BY table2.ID2, table2.ID3

  • RE: Subquery returning > 1 value

    Is it possible that the subquery is doing a dirty read?

    There are no indices on SysProcesses and therefore there is nothing in particular to prevent there being multiple entires within...

  • RE: Cursor V/S query

    If you can do it using a single query then why bother with a cursor?

    SQL Server is optimised for set based operations.  I tend to view cursors as an option...

Viewing 15 posts - 2,941 through 2,955 (of 3,615 total)