Viewing 15 posts - 196 through 210 (of 244 total)
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...
June 3, 2006 at 9:18 am
"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...
June 2, 2006 at 3:39 am
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...
June 1, 2006 at 9:44 am
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...
June 1, 2006 at 5:43 am
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...
June 1, 2006 at 2:58 am
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...
May 31, 2006 at 10:16 am
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...
May 31, 2006 at 8:12 am
so if the table/index is partitioned you sum the no of rows in each partition from sys.partitions
Fair enough
May 31, 2006 at 7:30 am
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...
May 31, 2006 at 7:01 am
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...
May 30, 2006 at 9:20 am
Yep much better. sysindexes is very helpful.
Will this work on heaps?
May 30, 2006 at 9:05 am
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...
May 30, 2006 at 8:14 am
@@SPID this will return the process id. Bung a 'and processid != @@SPID' in your where
clause(s)
May 30, 2006 at 8:11 am
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...
May 30, 2006 at 8:02 am
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)...
May 30, 2006 at 7:28 am
Viewing 15 posts - 196 through 210 (of 244 total)