Search

Categories

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Send mail to the author(s) E-mail

# Thursday, August 18, 2011

SELECT
    [TableName] = so.name,
    [RowCount] = MAX(si.rows)
FROM
    sysobjects so,
    sysindexes si
WHERE
    so.xtype = 'U'
    AND
    si.id = OBJECT_ID(so.name)
GROUP BY
    so.name
ORDER BY
    2 DESC

From http://sqlserver2000.databases.aspfaq.com/how-do-i-get-a-list-of-sql-server-tables-and-their-row-counts.html

This is approximate

Comments [0] | | # 
# Wednesday, May 18, 2011
CREATE FUNCTION Guid_Empty()
RETURNS UniqueIdentifier
AS
BEGIN
RETURN cast(cast(0 as binary) as uniqueidentifier)
END
GO



SELECT MerchantUID, EmailToSendReport1, EmailToSendReport2, EmailToSendReport3, EmailToSendReport4
FROM aspnet_Profile2
WHERE UserType = 1 and
-- where MerchantUID is not a null Guid.. uses function Guid_Empty
ISNULL(MerchantUID, dbo.Guid_EMPTY()) != dbo.Guid_EMPTY()

Comments [0] | | # 
# Wednesday, January 19, 2011

From http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_26469215.html

DECLARE @dt datetime
SET @dt = '2007-01-01'
WHILE @dt <= '2017-01-01' BEGIN
INSERT INTO SomeTable (DateColumn) VALUES (@dt)
   SET @dt = DATEADD(day, 1, @dt)
END

Comments [0] | | # 
# Monday, January 17, 2011
( Azure | SQLServer )

http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=KB2006191&DownloadId=8227

Here are the scripts put together in 1 file:

Remember to point your web app to the database to populate it ie in Visual Studio, click on the icon at the top in solution explorer to launch the web app.

Comments [0] | | # 
# Thursday, September 02, 2010

http://www.databasejournal.com/features/mssql/article.php/3654176/SQL-Server-2005-Command-Line-Tool-SQLCMD--Part-I.htm

C:\Program Files\Microsoft SQL Server\90\Tools\Binn

sqlcmd –S.\SQLEXPRESS –E    -- E is windows auth

select @@version

seelct @@servername

sqlcmd –Smssql1.openhost.net.nz –Uuser –Psecret    -- carefuly copying this from here.. I had to retype

sqlcmd –Smssql1.openhost.net.nz –Uuser –Psecret –i c:\dbtestbackup.sql –oc:\sqloutput.txt

 

Had a huge 800MB .SQL file.  Notepad++ wouldn’t open after 10mins.

even gvim tried, but opened as junk text

Try SQL Server Import / Export now. This worked really well!

Comments [0] | | # 
# Tuesday, August 10, 2010

http://thedatafarm.com/blog/tools/asp-net-iis6-network-service-and-sql-server/

On the master database:

exec sp_grantlogin 'NT AUTHORITY\NETWORK SERVICE'

Then go to Management Studio, and add in this user.

Comments [0] | | # 
# Thursday, May 27, 2010
( SQLServer | VMWare )

 

using the Web Plaform Installer. installation of the Studio didn’t work

tried ccleaner which didn’t work.

http://goneale.com/2009/05/24/cant-install-microsoft-sql-server-2008-management-studio-express/

Trick is to get the DB Server and tools together: **No this is just SQL Server 2008, not R2**

https://www.microsoft.com/downloads/details.aspx?familyid=7522A683-4CB2-454E-B908-E805E9BD4E28&displaylang=en

But as I’d compressed my C:\ drive on WMWare Player it came up with an unusual error.

This is good:

image

image

Expand Boot Drive on VMWare Player3

Need VMWare Player 3.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1004047

Can simply edit the drive information in the player GUI, then goto Windows7 click on C:\ drive in admin tools and management, and then do expand volume.

Comments [0] | | #