Forum Replies Created

Viewing 15 posts - 58,921 through 58,935 (of 59,038 total)

  • RE: Generate SQL Script

    There's a nasty VB program at C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Samples\sqldmo\vb\SQLScripts on the server.  If you can't get to that, there's an .EXE called "scptxfr.exe"...

  • RE: Rows 1 to 20, 21 to 40 etc.

    Stefan,

    This is similar to the procedure that I use although my inputs are a little different (easy for you to modify, if you want).  Instead of inputing a row number,...

  • RE: Problem with adding a month to February 28

    Carl, these are similar to some of the others but thought I'd post it anyway

    ------ Finds the LAST day of NEXT month (Time=23:59:59.997) (resolution is 3 ms)

    SELECT DATEADD(ms,-3,DATEADD(mm,DATEDIFF(mm,0,@Date)+2,0))

       ...

  • RE: Batching and index question

    Just curious... are any of the joined "tables" really views?  That's what happened to me at work... just did a SELECT * to see what I got back from a...

  • RE: Max string length for exec command

    NVarchar uses two bytes per character.  There is no reason to use it unless there is something "language specific" or the system requires it.

  • RE: Max string length for exec command

    Using EXEC (@SQL1+@SQL2...@SQL4), have been able to do up to 32k.  Target of exec has to be in ( ).  Didn't try it but was once told the limit was...

  • RE: Assigning Permissions

    You can also create roles and assign individuals to roles.  That way, if you need to change the permissions for a whole group of people, you just change the permissions...

  • RE: Assigning Permissions

    The systax of the GRANT command should be as follows:

    GRANT permissiontype ON sqlobject TO grouporrole

    See "Books on Line" under "GRANT, GRANT (described)" for a complete list...

  • RE: Problem with between

    CASE

      WHEN ABS(DATEDIFF(ss, x, y)  ) <= 3

      THEN 'Y'
      ELSE 'N'
    END
     
    Don't forget that DATEDIFF will always TRUNCATE to the whole second.
    -2.9 seconds becomes -2 and 2.9 seconds becomes 2.

  • RE: Assigning Permissions

    I believe you are looking for the GRANT command.  See "Books on Line" for details.

  • RE: varchar2 field needs quotes - Microsoft Server 2000

    >it works until the caseno column contains an value that can't be converted to int.

    Mike, you are absolutely correct.  I was aiming at the original question and I guess I...

  • RE: spt_values

    I don't think you'll see much of a problem because "IS" shares are not exclusive and rank as one of the lowest locks.  I haven't had a problem with it,...

  • RE: How to work with result set from exec in a stored procedure?

    You may have better luck with OpenRowset.  Here's a copy of the example in "Books On Line"...

    A. Use OPENROWSET with a SELECT and the Microsoft OLE DB Provider for SQL...
  • RE: varchar2 field needs quotes - Microsoft Server 2000

    Someone isn't doing something right on Kim's machine... the following example shows that, although it may not be a good idea, implicit transactions as Kim described should work just fine...

  • RE: Common temp tables in procedures

    Not sure, folks, but I think the original question was about having temp tables with the same name running in stored procedures that run at the same time.  The answer,...

Viewing 15 posts - 58,921 through 58,935 (of 59,038 total)