Forum Replies Created

Viewing 15 posts - 196 through 210 (of 244 total)

  • RE: function call with database as parameter.

    If you have a limited number a DBs and you know the names in advance you could simply put an if statement in your cursor. |This would allow you to...

  • RE: Is a Temporary Table Really Necessary?

    "now and not multiple queries that have to researched and changed. I use this technique quite often and it often forces me to use a temporary table to hold the...

  • RE: xp_cmdshell zipping back ups?

    Thanks for all your help.

    SQL server was running under the local  system account. I have now set it running under a windows account and the code works fine. Incidentally the quotes...

  • RE: Get no of Rows using system table?

    revised code using count(*) instead of getting first column.

    obviously

    ------------------------------------------------------------------

    create table DBA_RowNumber

    (id int identity, table_name varchar (1000), No_Of_Rows bigint)

    go

    declare @no int, @i int, @sql nvarchar(4000)

    declare @tab...

  • RE: xp_cmdshell zipping back ups?

    There was an issue with the format of the string which i fixed yesterday along the lines you have but now getting an access denied error in the folder to...

  • RE: xp_cmdshell zipping back ups?

    have tried qutoed identifier but its not that.

    permissions should be the same in both cases have tried as admin.

    The dos command produced by print runs with no problem SO...

  • RE: table name

    There is nothing inherently procedural about issuing dynamic ddl commands.

    Having generic, automated methods of building relational structures should only increase the relational solidity of sql dbs by cutting out...

  • RE: Get no of Rows using system table?

    so if the table/index is partitioned you sum the no of rows in each partition from sys.partitions

    Fair enough

  • RE: Get no of Rows using system table?

    rowcnt

    bigint

    Data-level row count based on indid = 0 and indid = 1.

    NULL = Index is partitioned when indid > 1.

    NULL = Table is partitioned when indid is 0...

  • RE: Get no of Rows using system table?

    Nice.

    Yep it looks as though Rowcnt is not stored in any of the new system views which MS seem to want people to start using exclusivly..

    sys.indexes does not...

  • RE: Get no of Rows using system table?

    Yep much better. sysindexes is very helpful.

    Will this work on heaps?

  • RE: Duplicate Values

    create table #Car (ID INT, strMan varchar(30), Model varchar(30))

    need to replace id in your group by with model and remove colour as below.

    insert into #Car values (1, 'Ford', 'Fiesta')

    create table...

  • RE: Identifying own session''''s process_id

    @@SPID this will return the process id. Bung a 'and processid != @@SPID' in your where

    clause(s)

  • RE: Get no of Rows using system table?

    this will work but might take a while to run on a many tabled DB with multi million row tables. Count_Big is, i think, only available in sql2005 if not...

  • RE: table name

    You need to build the create table statement in dynamic SQL

    declare @ca varchar(20)

    declare @fechai datetime

    declare @personaltablename varchar (256)

    declare @sql varchar(5000)

    set @fechai = dateadd(mm,-1,getdate())

    set @ca = convert(varchar, @fechai, 111)...

Viewing 15 posts - 196 through 210 (of 244 total)