Forum Replies Created

Viewing 15 posts - 13,276 through 13,290 (of 13,838 total)

  • RE: SQL to identify missing Stored Procs across servers

    Try this - untested, but should get you going:

    select r1.*

    from server1.database1.information_schema.routines r1

    left join server2.database2.information_schema.routines r2

    on r1.routine_name = r2.routine_name and r1.routine_type = r2.routine_type

    where r1.routine_type = 'procedure' and (r2.routine_name is null)

     

  • RE: connecting to sql server from another computer

    Why not just detach the dbs on the old computer, copy them across using Explorer and then attach on the new PC?  This takes SQL Server out of the equation.

    Also,...

  • RE: How to convert sql server default date value to NULL

    Using EM to input data, CTRL/0 will enter a NULL for you.

    If you are really concerned, I guess you could write a trigger that will always convert space to NULL,...

  • RE: How to convert sql server default date value to NULL

    SQL Server recognises a space as being different from a null (because it is).  Why don't you just configure your app to convert a space to a null and write...

  • RE: How to do a select from sp_helpdb''''s output ?

    Can't find a way of doing this without using sysfiles - here's an example, if you need it:

    declare @dbname varchar(100)

    declare @strSQL nvarchar(500)

    set @dbname = 'master'

    set @strSQL = 'select name, fileid,...

  • RE: select all field values except for primary key

    What you are trying to do is a little more complex than this - though this gets a bit closer, I think:

    declare @table varchar(50)

    declare @str1 nvarchar(1000)

    set @table = 'test_table'

    set @str1...

  • RE: Duplicate column name resolution - Error on execution

    I've never seen this message before - you've got something strange happening there!  All I can suggest is that you remove transformations one at a time and keep trying ......

  • RE: Concatenate string in DTS package

    If you are writing the code as part of an ActiveX script, the & character is used to concatenate strings, not + (just to keep you on your toes)!

  • RE: Duplicate column name resolution - Error on execution

    Suggest you modify your queries to remove any likelihood of ambiguity between column names.  Do this by prefixing the column name with the table name:

    select tablename.columnname from tablename

    If the table...

  • RE: Determining default db

    You can check this easily in EM.  Just open Security/Logins, right click the user of interest and select properties and you will see the default database.

  • RE: SQL puzzle...

    You will not achieve this type of formatting with straightforward SQL statements - Ray M's solution, possibly with an additional ORDER BY clause so that you get everything in date...

  • RE: Update table

    update no

    set status = 2

    from n_order no join n_inv ni on no.id = ni.id

    where (ni.tf is not null or exists (select bt.debtkey from banktable bt where bt.debtkey = ni.debtkey))

  • RE: Update table

    You haven't said what you want to update and what value, so I have left these for you to complete.

    update no

    set [field] = [whatever]

    from n_order no join n_inv ni on...

  • RE: DTS Error The number of failing rows exceeds the maximum specified

    Sure - right click on the Transform Data Task, select properties and then click on the Options tab.  You will see Max Error Count about halfway down the dialog box.

  • RE: @@IDENTITY

    Don't be offended if this is blindingly obvious to you, but does the PHCR_Record table have an IDENTITY column defined?

Viewing 15 posts - 13,276 through 13,290 (of 13,838 total)