DCSIMG
Database - Zuker On Foundations

Zuker On Foundations

The realm of .NET (WPF, WCF and all around)

Browse by Tags

All Tags » Database (RSS)
SQL 2008 - Filestream vs. Blob
Read the full details here . In essence: Filestream will save the files on the filesystem giving you streaming capabities with the use of public filesytem API along with preferred performance over normal BLOB. From the post - Rule of thumb: Data > 256K - Consider Filestream Data < 256K - Keep using BLOB

Posted Thursday, January 15, 2009 3:25 PM by Amir Zuker | with no comments

תגים:,

T-SQL - Create Unique Constraint
Searched it for a while, thought it might be worth sharing. Following is the T-SQL script to alter a table to apply a UNIQUE constraint on a certain column: ALTER TABLE [TableName] WITH NOCHECK ADD CONSTRAINT UniqueConstraintName UNIQUE ( [ColumnName] )

Posted Thursday, January 15, 2009 3:25 PM by Amir Zuker | with no comments

תגים:,

SQL 2005 - Save File into Image/VarBinary columns
Via this post . I created a column in a certain table to contain various files with "VarBinary(MAX)" as its data type. I wanted to test stuff, so I needed data in the tables. But Oh My, Now What? Should I really write C# Project to insert a file? Well, no, not needed, you can do it directly from SQL. Create Table EmployeeProfile ( EmpId int, EmpName varchar(50) not null, EmpPhoto varbinary(max) not null ) Go Insert EmployeeProfile (EmpId, EmpName, EmpPhoto) Select 1001, 'Vadivel'...

Posted Thursday, January 15, 2009 3:25 PM by Amir Zuker | with no comments

תגים:,

SQL Reporting Services - Query Report Server
It took me quite a while to find a proper example of how to communicate with SQL Reporting Services in order to execute a specific report, I though I might share it. We have Report Server 2008 installed over SQL Server 2005. I needed to extract data of a specific report in runtime (desired output in my case - XML). I found 2 suitable ways of doing so: 1) Use ReportExecution2005 Service SQL Reporting Services include the following: ReportService2005 - A service which exposes the realm of the entire...

Posted Thursday, January 15, 2009 3:25 PM by Amir Zuker | with no comments

תגים:,

Forum Model T-SQL Select
I decided to place it here in case I would need such a thing in the future :) The select statement selects forum-like data model which supports paging as well. (Where comments will be below the main entry and so on) DECLARE @Level int DECLARE @CurrentID int DECLARE @ParentID int Declare @rowcount int DECLARE @LastGroupDate DATETIME DECLARE @LastPageID INT CREATE TABLE #stack( ID int , ParentID int , Level INT, GroupDate DATETIME ) CREATE TABLE #results( N int IDENTITY, ID int , ParentID int , Level...

Posted Thursday, January 15, 2009 3:24 PM by Amir Zuker | with no comments

תגים:,