I have a MS SQL DB with about 2,600 records (each one information on a computer.) I need to write a SELECT statement that selects about 400 of those records.
What's the best way to do that when they don't have any common criteria? They're all just different random numbers so I can't use wildcards or anything like that. Will I just hav...
Hi All,
How can I drop all the default constraints belonging to a particular table in SQL 2005?
...
Several days ago i setup some replication for our SQL Server 2005 database, the type of replication was a transactional with updateable subscription.
The replication are working fine, lately i test the upgradeable subscription feature by modifying 1 data on subscriber server but then the error was raise and data are not committed.
The ...
The question is quite simple, as the title.
Added a column to table
I want a unique constraint , the column will insert guids, but to allow for existing data before column was added I need to allow for nulls in the check
...
i want to get total number of pages in form,which is placed report viewer..(int t=int T = objReportViewer.LocalReport.GetTotalPages();)i used this code,actually report have 5 pages but got only one page
...
I have a table with single Row when i use SP_SpaceUsed N'<TableName>' it gives me data as 16 KB
and when I use dataLength something like this:-
select ClientID ,
(0 + isnull(datalength(ClientID), 1) +
isnull(datalength(LeadID), 1) +
isnull(datalength(Company_Name), 1) +
isnull(datalength(Website), 1) +
isnull(datalength(EmployeeC...
I'm using Sync Framework v1 (which includes Sync Services for ADO.NET v2) and Sync Services for mobile v1.
I can sync a SQL Compact Edition database from a mobile device to SQL Express on a desktop PC.
I can also sync a SQL CE database from a desktop PC to a SQL Server database on a web server using WCF.
I want to sync from the mobil...
Our database contains hierarchical "items". Every item has detail information inside a separate table. E.g. an item could be a folder or a file. Now I would like to export children of an item to XML. For performance reasons I would like to do this inside a SP. Of course, it's possible to write a cursor-based SP, but cursors tend to be sl...
I have a very high-traffic table with a char(50) field which takes part in several indexes. This char(50) field allows NULLS, and in that case a NULL value is considered to be the same as a non-NULL, zero-length string for my purposes.
I also disregard leading & trailing whitespace and, while I scrub the data before I insert it, it may...
Is it a good idea to store files in a different SQL Server 2005 database "FileDb" and point to it (files) in the "AppDb" by "FileId".
Please take in consideration that I have a dedicated server and I can create as many Sql Databases as I want.
update:
Which perform better single database or multiple databsae?
...
Background:
Visual studio fails at deploying a database project. It tries to drop functions that are already referenced (e.g. in a check constraint), rather than just adding the new ones and updating the existing ones, so the deployment always fails.
As a result, I'm writing my own code to update the assembly and add/update any functi...
I have a development database that has fees in it. It has a feeid, which is a unique key that is the identifier. The problem I run into is that the feeid/fee amount may not match when putting updating the table on a production server. This obviously could lead to some bad things happening, like overcharging for something or undercharg...
Ok, I'm stuck trying to figure out how to take a mail merge, use that info to make MS SQL calls and get strings back in a word document. I'm guessing VB but I have no VB experience.
...
We have a server that is running Microsoft SQL Server 2000 and would like to setup Umbraco 4.0. I tried the web install, but it choked on the MS SQL 2005 Express install. So I next tried the manual installation of MS SQL 2005 Express, which choked also with an error indicating that there was incompatibility issue because we already have ...
When I accidentally click on the Database Diagrams tab, I get one of the following errors:
Database diagram support objects
cannot be installed because this
database does not have a valid owner.
To continue, first use the Files page
of the Database Properties dialog box
or the ALTER AUTHORIZATION statement
to set the data...
I have a stored procedure that looks something like:
CREATE PROCEDURE my_procedure
@val_1 INT,
@val_2 INT
AS
SET NOCOUNT ON;
SET XACT_ABORT ON;
BEGIN TRY
BEGIN TRANSACTION;
INSERT INTO table_1(col_1, col_2)
VALUES (@val_1, @val_2);
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0
ROLLBACK TRANSACTION;
...
All the tables in my schema have a prefix of dbo. Now in my sql statements, I don't like using dbo.tablename all the time. Any workarounds or configuration changes?
...
Is it possible to add a column to a table at a specific ordinal position in SQL Server?
For instance, our tables always have CreatedOn, CreatedBy, LastModifiedOn, LastModifiedBy columns at the "end" of each table definition? I'd like the new column to show up in SSMS above these columns.
If I am scripting all my database changes, is t...
I have an xml column in SQL Server 2005 that is the equivalent of:
<Test foo="bar">
<Otherstuff baz="belch" />
</Test>
I want to be able to get the value of the foo attribute of Test (the root element) as a varchar. My goal would be something along the lines of:
select cast( '<Test foo="bar"><Otherstuff baz="belch" /></Test>' as xm...
I have SQL SERVER database that have a huge proliferation of stored procedures. In my Oracle databases it's not a problem because Oracle supports packages.
Even if SQL Server didn't support the cool features of packages like State and encapsulation, what do programmers do to get around this obvious deficiency?
...