September 10, 2010  
  Register Login 
BLOGS
There are no categories in this blog.

SEARCH BLOG

BLOG ARCHIVE
Archive
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
Monthly
October, 2008
  SQL Server Blogs     



Your Ad Here

 
Author: Aleksandar Tosic Created: Monday, September 17, 2007
Aleksandar Tosic's Blog

Msg 14650, Level 16, State 1, Procedure sp_send_dbmail, Line 68
Msg 14650, Level 16, State 1, Procedure sp_send_dbmail, Line 68 Service Broker message delivery is not enabled in this database. Use the ALTER DATABASE statement to enable Service Broker message delivery
Comments (0) More...
By Aleksandar Tosic on Thursday, October 23, 2008

Out of memory error when try to preview report

These are good links when getting error "Out of memory"  when running report in Reporting Service 2005.

 

http://msdn2.microsoft.com/en-us/library/ms156002.aspx

http://blogs.msdn.com/lukaszp/archive/2007/01/31/how-to-diagnose-issues-when-running-reports-in-the-report-server.aspx

 

 

Comments (0)
Reporting Services 2005 By Alex on Wednesday, October 15, 2008

Truncating a data file

Truncating a data file

The following example truncates the primary data file in the AdventureWorks database. The sys.database_files catalog view is queried to obtain the file_id of the data file.

http://msdn2.microsoft.com/en-us/library/ms189493.aspx

USE AdventureWorks;
GO
SELECT file_id, name
FROM sys.database_files;
GO
DBCC SHRINKFILE (1, TRUNCATEONLY);

Comments (0)
Database Files By Aleksandar Tosic on Wednesday, October 15, 2008

How to generate a random number in SQL Server

 

To genereate a random number in SQL Server we can use random function.  Check example below where a random generated number is between 1 and 100:

select rand()
select rand() * 100
select cast(rand() * 100 as int) as number

 

Comments (0)
T-SQL By Alex on Wednesday, October 15, 2008

LOGINPROPERTY - information about login policy settings
LOGINPROPERTY (information about login policy settings)
 
LOGINPROPERTY function returns information about the password policy settings of a SQL Server login.
Comments (0) More...
T-SQL By Alex on Wednesday, October 15, 2008

Upgrading Editions of Reporting Services

Upgrading from SQL Server 2000

SQL Server 2005                         SQL Server 2005
Evaluation                                  & ...

Comments (0) More...
Reporting Services 2005 By Alex on Wednesday, October 15, 2008

Msg 7411 - Server "ServerName" is not configured for DATA ACCESS.

To alow darta access through linked server using OPENQUERY we need to set set linked server "DATA ACCESS" option to true:

EXEC sp_serveroption 'YourServer', 'DATA ACCESS', TRUE

Use this option when you get following error message:

Msg 7411, Level 16, State 1, Line 1

Server 'MYSERVER' is not configured for DATA ACCESS.

Comments (1)
Configuration By Aleksandar Tosic on Wednesday, October 15, 2008

MSQL_XP - wait type on sys.dm_os_wait_stats

MSQL_XP is the  wait type that occurs when a task is executing an extended stored procedure - XP. SQL Server does not have control over an XP even though it is executing within the SQL Server process. Investigation of these waits requires investigating the execution of the extended stored procedure code—the vendor may have provided diagnostic tools for the < ...

Comments (0) More...
Blocking By Aleksandar Tosic on Wednesday, October 15, 2008

How to empty a database file - Emptying a file

Emptying a file

The following example demonstrates the procedure for emptying a file so that it can be removed from the database. For the purposes of this example, a data file is first created and it is assumed that the file contains data.

http://msdn2.microsoft.com/en-us/library/ms189493.aspx

USE AdventureWorks;
GO
-- Create a data file and assume it contains data.
ALTER DATABASE AdventureWorks
ADD FILE (
    NAME = Test1data,
    FILENAME = 'C:\t1data.ndf',
    SIZE = 5MB
    );
