sql-server

Memory leak using SQL FileStream

Hi, I have an application that uses a SQL FILESTREAM to store images. I insert a LOT of images (several millions images per days). After a while, the machine stops responding and seem to be out of memory... Looking at the memory usage of the PC, we don't see any process taking a lot of memory (neither SQL or our application). We tri...

Linq filter issue involving a varchar(1) field

I have a field in my database that is varchar(1). I'm not permitted to change it. The only values for this field are 0 or 1. Here is the where clause of the linq query: where g.id_Group == idGroup && a.AccountOpen.Value == '1' My linq query generated the following sql where clause WHERE ([t1].[id_Group] = 1234) AND (UNICODE([t0].[A...

Is using multiple tables an advisable solution to dealing with user defined fields?

I am looking at a problem which would involve users uploading lists of records with various field structures into an application. The 2nd part of this would be to also allow the users to specify fields to capture information. This is a step beyond anything ive done up to this point where i would have designed a static RDMS structure mys...

String Encoding Issue

Hi guys, I am having a very weird issue in the way strings get stored in my database, and as a result, I am getting these "unterminated string literal" errors in Javascript. Here's an overview of what I am doing: Platform: C#/ASP.NET MVC 1.0, SQL Server 2005, SparkViewEngine, YUI 2 In my view, I serialize an object into a JSON data ...

SQL Server Best way to create a summary view from multiple views

Given I have the following view where N=1..100 detail_view_N Pant Quantity Fieldx ... A 20 A 13 B 4 Currently we have summary views which insert to a table like summary_view_N Report_Name Plant Count summary_view_1 A 2 summary_view_1 B 1 The table is then used to create an overall summary l...

How can I pull a list of ID's from a SQL table as a comma-separated values string?

I have to pull a list of integer IDs from a table using only records that match some criteria. For example: Select ProdID From Products Where (ProdType='XYZ'); The catch is that I have to return it as a set of comma separated values so I can use it to select items in a multi-select list: 111,231,554,112 rather than as records. I d...

sql server fields with most usage

is there an sql query that can give me the fields that are used in most stored procedures or updated, selected most in a given table. I am asking this cause i want to figure out which fields to put indexes on. thanks ...

Question on how to read a SQL Execution plan

I have executed a query and included the Actual Execution Plan. There is one Hash Match that is of interest to me because it's subtree uses a Index Scan instead of an index seek. When I mouse over this Hash Match there is a section called "Probe Residual". I had assumed that this is whatever values I am joining on. Am I correct here ...

Can LINQ To SQL generate invalid SQL?

I have two tables that I am using Linq to SQL with. The tables have a 1 to many association. The important part of the database schema is as follows: Camera: Id (int) SerialNumber (string) ... CameraCalibration Id (int) CameraFk (int) ... Using LINQ to SQL I can obtain a list of all Camera Calibrations for cameras with 10...

What is the Initial size of newly created database in SQL Server?

What is the Initial size of newly created database in SQL Server before specifing size for mdf/ldf? ...

SQL Server NOLOCK keyword

When a SQL client issues the following command: select * into tbl2 FROM tbl1 (nolock) WHERE DateCreated < '2009/01/01' does it mean that the command won't lock tbl1 or it won't be blocked by other uncommitted transactions made to tbl1? Update: [NOLOCK]: Specifies that dirty reads are allowed. No shared locks are issued to prevent o...

SQL Server - reset identity field

Hi, I have a table with a identity column. I need to reset that identity column from zero. What should i do for this. ...

SQL Server 2008 - FileStream - Disabling 8.3 name and last access time for files

I am trying to configure SQL Server 2008 filestream in my machine by following the below article :- http://msdn.microsoft.com/en-us/library/cc949109(lightweight).aspx The article says one should disable 8.3 names and the last access for files in windows for performance reasons before proceeding to the SQL Server changes for enabling fi...

SSIS: Get Excel file's sheets programatically

My app generates SSIS packages for importing data from Excel files. This is done programatically, using C# . Before the package is generated, there's a setup step, in which I allow the user to select, from a template Excel file, the sheet name and columns to import. (Basically what you would normally do if you were manually building the...

Query SQL with like operator from two tables

How can I do a SQL query with the like operator from two different tables? I need something like: select * from table1 where name like %table2.name It's not a common field but a substring of a field on another table. ...

Cache Persistence

Hello, I am using the Asp.Net Caching mechanism for a highly frequent changing web app. the cache holds chat participants and their messages, and it needs to keep track of participants presence. Data is changing very frequently, participants go in and out, and messages are sent and recieved. The cache provides me with solutions for: ...

Trouble with my SQL join/group by/cursor question

Hi, I've made database design for a small CRM system. It comprises of Companies and Meetings (amongst others). Companies has the fields: ID (primary, auto_inc) Name (text) Meetings has the fields: ID (primary, auto_inc) CompanyId (link to Companies.ID) WhenTime (datetime, to store when the meeting was) Notes (text about the meeting) ...

ReorderList Problem with 2 ajax controls on the same page

Hi there, I have a page with a ajax accordion and a ajax reorder list. both have inputs with ReqiredFieldValidators. there 2 insert buttons for each of them. I use javascript to disable ReqiredFieldValidators when user use each of them. for eaxmple if user is trying to add data to accordion, the javascript function disbales the ReqiredF...

What are the strategies to achieve performance for both reads and writes to Sql Server?

Hi, I'm a novice, both here at stack overflow as well as on sql server, so please let me know if this question is not appropriate in any way :) Well, I'm developing a web application that will be used to analyze large amounts of data, which is stored in a SQL Server 2008 database. The interface will not allow the users to update or inse...

Which encoding does Microsoft SSIS use to output flat files in Unicode?

Hi, In the Flat File Connection Manager screen there is a checkbox to specify that the file is encoded as Unicode, but there is no way to tell which encoding will be used (UTF-8, UTF-16, ...) Is there an official Microsoft resource as to which encoding is used? Kind regards ...