Friday, 24 October 2008

Fast way for row counts in SQL

One of the best things I've ever seen:

select o.name, rows from sysobjects o inner join sysindexes i on o.id = i.id where i.indid < 2 and xtype='u' and o.name not in ('dtproperties')

Woo hoo...

Hey, ever had orphaned SQL server users... come on, tell the truth... YES YOU HAVE!

First, make sure that this is the problem. This will lists the orphaned users:

EXEC sp_change_users_login 'Report'

If you already have a login id and password for this user, fix it by doing:

EXEC sp_change_users_login 'Auto_Fix', 'user'

If you want to create a new login id and password for this user, fix it by doing:

EXEC sp_change_users_login 'Auto_Fix', 'user', 'login', 'password'

No comments:

Extending JDE to generative AI