Forum Replies Created

Viewing 15 posts - 271 through 285 (of 398 total)

  • RE: How to Execute quary in store procedure

    Avoid error by following.

    create procedure mype

    as

      DECLARE @a varchar(200)

      set @a= 'create table #mytable

                 ( itemcode varchar(15),

                   itemname varchar(50),

                   unitname varchar(15)

                  )'

      exec (@a)

    You may not be able to...

  • RE: Truncating T-Logs = Performace Improvements??

    truncating & shrinking log is to reduce virtual log file number.

    If log files grow to a large size through many small increments, that can slow down recovery.

    SQL Server by default,...

  • RE: Howto Add Processor on MSSQL

    Are you in version 7?

    If yes, check PSS ID Number: 273880 on MSDN.

  • RE: Data Tansfer fails

    Is the disk full?

    The primary filegroup by default contains all the database system tables. It also contains objects not assigned to user filegroups (or not specified). If you autogrowth your...

  • RE: Maximum No of Columns

    1024

  • RE: Finding Field dependencies within all tables of a SQL Database

    For the first question, if the field name is the key then searching INFORMATION_SCHEMA.COLUMNS

    select * from INFORMATION_SCHEMA.COLUMNS where column_name='au_id'

    The second could be solved using database diagram in Enterprise Manager.

     

  • RE: How can I commit more frequently?

    The technical I often use to avoid log grow too large is using set rowcount. It control exactly how many rows to update.

     

  • RE: Column length and Performance

    Theoretically, the smaller key fields the better. SQL Server manages data in page, which is around 8k size, the smaller the key fields, the more fit in a page, the less...

  • RE: How to match db name in EM with native file names

    declare @sql varchar(400)

    set @sql='select ''?''as dbname;select name, fileid, filename from ?.dbo.sysfiles'

    exec sp_msforeachdb @sql

    database name is also listed.

  • RE: Standard Deviation

    Create a view with union would be a solution.

  • RE: How to match db name in EM with native file names

    Execute from query analyzer

    declare @sql varchar(400)

    set @sql='select name, fileid, filename from ?.dbo.sysfiles'

    exec sp_msforeachdb @sql

  • RE: Preventing automatic startup of database

    User database will be closed when last user disconnect. It applies to start up as well, if no connection, database stay closed until otherwise.

    If you do not want the sql...

  • RE: problems with a script

    Have to use dynamic sql.

    Something like

    declare @value datetime

    set @value = CAST('20040129 15:00:00' AS DATETIME)

    DECLARE @tablenames TABLE

    (

    table_id INT IDENTITY,

    table_name SYSNAME

    )

    INSERT INTO @tablenames (table_name)

    SELECT name FROM...

  • RE: Invalid error number returned by system SPs

    system stored procedures use return code value for success or failure. @@error is erased with return statement.

    Sample:

    use pubs

    go

    create proc sperrtest as

     raiserror(15043,16,1)

     select @@error

     return (0)

    go

    declare @returncode int

    exec @returncode=sperrtest

    select @returncode, @@error

    go

    drop proc sperrtest

     

  • RE: ANSI JOIN vs. OUTER JOIN

    Sample in PSS ID Number: 176480

    Old style outer join in pubs database

    SELECT titles.title_id, title, qty

       FROM titles, sales

       WHERE titles.title_id *= sales.title_id

       AND stor_id = '7066'

    is not the same as

    SELECT...

Viewing 15 posts - 271 through 285 (of 398 total)