GO
-- Empty the data file.
DBCC SHRINKFILE ('Test1data', EMPTYFILE);
GO ...

Comments (0) More...
Database Files By Aleksandar Tosic on Wednesday, October 15, 2008

Attach Database using only mdf file where ldf is missing
CREATE DATABASE PagingSample
ON PRIMARY
(FILENAME= 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\PagingSample.mdf')
FOR ATTACH
ATTACH_REBUILD_LOG
Comments (0)
By Aleksandar Tosic on Wednesday, October 15, 2008

Using Blocked Process Report event class in SQL Server Profiler 2005.

sp_configure 'show advanced options', 1 ;
GO
RECONFIGURE ;
GO
sp_configure 'blocked process threshold', 10 ;
GO
RECONFIGURE ;
GO

Create a new trace in Profiler and select the "Blocked Process Report" event listeds under the "Errors and Warnings" event category.

After this setup, you should see all blockings taking longer than 10 seconds using this trace.

Comments (0)
By Aleksandar Tosic on Wednesday, October 15, 2008

MSDN Product Licensing
MSDN Product Licensing
Comments (0) More...
By Aleksandar Tosic on Wednesday, October 15, 2008

SQL Server Service Pack 2

Microsoft released Service Pack 2 for SQL Server 2005. You can download the SP2 here.

Some of the changes are

Comments (0) More...
By Aleksandar Tosic on Wednesday, October 15, 2008

@@IDENTITY and SCOPE_IDENTITY()
 
@@IDENTITY and SCOPE_IDENTITY() will return the last inserted identity value in the current session but in different scenarios they can each return different values.
While both @@IDENTITY and SCOPE_IDENTITY return the last identity value generated in any table in the current session, SCOPE_IDENTITY() will return the value only within the current scope (a scope is a stored procedure, trigger, function, or batch) while @@IDENTITY is not limited to a specific scope.
 
Comments (0) More...
By Aleksandar Tosic on Wednesday, October 15, 2008

SQL Server 2005 Service Pack 1

To  download SQL Server 2005 Service Pack 1 visit: http://www.microsoft.com/downloads/details.aspx?familyid=cb6c71ea-d649-47ff-9176-e7cac58fd4bc&displaylang=en

Comments (0)
Service Packs By Aleksandar Tosic on Wednesday, October 15, 2008

SQL Server 2005 Service Pack 2

To  download SQL Server 2005 Service Pack 2 visit: http://www.microsoft.com/downloads/details.aspx?FamilyId=d07219b2-1e23-49c8-8f0c-63fa18f26d3a&DisplayLang=en

Comments (0)
Service Packs By Aleksandar Tosic on Wednesday, October 15, 2008

Microsoft SQL Server 2005 Downloads

 

To download SQL Server 2005 service packs, tools, trial software visit: http://technet.microsoft.com/en-us/sqlserver/bb331754.aspx

Comments (0)
SQL Server 2005 Downloads By Aleksandar Tosic on Wednesday, October 15, 2008

DBCC LOGINFO ('DATABASENAME')

Use an undocumented DBCC command DBCC LOGINFO to to see if VLF's contain active transactions. 

DBCC LOGINFO('DATABASENAME')

 

Click below for more details:
Comments (0)
By Aleksandar Tosic on Wednesday, October 15, 2008

SQL Server 2005 Report Packs
SQL Server 2005 Report Packs
Comments (0) More...
By Aleksandar Tosic on Wednesday, October 15, 2008

Using textcopy.exe utility to impoty images

Importing Images with textcopy utility.

 

Use textcopy.exe utility. Check this: http://www.databasejournal.com/features/mssql/article.php/1443521 or http://www.windowsitlibrary.com/Content/77/03/4.html or http://www.mssqlcity.com/Articles/KnowHow/Textcopy.htm

Comments (0)
By Aleksandar Tosic on Wednesday, October 15, 2008

Encrypted HTML Decoding Tools
Encrypted HTML Decoding Tools
Comments (0) More...
By Aleksandar Tosic on Wednesday, October 15, 2008

Create a foreign key on an existing table in SQL Server
Use code below to create a foreign key on an existing table in SQL Server ALTER TABLE Table1 ADD FOREIGN KEY (Column_Name) REFERENCES Table2(Column_Name)
Comments (0) More...
T-SQL By Alex on Wednesday, October 15, 2008

test
test
Comments (0) More...
Blocking By Aleksandar Tosic on Wednesday, October 15, 2008

Online Index Operations - SQL Server 2005
The online index feature provides a powerful way to perform maintenance operations such as rebuilding or creating indexes in a production system without sacrificing DML concurrency.

This feature allows concurrent modifications (updates, deletes, and inserts) to the underlying table or clustered index data and any associated indexes during index data definition language (DDL) execution. For example, while a clustered index is being rebuilt, you can continue to make updates to the underlying data and perform queries against the data.

Comments (0) More...
Performance By Aleksandar Tosic on Wednesday, October 15, 2008

SQL Server 2005 Catalog view

In SQL Server 2005, the system tables are gone. The system tables from previous versions of SQL Server are now implemented as a series of views called catalogue views and all of these catalogue views can be found in the sys schema.

select * from sys.all_views

Comments (0) More...
By Aleksandar Tosic on Wednesday, October 15, 2008

Selecting random pages using tabid in DotNetNuke based on tabname similarity

declare @tabid int
declare @tabname nvarchar(100)
set @tabid = 7
--select * from tabs where tabid = @tabid
select @tabname = tabname from tabs where tabid = @tabid
--select * from tabs where IsVisible = 1 and ParentID is null
select top 10 DIFFERENCE(@tabname,tabname),@tabname,tabname from tabs where IsVisible = 1 and ParentID is null order by DIFFERENCE(@tabname,tabname) desc

This code is used to list similar tabnames (pages) when tabid is provided.

Comments (0)
By Aleksandar Tosic on Wednesday, October 15, 2008

Use SQL Server 2005 to get information from Active Directory about users, groups etc.
Use this script to  list Active Direct users from SQL Server 2005. 'ADSI', 'droplogins' 
 
 sp_dropserver
GO

EXEC master.dbo.

Comments (0) More...
By Aleksandar Tosic on Wednesday, October 15, 2008

SQL Server Injection - SQL Server Security Hacks - Best SQL Injection Tools

SQL Server Injection

Great article and great tools:
http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1159434,00.html#

SQL Server Security Hacks
Top 15 free SQL Injection Scanners
http://www.security-hacks.com/2007/05/18/top-15-free-sql-injection-scanners


HP WebInspect performs web application security testing
...

Comments (0) More...
By Aleksandar Tosic on Wednesday, October 15, 2008

Capitalize the first letter of every word in a text string or column - SQL Server
capitalizes the first letter of every word in a given text string
Comments (0) More...
By Aleksandar Tosic on Wednesday, October 15, 2008

Formatting data in Reporting Services 2005 when creting report

 

FormatDateTime function i a VBScript function the formats date or time.

Example:

= FormatDateTime(Fields!PublicationDate.Value,2)

Formats

vbGeneralDate  0  Display a date in format mm/dd/yy. If the date parameter is Now(), it will also return the time, after the date
vbLongDate  1  Display a date using the long date format: weekday, month day, year
vbShortDate  2  Display a date using the short date format: like the default (mm/dd/yy)
vbLongTime  3  Display a time using the time format: hh:mm:ss PM/AM
v ...
Comments (0) More...
Reporting Services 2005 By Alex on Wednesday, October 15, 2008

Copyright 2007 by www.dballinks.com Terms Of Use Privacy Statement