Forum Replies Created

Viewing 15 posts - 1,276 through 1,290 (of 1,314 total)

  • RE: Shortcuts? Tools? Running the same SQL on many dbs...

    I once found some VB6 code on the web somewhere that ran T-SQL batches across selected databases on all available servers.  It got left behind a job or two ago,...

  • RE: Question of the Day for 12 May 2004

    I can't believe I had to get to page 2 before finding somebody noticed the script only worked for dbo tables.

    The script also assumes no tables have embedded spaces or...

  • RE: Database Scripting Issues

    This code is not a complete solution but might do you some good. It takes the text definition of all views and strips out character strings and comments, then...

  • RE: Oracles LPAD / RPAD equivalent

    An improvement to your LPAD function would be to replace the WHILE loop with

    IF LEN(@InString) < @PadLength

    SET @InString = REPLICATE(@PadChar, @PadLength - LEN(@InString))

    (But I'd go with sql_servant's...

  • RE: Query Analyer does not work

    You say nothing happens when you click on Query Analyzer. Did you check that what you clicked on actually links to isqlw.exe, and it doesn't have any extra command...

  • RE: Select Statement Using Not In and Null Values

    It's probably so obvious that you forgot to mention it, but you have to be careful to only use the left join method when at least one side of the...

  • RE: Break up full name col into fname, lname cols

    You don't say anything about the quality of the name fields. If they're clean, the PARSENAME function is a great approach.

    I work with a lot of crappy name &...

  • RE: Connecting to VPN Client

    We have to use a VPN to connect to a remote system to download data, then upload it to a local server.

    The VPN client software closes all other ports while...

  • RE: UDF's vs. SP's and optimization

    The cases I've looked at worked best when all optional parameters were non-null, and timed out when some parameters were null, so I meant it the way I wrote it....

  • RE: UDF's vs. SP's and optimization

    I can't explain what's going on in the UDF, but I can state emphatically that you should avoid "WHERE (@p is NULL or field = @p)" in stored procedures. ...

  • RE: Identifying Orphan and mismatched userids

    I didn't realize parts of the query would be turned into emoticons.

    The big green question mark icons ( ) in the above queries should be a...

  • RE: Identifying Orphan and mismatched userids

    Here's a query I came up with:

    exec sp_MSforeachdb 'select ''?'' as DB, u.name as Orphan

    from .dbo.sysusers u where u.islogin = 1 and u.sid > 0x01

    and...

  • RE: T-SQL "shortcut"?

    You have to look at the execution plans before making assumptions about the efficiency of different approaches.

    Just because you repeat a calculation several times does not mean it will have...

  • RE: Trigger search for table

    If you want the name of the table along with the trigger name:

    select tbl.name as TABLE_NAME, trg.name as TRIGGER_NAME

    from sysobjects trg

    inner join syscomments sc on sc.id = trg.id

    inner join sysobjects...

  • RE: Trigger search for table

    If your table name might be part of another table name, you could use a more selective LIKE pattern:

    select so.name

    from sysobjects so

    inner join syscomments sc on sc.id = so.id

    where so.xtype...

Viewing 15 posts - 1,276 through 1,290 (of 1,314 total)