I have a service which process emails in a mailbox and once processed, stores some information from the email in the database. At the minute the schema looks something like:
ID
Sender
Subject
Body (result of being parsed/stripped to plain text)
DateReceived
I am building a web front-end for the database and the main purpose of storin...
Background
I am in the process of creating an application (referred to as MyApp) which must read data out from a SQL Server database handled by Navision. Navision users should to be able to use my application, without modifying permissions in the database.
Navision's handling of permissions seems to be on the application layer. It perf...
Hello,
How do i partition existing table in SQL Server 2005/08 ? I couldn't find a better clue on it.
...
Hi,
We are store string values in a database using varBinary type using c# and BinaryFormatter.We convert to byte array and then we save to DataBase
public static byte[] ToBytes(stringvalue)
{
if (value == null)
return null;
byte[] inMemoryBytes;
using (MemoryStream inMemoryData = new MemoryStream())
{
new BinaryFormat...
I've have this strange problem when adding a column to an existing table.
The existing table looks like :
CREATE TABLE [BinaryAssets].[BinaryAssets](
[BinaryAssetId] [int] IDENTITY(1,1) NOT NULL,
[BinaryAssetStructureId] [int] NOT NULL,
[Name] [nvarchar](max) NOT NULL,
[Created_By] [int] NOT NULL,
[Created_On] [bigint] NOT NULL,
...
I have a small application which has around 38 tables in the Database (SQL Server 2000/2005). Now i would like to know how much data (in KB's/MB's not records) they are taking using T-SQL.
Saying in better way i would like to do analysis of entire database. Is that possible? How ?
Thanks All,
...
I have a table that represents a user's subscription to our system. I have two tables. One represents the subscription for an account and the other represents the type of subscription. The subscription table relates to the subscription type table with a subscriptionTypeID field in the subscription types table. I need to figure out the da...
Hi all.
This involves data replication, kind of:
We have many sites with SQL Express installed, there is an 'audit' database on each site that has one table in 1st normal form (to make life simple :)
Now I need to get this table from each site, and copy the contents (say, with a Date Time Value > 1/1/200 00:00, but this will change o...
We have built a C# framework that all data modifications to our database should go through. We do not want anyone to make data changes directly to the database. All changes must go through our framework.
My question is how to enforce this? How can we have SQL Server only allow Insert/Update/Delete statements that are being made from our...
I need to select first (let's say) 10000 rows in database and return them. There may be more clients that do this operation at one time. I came up with this query:
update v set v.batch_Id = :batchId
from tblRedir v
inner join (
select top 10000 id
from tblRedir
where batch_Id is null
...
Running php 5.2.5 on Windows Server 2003 (64 bit) and connecting to SQL Server 2008
Having issues getting datetime fields from SQL Server using mssql_query. Any datetime field that I query returns nothing. All other fields in the query are correct, but the datetime fields are blank.
We switched from PEAR DB to mssql_ functions recentl...
How to replace text in sql server 2000 in a ntext column with more than 4000 characters? conversion to nvarchar(max) does not work as it truncates values.
...
I am just wondering if it is possible to call multiple SQL scripts from a single startup.sql script.
i.e.
StartUp.sql calls:
CreateDatabase.sql
CreateStoreProcedureFirst.sql
CreateStoreProcedureSecond.sql
InsertDummyValues.sql
otherscripts.sql... etc
At the moment I am loading and running each file one at a time.. there are more scri...
For example, if I drop a table then roll back the transaction is the table recreated?
What are the limits to the schema changes that can be made in a transaction?
If the above depends on the version of Sql Server, please say so...
Background
I am thinking of using some “select into” statements to create tables and then need to drop AL...
SQL Gurus --
Our architecture consists of multiple customer databases to a common codebase. When we deploy database changes, the scripts must be run agianst each database.
Because of deployment issues, there have come times when our stored procedures became out of sync with one another. I would like to create a script to return these m...
What are the advantages and disadvantages of using the nvarchar(max) vs. NText data types in SQL Server? I don't need backward compatibility, so it is fine that nvarchar(max) isn't supported in older SQL Server releases.
Edit: Apparently the question also applies to TEXT and IMAGE vs. varchar(max) and varbinary(max), for those searching...
By default SQL Server JDBC driver returns result set of all SELECT query executed in a stored procedure. I have to call CallableStatement.getMoreResults() and close all of them. I do not want any result set as return value when executing SQL Server stored procedurel; are there any ways to prevent returning result set when executing SQL S...
I have been trying out a few index views and am impressed but I nearly always need a max or a min as well and can not understand why it doesn't work with these, can anyone explain why?
I KNOW they are not allowed, I just can't understand why!!! Count etc. is allowed why not MIN/MAX, I'm looking for explanation...
...
I've decided that I'll use 8601 datetimes for all the datetimes that I return from my app. Suddenly, in one particular proc, getdate() isn't returning a datetime with a T in the middle. I should also mention that I'm converting the set containing a datetime to XML using FOR XML PATH. Typically when I convert a table containing datetime t...
When I try to make a new data connection from a Visual Studio 2008 to a database on SQL Server 2008, it fails. It says, it supports SQL Server connections up to SQL Server 2005 version only.
What is missing in my installation? Or where are settings I should change?
...