SQL SERVER – Query to find number Rows, Columns, ByteSize for each table in the current database – Find Biggest Table in Database (via Journey to SQLAuthority)

USE DatabaseName GO CREATE TABLE #temp ( table_name sysname , row_count INT, reserved_size VARCHAR(50), data_size VARCHAR(50), index_size VARCHAR(50), unused_size VARCHAR(50)) SET NOCOUNT ON INSERT #temp EXEC sp_msforeachtable 'sp_spaceused ''?''' SELECT a.table_name, a.row_count, COUNT(*) AS col_count, a.data_size FROM #temp a INNER JOIN information_schema.columns b ON a.table_name collate database_default = b.table_name collate database_default … Read More

via Journey to SQLAuthority

Advertisements

Error : the RPC security information for the publisher is missing or invalid

This is genereally an error which will be throw when you have a replicated set of data in SQL Server and if you are trying to perform a DML statement on the table it gives this error. This error is generally  related to network transaction in DCOM service in Windows.

To allow the network transaction, you must enable MSDTC. To do this, follow these steps: a.  Click Start, and then click Run.
b.  In the Run dialog box, type dcomcnfg.exe, and then click OK.
c.  In the Component Services window, expand Component Services, expand Computers, and then expand My Computer.
d.  Right-click My Computer, and then click Properties.
e.  In the My Computer Properties dialog box, click Security Configuration on the MSDTC tab.
f.  In the Security Configuration dialog box, click to select the Network DTC Access check box.
g.  To allow the distributed transaction to run on this computer from a remote computer, click to select the Allow Inbound check box.
h.  To allow the distributed transaction to run on a remote computer from this computer, click to select the Allow Outbound check box.
i.  Under the Transaction Manager Communication group, click to select the No Authentication Required option.
j.  In the Security Configuration dialog box, click OK.
k.  In the My Computer Properties dialog box, click OK.
source: http://support.microsoft.com/?kbid=873160