I am working on replacing an old ms access system with an SQL server one with a C# front end. Unfortunately I have some die hard ms access users who will be accessing the SQL server tables from ms access but to them it should essentially look the same.
When tables are created in ms access and a relationship is created between them they ...
SQL Server 2005. I have a table with ColumnA bit, ColumnB int
Can I add a default value to ColumnB so that ColumnB is 15 if ColumnA is 1 and ColumnB is 0 if ColumnA is 0?
I know I could do this with a trigger but I my boss is prejudice against triggers (he needs trigger sensitivity training).
...
I've been tasked with getting two MS SQL based products to synchronize. My predecessor was content to match records based on a combination of name and address, but both systems have a GUID, and only one is actually using it. So my thought was to match up my existing records and copy the GUID from one database to the other. But I can't se...
Consider a database server whose job today is to house one database. Likely the database will be moved in the future to another database instance which houses multiple databases & schemas.
Let's pretend the app/project is called Invoicer 2.0. The database is called AcmeInvoice. The database holds all the invoice, customer, and product i...
Hi all,
im having major issues trying to mirror our newly upgrade database solution (to GDR)... specifically the database project settings.
when i run a schema compare, i get differences on the IsTornPageProtectionOn variable, however when I go to the settings of the database project this setting is nowhere to be found!
i have tried ...
I have a Stored Procedure, Which has some select Statements and insert statements.
Is there any way , I can log the Timestamps of execution before and after the sqls inside the Stored procedure?
...
I have a storeprocedure:
CREATE PROCEDURE [dbo].[BrandDrugDetailsInsert]
@BrandDrugDetailsID uniqueidentifier OUTPUT,
@BrandDrugID uniqueidentifier
AS
BEGIN
INSERT INTO Pharmacy_BrandDrugDetails(BrandDrugID) OUTPUT INSERTED.BrandDrugDetailsID
VALUES (@BrandDrugID)
END
Anytime i try to retieve the value "@BrandDrugDetai...
I have to manage a log where i have to see the number of rows that are inserted by a transaction. Is there any way of doing it dynamically ?
...
How can we dis-connect all the active users on sql-server 2005 express using sql
...
Our database has a named database role. Our service account is a member of this role. This makes our database creation scripts simpler.
However, I'd like this role to be able to create linked servers.
If I try the following:
USE OurDatabase
GO
GRANT ALTER ANY LINKED SERVER TO OurRole
GO
...it fails with Permissions at the server sc...
hi have a record
whose hex dump is follows
00000000: 30001100 013caae4 62010000 00000000 †0....<..b.......
00000010: 00060040 02002000 5c803801 02000000 †...@.. ..8.....
00000020: 0400004d 01000000 384c0000 681f0000 †...M....8L..h...
00000030: e7010000 01000000 d03e0000 08020000 †.........>......
00000040: 01000000 385e0000 09...
How to take the backup of live sql server 2005 express DB ? At any given time some transaction are in progress.
...
I have an non-clustered index that has ~1000 pages, 95% fragmentation and a FillFactor of '0'.
I rebuilt the index on Sunday. A week later, the index has 95% (or so) fragmentation again. Is this an indication that I need to change the FillFactor to say 80-90%?
Should I be tweaking the fill factor each week to see if I can reduce the ...
Does the sequence in which we use join in a query effects its execution time ?
...
Currently we are having DB of size 10GB and it is growing by around 3GB a month. Often I have come to hear that one should from time to time rebuild the indexes so as the improve the query execution time. So how often should i re-build the indexes in the given senario ?
...
short version: the sqlsrv driver (Native Client wrapper) "eats" constraint violation errors generated from triggers; the mssql driver (ntwdlib wrapper) reports them just fine.
SQL Server 2005
PHP 5.3.1
SQL Server Driver for PHP 1.1
fixture:
CREATE TABLE t (
t INT NOT NULL PRIMARY KEY
);
CREATE VIEW v AS
SELECT CURRENT_TIMESTAMP ...
I noticed this particular line of code when I was profiling my application (which creates a boatload of database insertions by processing some raw data):
myStringBuilder.AppendLine(
string.Join(
BULK_SEPARATOR, new string[]{myGuid.ToString() ...
Bearing in mind that the resultant string is going to end up in a file called ...
UPDATE
I am dealing with a legacy database where the datetime values have been stored in a specific timezone (not UTC). Assume it is not possible to change how we are storing these values.
END UPDATE
Say I have a SQL Server 2005 database with a table as follows:
[id] (int) not null
[create_date] (datetime) not null
Suppose my [c...
i created a package in SSIS 2005. this package export my tables from sql server 2005 to text files daily. on the other hand i created another package for uploading these text files to FTP site. but the size of my text files becomes bigger and bigger day by day. i have to zip them and after that upload to FTP. would u please advise me?
t...
I have a query which joins 6 tables, produces 800,000 rows, and inserts them into a table.
I'm running this query on Sql 2005 Standard on an 8-core machine, on which there is no other workload running. The Sql service uses only one CPU core while running this query (using that CPU for 100%), and this way the query runs for almost 4 minu...