Forum Replies Created

Viewing 15 posts - 241 through 255 (of 314 total)

  • RE: Cross Tab Question

    I have done this onec in past but I don't know if thats suitable for you.

    Use Dynamic SQL to keep adding new columns to the table:

    For expample if you have...

  • RE: SQL Database Percent Log Used > 90 in Small Business Admin Console

    Run DBCC OpenTran on the database that has a large log file. You should get a result stating NO Open Transaction:

    No active open transactions.

    DBCC execution completed. If DBCC printed error...

  • RE: don''''t want to insert same values 2 times.

    I am assuming that id_town and id_voter are unique. so u need to add "NOT EXISTS" clause to you select statement.

    Here you go:

    begin

    set nocount on

    declare @sql varchar(700)

    --...

  • RE: Identifying Sql INVOLVED in the Deadlock from the profiler

    Try This:

    DBCC INPUTBUFFER(spid)

  • RE: Using a subselect in an open query

    I think the string is breaking near Y so try changing it to "Y".

     

  • RE: Using a subselect in an open query

    Have you tried changing the Sub query to JOIN?

    Update BHDBO.T_ERP_MOM_TRANS_OUTGOING

      set RECORD_PROCESSED = 'Y'

    From MOMTRX_Pull

    where UNIQUE_TRANS_NO =MOMTRX_Pull.UNINO

  • RE: 402.1 error

    Have you tried executing the Code that was generated by the web page(using the login credential used by the web page). If that works then its nothing related to SQL...

  • RE: Resorting a Database View by Alias

    Copy ther select statment generated by Enterprise Manger in to Query analyser and adjust the select statement to suit your needs and past it back to the view.

    Hope that answers...

  • RE: text file with inserts and updates

    you can use approach 1 that should work

  • RE: Need help with complex query

    Hop you were trying to do this:

    --Sample Data

    Create table Ppl(PPLname varchar(100), title varchar(100), sex char(1), hair char(50))

    Create table DESCTBLE (Code nvarchar(50), CodeDesc char(255))

    Insert into Ppl

     select 'AAA','Mr A','M','Black'

     union

     select 'BBB','Mr B','M','Brown'

     union

     select 'CCC','Ms...

  • RE: Reduce log file to minimum size

    1.Check to see if there are any long running xcation (DBCC OPEN TRAN)

    2.Take a full backup and then Run DBCC ShirnkDatabase.

    3.Or WORST case secnario: change the recovery model to "SIMPLE",...

  • RE: SQL job in msdb

    If your NT Admin has backupexec set up to backup SQL that will do the SQL backup as well. You've got to be carefull if you have Xaction log backup setup...

  • RE: DBCC

    You can loop through the DB and do the same as well.

    Use Master

    go

    Declare @s_DBName nvarchar(128)

    DECLARE DB_cursor CURSOR FOR

     select name from master.dbo.sysdatabases where name not in ('tempdb', 'Pubs', 'NorthWind')

    OPEN DB_cursor

    FETCH NEXT...

  • RE: When does "create index" execute

    Unless you schedule the job to create index it will start creating and will have locks on the table.

    Thanks

    Sreejith

  • RE: Help with difficult Query

    Francis,

    Here a query that might help you.

    1.Create a Timeslot table(It Could be Temp Table as well)

    Create table TimeSlot(

     dt_TimeSlotBegin Datetime,

     dt_TimeSlotEnd Datetime)

    2.Load the Timeslot table. This table will be used to identify...

Viewing 15 posts - 241 through 255 (of 314 total)