Forum Replies Created

Viewing 15 posts - 391 through 405 (of 542 total)

  • RE: Error when using trigger

    Bart,

    you most likely have an implicit casting issue in your proc. 

    Using a linked server in a trigger, huh?  That seems like a bad idea performance-wise.

    cl

  • RE: SP or func to determine a suitable datatype

    Not that I know of, but you could probably make one. 

    Something like below should do the trick:

     

    select Value,

     Case

      When isnumeric(Value)= 0 and isdate(Value) = 0  then 'char(' + cast(len(Value)...

  • RE: Non Clustered Primary Key

    I would recommend making it clustered if sequential processing is important. As long as the first key in the clustered index is inserted in order you shouldn't have problems with...

  • RE: Query to get a list of parent records that have no child records

    If the relationship of Case to Action is "One to Many" (and I would assume it is) then using "Where Not Exists" with a "Top 1" may be more efficient then a left join:

    SELECT...

  • RE: Triggers

    This works Beautifully:

    DBCC INPUTBUFFER(@@spid)

    It will return the sproc name or the query string (if uncompiled)

  • RE: stored procedure creation error: already an object named xxx in the database

    I can almost guarantee that you have a non-sproc object that has the same name as your sproc.  You can check this by running:

    select  *

    from  sysobjects so (nolock)

    Where  so.name...

  • RE: String Aggregate Function

    Thomas,

    Your method works, but there's no need for a While loop. It works like this:

     
    
    declare @var varchar(8000)

    select @var = isnull(@var + ',', '')...
  • RE: String Aggregate Function

    Johnathan,

    Word...that's the ticket.

    rohitkgupta, Johnathan's method of creating csv's in the way to do it, no question (although a buddy of mine and I have argued about the use...

  • RE: using 'IN' keyword in cursor declaration

    ksrameshbabu,

    Since the variable @Temp contains multiple values you should put it in a temp TABLE variable. You can then join to it instead of using "Where in()". This...

  • RE: T-SQL newbie - syntax error

    Your missing a couple of ENDs as well:

     
    
    --Create Table
    if object_ID('tblTemp') is not null drop table tblTemp
    go
    CREATE TABLE tblTemp(
    chrDrvLetter CHAR(1),
    intDrvSpace INT
    )
    go
    --create Proc
    CREATE PROCEDURE usp_FreeDiskSpace

    AS

    BEGIN


    DECLARE
    @rcpt...
  • RE: Building SQL Server Central

    Good stuff, Steve; always like to hear about the "early" days. 🙂 Keep it up...

    PS: I like the email notification (link only is fine, as I always click...

  • RE: DTS - copy incremental data

    DTT with "Copy Column", to be specific....

  • RE: DTS - copy incremental data

    DON'T USE DDQ's...they are ridiculously slow.

    Use a Data Transformation Task with an "Execute SQL" (instead of a table or a file)source...that's the fastest by far.

    "Where not exists" works well, but...

  • RE: Help with Impoting Excel into SQL Server db

    quote:


    jxflagg- I thought about this option. But was wondering, with this approach, how to I dynamically pass the file name as...

  • RE: Duplicate Indexing Woes

    Correction to the script above:

     
    
    select
    seed.TableName
    ,si.[Name] as IndexName
    ,si.indid
    From
    (select si.[ID] as TableID, so.Name as TableName, si.Keys, count(*) as IndexCount
    Fromsysindexes si (nolock)
    JOIN sysobjects so (nolock) on...

Viewing 15 posts - 391 through 405 (of 542 total)