Forum Replies Created

Viewing 15 posts - 11,536 through 11,550 (of 13,462 total)

  • RE: Which Data Type to use

    use a char1, and simply put a check constraint--

    CREATE TABLE blah(

    GENDER CHAR(1) NULL DEFAULT 'U' CHECK(GENDER IN('M','F','U') --U for undisclosed? some politically correct places require that nowadays

  • RE: Problem with Stored procedure

    here's my suggestions:

    1. update statistics:

    2: can you show us the procedure? it might be the parameter sniffing issue(search here on SSC)

    3: can you show us the execution plan? that shows...

  • RE: problem calling stored procedure

    Jeff it does still work; it depends on the commands you use; I've got an article coming out on a procedure i wrote that returns the DDL of any table;

    your...

  • RE: problem calling stored procedure

    to get a procedure to run under the context of the database it is called from, doesn't it HAVE to be in the MASTER database and also at least start...

  • RE: Real line numbers

    also from within SSMS:

    Tools>>Options>>Text Editor

    Expand "All Languages"

    under the "Display" section, there is a semi-gray checkbox...uncheck and check to enforce line numbers for All languages and files.

    Now line numbers appear on...

  • RE: Lock login at specific date

    you could also use a logon trigger that checks the login against getdate() & some expiration date in a table, and use that logon trigger to prevent logging in.

  • RE: Why this Function is Slow?!

    both sqls in the union seem to be filtering on Application name, so If they ran alone, I would think they'd be fairly quick.

    the union instead of union all could...

  • RE: how to add the windows login user as a memeber of sysadmin to SQL, so I can log into the SQL using windows authentication

    if you know the administrator password when you set up the machine, you can log in as that:

    at the login screen which lists all the users, hit control-alt-delete twice...this will...

  • RE: Query Structure - Multiple tables

    the sum() function does not take a comma delimited list: change all the commas to plus signs to sum all the columns and all the rows:

    select SUM (e.GROSWAGS_1 +...

  • RE: problem calling stored procedure

    ok, i copied and pasted your ocde, and found the #fraglist gets populated just fine.

    the second cursor "index" never ran on my machine, because the condition below was never met:...

  • RE: NOT IN on Null value returns incorrect results

    yeah the issue is db_id can return null:

    select db_id('Bob')

    i doubt you have a 'Bob' database...

    your example would actually be

    select * where x not in (1,2,3,NULL,NULL) --<<--NOT IN NULL RETURNS...

  • RE: Only one expression can be specified in the select list error

    you want to test IF EXISTS(any rows in logger2)

    not that (somequery = 0)--you weanted to count the rows or something, right?

    so you'd want to tweak it to something like this:

    IF...

  • RE: how to link two different database as

    damn...i just tried to do it, so i could script out the linked server commands, and i get "cannot create a linked server from a local server" from the gui.

    anyone...

  • RE: how to link two different database as

    In SQl 2000, I can't think of an easy way.

    in SQL 2005, you could use a synonym...for example two synonyms like

    PRIMEDB and OTHERDB

    and the query could refer to

    ...

  • RE: simple trigger

    well kind of...there is no such thing as a sequence number in SQL, but the Identity() has the equivalent for any given column...if you set the identity() on the column,...

Viewing 15 posts - 11,536 through 11,550 (of 13,462 total)