Is there a way to tell SQL server to use specific default seed value for IDENTITY columns - assuming the (to be run) CREATE TABLE statements do not specify one? I don't really care about altering existing data or altering the seed values for specific IDENTITY columns. I want the same seed for all newly created identity columns. Assume I ...
Anytime I use 'script table as' -> 'Insert To' (or other command), the script generated automatically places the database name in the script. Such as:
INSERT INTO [DatabaseName].[dbo].[tblToBeInserted] ...
While not a huge problem to just delete it, it has slipped by a few times and the script breaks if run on a different server with a...
ok now i am using the SQL database to get the values from different tables... so i make the connection and get the values like this:
DataTable dt = new DataTable();
SqlConnection connection = new SqlConnection();
connection.ConnectionString = ConfigurationManager.ConnectionStrings["XYZConnectionString"].Connectio...
Imagine a table that has two fields, a smalltimedate and an int and about 1000 rows of data. What I'm attempting to do in query is to find the average of the INT field for rows between 3/3/2010 - 3/13/2010 and only if the entry is between 6:00am - 11:00pm.
I tried
between '2010-03-03 06:00 AND 2010-03-13 23:00'
However that only rest...
I'm trying to do a single row insert/update on a table but all the examples out there are for sets.
Can anyone fix my syntax please:
MERGE member_topic ON mt_member = 0 AND mt_topic = 110
WHEN MATCHED THEN UPDATE SET mt_notes = 'test'
WHEN NOT MATCHED THEN INSERT (mt_member, mt_topic, mt_notes) VALUES (0, 110, 'test')
Resolution per ...
Hello,
I have been searching the blogs and articles but I have not found much support for this scenario. I have been poking around EF and realized that I could create views that contained data from multiple databases and then build the EF object model off of those views. Although it works I am not sure about the usual issues of performa...
I'm interested in making a generic tool to log database calls in ASP.Net by page so I need the stack trace as well. Idea is similar to http://l2sprof.com/, but for straight ADO.Net. Essentially I want to make a tool I can add to any project that can generate some statistics by page/class of # of calls and what calls are made so I can g...
At my job, we have pseudo-standard of creating one table to hold the "standard" information for an entity, and a second table, named like 'TableNameDetails', which holds optional data elements. On average, for every row in the main table will have about 8-10 detail rows in it.
My question is: What kind of performance impacts does this ...
Let's say I have two database instances:
InstanceA - Production server
InstanceB - Test server
My workflow is to deploy new schema changes to InstanceB first, test them, and then deploy them to InstanceA.
So, at any one time, the instance schema relationship looks like this:
InstanceA - Schema Version 1.5
InstanceB - Schema Vers...
I want to rethrow same exception in sql server that has been occured in my try block.
I am able to throw same message but i want to throw same error.
BEGIN TRANSACTION
BEGIN TRY
INSERT INTO Tags.tblDomain
(DomainName, SubDomainId, DomainCode, Description)
VALUES(@DomainName, @SubDomainId, @Domai...
Hi there,
I am wanting to sync data between a SQL 2008 DB and some SQL CE.
It's only a one way requirement, so when data is updated in the main SQL server the updates are sent to the CE databases.
Is this easy to setup with the sync framework. I was able to find a demo, however I couldn't compile it.
...
Hi there,
I am currently building a webshop for my own where I want to increment the product-stock when the user fails to complete payment within 10 minutes after the customer placed the order. I want to gather information from this thread to make a design decision.
I am using SQL Server 2008 and ASP.NET 3.5. Should I use a SQL Server ...
I want to call this procedure that sends one value that can be NULL or any int value.
SELECT DomainName, DomainCode FROM Tags.tblDomain WHERE SubDomainId =@SubDomainId
I simply want to use this single query rather than what i m doing right now in below given code.
I searched for this how could i do this then i got this Link.
Accordi...
I have a table which has employee relationship defined within itself.
i.e.
EmpID Name SeniorId
-----------------------
1 A NULL
2 B 1
3 C 1
4 D 3
and so on...
Where Senior ID is a foreign key whose primary key table is same with refrence column EmpId
I want to clear all rows f...
Hi folks,
I've got the following deadlock graph that describes two sql statements that are deadlocking each other. I'm just not sure how to analyse this problem and then fix up my sql code to prevent this from happening.
Main deadlock graph
Click here for a bigger image.
Left side, details
Click here for a bigger image.
Right sid...
I'd like some suggestions for online resources (blogs, guides, etc - not forums) to help me become good at designing high performance SQL Server databases that operate with large amounts of data and have heavy loads in terms of data turnover and queries per minute.
Suggestions?
EDIT
The load I'm talking about is mainly in terms of dat...
I have a JOB table, with two interesting columns:
Creation Date
Importance (high - 3, medium 2, low - 1).
A JOB record's priority calculated like this:
Priority = Importance * (time passed since creation)
The problem is, every time I would like to pick 200 jobs with highest priority, and I don't want to resort the table. Is t...
I used SQL Server 2005 for my small web application. I Want pass parameters to SP .
But there is one condition. number of parameter that can be change time to time.
Think ,this time i pass name and Address , next time i pass name,surname,address ,
this parameter range may be 1-30 ,
...
I am a PHP programmer. I have no .Net coding experience (last seen it 4 years ago). Not interested in code-behind model since this is a quick temporary hack.
What I am trying to do is generate an output.txt file whenever the user submits new data. So an output.txt file if exists should be replaced with the new one.
I want to write dat...
The basic setup is classic - you're creating a Windows Forms application that connects to a DB and does all kinds of enterprise-y stuff. Naturally, such an application will have many users with different access rights in the DB, and each with their own login name and password.
So how do you implement this? One way is to create a DB logi...