Forum Replies Created

Viewing 15 posts - 61 through 75 (of 134 total)

  • RE: Frustrations with Auto-creating Linked Servers

    Hi,

    You can only use a fixed string value for the OPenRowset. But you can use the sp_addlinkedserver like this :

     

    Declare @ServerName VarChar(100)

    Declare @Proc VarChar(200)

    Set @ServerName = 'quix'

    Set @Proc = @ServerName...

  • RE: Query Help

     

    SELECT     [Customer Change No], [PIA Material No], 

    isnull([Adj Due Date], [Due date]) AS Expr1

    FROM         dbo.[tblPPAP Notification Detail]

     

    Bert

  • RE: Comparison Operator With Local Variable

    You can also do this using like :

    DECLARE @Parm varchar(100)

    SET @Parm = 'VINET, TOMSP , VICTE'    -- (comma separated list as user would input)

    -- Below I've tried to massage the...

  • RE: Datatype question. Need to exceed varchar(8000) in stored proc.

    Hi,

    You could try using a temporary table to build the text. You could try something like this :

    declare @message varchar(8000)

    declare @txtptr varbinary(16)

    declare @i int set @i = 1

    -- create the...

  • RE: Calculating Work Days

    Hi,

    Good function. And surely, a very clear documentation. Just 1 (little) thing. As my server is case sensitive, I had to change USE MASTER into USE master, and XType into...

  • RE: SQL Bug? Or do I not understand unions

    I do not know exactly what is wrong, but I would suggest to verify :

    1. for the inner joins, try to use an other alias, as alias c is also...

  • RE: Question of the Day for 22 Oct 2004

    I tried it in QA, and had an error for the first query :

    Server: Msg 170, Level 15, State 1, Line 4

    Line 4: Incorrect syntax near 'NULL'.

     

    SO answer 1 is...

  • RE: copy column names in result set

    Just set the result to "Text, tab delimited". You can get tab-delimited by Tools->Options and set it in the results tab. After this, (re-)reun your query, open excel, copy the...

  • RE: Insert/Update Trigger to replace column value

    I would create a stored procedure that generates the triggers for me. ( as you have a lot of tables ) I do not know the kind of data that...

  • RE: need help with T-SQL Syntax

    #temp_table will not work, as the table will be disappeared after the exec. a ##temp_table will work, but you have to use transactions, as the ##temp_table can be used by...

  • RE: need help with T-SQL Syntax

    If performance is not an issue, you can do this like :

    select field2 from table1 where ','+@parameter+',' like  '%,' + field1 + ',%'

    If field1 is not a character type,...

  • RE: Find datediff in the same field

    Michael had a good point. But you can do it without a while loop. Using a temp table is fine, but can give you some performance problems when dealing with...

  • RE: Find datediff in the same field

    I found 2 solutions. The first select will not give you the row with the null value, but should perform better, the second gives you the result you want :

    use...

  • RE: Cursor order by Problem

    The default is not read-only. In Bol, you will find for the read-only option :

    "READ ONLY

    Prevents updates made through this cursor. The cursor cannot be referenced in a WHERE...

  • RE: Cursor order by Problem

    Can you tell us what type of cursor you use ? global/local, read-only, .... I suppose a cursor that is NOT read-only has more performance problems with an order-by then...

Viewing 15 posts - 61 through 75 (of 134 total)