Forum Replies Created

Viewing 15 posts - 196 through 210 (of 225 total)

  • RE: Total beginner can''''t even connect with OSQL

    Michael, are you a local administrator on the machine you installed MSDE (desktop engine) on?  By default, MSDE should allow administrators to connect with the "-E" option because of a SQL...

  • RE: Numbering of Records

    This may be moot because using a temp table for a large count set is desirable, but what if the record count exceeded 2,147,483,647 (the count function returns and integer), do you...

  • RE: T-SQL brain teaser, tricky sum for employee data.

    This has been a really fun topic!  Just for fun I populated a huge CHECK_DATA table to see the effects of the queries for a long history.  I am getting the...

  • RE: Can SQL Server 2000 STANDARD access more than 2GB?

    I think 2GB is it.  Although, with SQL Standard licensed per processor, maybe a machine with 4GB memory, and 2 instances of SQL standard could each use their own 2GB??

    I'm...

  • RE: Numbering of Records

    Andreas, you can avoid a temp table - that is what Steve's solution was for.  Post your table name and properties if need be and we can post the exact...

  • RE: Numbering of Records

    Andreas, Steve's solution is correct (and clever):

    Based on your example:

    Create TABLE temptable (col1 varchar(10), col2 varchar(10), col3 varchar(10))

    GO

    INSERT INTO temptable values('Val 1a', 'Val 2a', 'Val 3a')

    INSERT INTO temptable values('Val 1b',...

  • RE: Numbering of Records

    Can you live with a table variable???

    DECLARE @tempTableVariable TABLE (IDENT int IDENTITY(1,1), col1 varchar(10), col2 varchar(10), col3 varchar(10))

    INSERT INTO @tempTableVariable

    SELECT * FROM SourceTable

    select * from @tempTableVariable

    Yields:

    1 Val 1a Val 2a Val 3a

    2 Val 1b Val...

  • RE: Conditional Counts

    Matt, I'm sure there is a much more creative way to do this without a temp table, but here is an untested solution with a temp table.

    CREATE TABLE #UnionTable (BusinessDate...

  • RE: Where clause on vertical Name/Value pair tables

    Simon, you may get a lot of differring opinions on this - and in many cases it will depend on the specific situation.  However, as a GENERAL guideline, I always...

  • RE: Where clause on vertical Name/Value pair tables

    That's an interesting problem.  This may not be the best way to do this...but, a quick way I would do it would be to:

    Create a temp table and change the...

  • RE: Inserting into table with one column 1,2,3,4...

    Senthil,

    As a final note.  See Remi's use of the table variable.  If you are using this for a one time query, you really will want to do it that way. ...

  • RE: Query oddity

    Wayne, maybe my Friday afternoon reading is getting a bit lazy - if so please forgive...

    Anyway, BOL states: "If the values in the VALUES list are not in the same...

  • RE: Inserting into table with one column 1,2,3,4...

    From books on line:

    "TRUNCATE TABLE permissions default to the table owner and are not transferable."

    Ryan

  • RE: Inserting into table with one column 1,2,3,4...

    Senthil, is this an example of what you are looking for?

    use tempdb

    create table sp_who (ID INT IDENTITY (1,1) NOT NULL

     ,spid varchar (10)

     ,status varchar (20)

     ,loginname varchar(20)

     ,hostname varchar(20)

     ,blk varchar(20)

     ,dbname varchar(20)

     ,cmd varchar(20))

    GO

    use master

    INSERT...

  • RE: Query oddity

    Wayne,

    For example one you have to explicitly state your insert fields since you are not inserting into the identity column.  Simply adding the insert fields makes it work.

    DECLARE @tmp1 TABLE...

Viewing 15 posts - 196 through 210 (of 225 total)