Forum Replies Created

Viewing 15 posts - 106 through 120 (of 315 total)

  • RE: Trigger Syntax Using Columns_updated

    Ninja,

    Aren't u doing "Instead of Trigger" like I mentioned?

    Thanks

    Sreejith

  • RE: What will be the output of below T-SQL?

    Server: Msg 156, Level 15, State 1, Line 2

    Incorrect syntax near the keyword 'RowCount'

     

  • RE: time format

    Try this:

    select Convert(Char(5),getdate(),108)

  • RE: join problem

    The query below assumes Provider is the unique key on Master table. If Not u will get duplicate information.

    Select mastertable.Provider,mastertable.col1,mastertable.col2,

    mastertable.col3,...childtable.col1,Childtable.col2...

    from mastertable LEFT OUTER JOIN childtable on mastertable.Provider = childtable.Provider

    Thanks

    Sreejith

  • RE: Master and MSDB, why separate.

    MSDB is used by automated process thats run on SQL. Its used by SQL Agent where as Mater is the master cataolg used by SQL to run the Server itelf.

    You...

  • RE: Data transfer between databases with different structures

    Try this and expand it to suit ur needs:

    Select PINTbl.PIN,ADDR1.VALUE,ADDR2.VALUE  from

     (Select PIN from sourceDB.dbo.sourcetbl group by PIN) PINTbl

     LEFT OUTER JOIN sourceDB.dbo.sourcetbl ADDR1 On PINTbl.PIN = ADDR1.PIN

     LEFT OUTER JOIN sourceDB.dbo.sourcetbl ADDR2...

  • RE: Create a table using a variable

    Or this one:

    declare @dt_Date Datetime,

     @s_SourceTableName varchar(255),

     @s_Sql nvarchar(4000)

     

    set @dt_Date ='08/28/2006'

    set @s_SourceTableName ='MyTable'

    set @s_Sql =N'If exists (Select 1 from sysobjects where name =''' + @s_SourceTableName + '_' + Convert(Char(8),@dt_Date,112) + ''')...

  • RE: Create a table using a variable

    Try this:

     

    declare @dt_Date Datetime,

     @s_SourceTableName varchar(255),

     @s_Sql nvarchar(4000),

     @s_ColName varchar(255),

     @i_Collength int,

     @s_ColType varchar(255),

     @i_Precision int,

     @i_Scale int

    set @dt_Date ='08/28/2006'

    set @s_SourceTableName ='MyTable'

    set @s_Sql =N'If exists (Select 1 from sysobjects where name =''' + @s_SourceTableName + '_'...

  • RE: backup script

    Anita,

    Why haven't u considered SQL Maintenance plan. There u can specify the number of days that u want to retain the backup.

    Thanks

    Sreejith

  • RE: don''''t want null in the field.

    If you want to updated the records that have Null in ad_num then modify your query to exclude Not Null ad Column.

    But by modifying your query slightly will give the...

  • RE: Getting object sizes in a database

    You can use Enterprise Manager.

    Select the Database->View->Taskpad. Then on the Right plane Click on Table Info

    You can use sp_spaceused procedure to do one object at a time.

    Thanks

    Sreejith

  • RE: Performance with select query

    Just to add to Ninja's response if u do select * then the columns that you join will appear more than once(once for every table that has those columns).

    Thanks

    Sreejith

  • RE: Trigger Syntax Using Columns_updated

    Please look at instead of trigger. That might be what u want.

    Thanks

    sreejith

  • RE: Creating text files for each row of the ouput

    Vijay,

     

    I ran the query that Jeff send and it works. You need to change the database Name after "FROM" CLAUSE and the SErverName after "-S". Jeff's code assumes that your...

  • RE: Convert month number to month names

    If you want to use it against the column in the table try this:

    select DATENAME(mm,ColumnName)

    Thanks

    Sreejith

Viewing 15 posts - 106 through 120 (of 315 total)