This is the case.
There are 3 tables - state, region and city. If I delete a state with the name "France", I want that all regions and cities belonging to this state be deleted as well. How to do this in T-SQL?
...
I prefer working with DateTime.MinValue, even if I use SqlServer as backend.
Is it possible to make EntityFramework to convert from DateTime.MinValue to 1753-01-01 when saving entities and convert back to DateTime.MinValue when fetching them?
Edit: I do not want to use DateTime? (nullable value type)
...
I am using an SQL connection string with SqlClient.SqlConnection and specifying Connection Timeout=5 in the string, but it still waits 30 seconds before returning failure. How do I make it give up and return faster? I'm on a fast local network and don't want to wait 30 seconds. The servers that are not turned on take 30 seconds to fai...
I know that the parameter limit for Sql server is 2100. I am wondering if there is such a limit for MS Access database. Anyone knows about it?
...
I have a stored procedure with a few steps. Two of the steps require the use of a DECLARE TABLE but I do not require these tables at the same time.
The tables both have 2 BIGINT columns and may have up to 100 rows.
Is it better practice to declare the two tables or to DELETE and re-use one?
EDIT: If you're interested, this is a follow...
I have an application in which I have to insert in a database, with SQL Server 2008, in groups of N tuples and all the tuples have to be inserted to be a success insert, my question is how I insert these tuples and in the case that someone of this fail, I do a rollback to eliminate all the tuples than was inserted correctly.
Thanks
...
I have SQL Server 2005 Standard Service Pack 2 9.00.4053.00 (Intel X86)
Table has close to 30 million rows..
If I do
SELECT GETDATE(), * FROM
<table>
Identical Date and time value is returned including milliseconds part.. though query took more then 3 minutes to complete...
I have already read
http://sqlblog.com/blogs/andrew_k...
I am reading Grant Fritchey's excellent book, SQL Server Execution Plans. On pg. 21 he states, "When a query is submitted to the server, an estimated execution plan is created by the optimizer. Once that plan is created, and before it gets passed to the storage engine, the optimizer compares this estimated plan to the actual execution pl...
In SQL server, do null values occupy less space than non-null values, or is null represented as a flag indicating that no value is stored (and thus actually requiring MORE space to store null values).
The comparisons would not be null values vs. not null values stored in the same column, but null values stored in a nullable column and a...
I need to call a stored procedure through nhibernate. But I did not know it make.
I have simple stored procedure:
CREATE PROCEDURE InsertDoc
@Name nvarchar(50),
@Author nvarchar(50),
@Link nvarchar(50)
AS
INSERT INTO documents(name, date, author, doclink)
VALUES(@Name, CURRENT_TIMESTAMP, @Author, @Link)
I do th...
Hi,
We need to access a custom ATL COM server from SQL server 2008. Ideally we want the COM server to live on a separate machine since it is part of a larger software application. I know of the COM/OLE automation stored procedures that SQL provides (sp_OAXXXX) but they don't seem to accept a computer/server name for remote invocation.
...
I noticed in a code review that one developer added PRINT statements throughout many SQL Server stored procedures.
These stored procedures are executed from a ASP.NET website, using SqlClient.
Is there any performance penalty to having these PRINT statement in the code? Or will they automatically be skipped when the procs are called fr...
Given a the following table:
Index | Element
---------------
1 | A
2 | B
3 | C
4 | D
We want to generate all the possible permutations (without repetitions) using the elements.
the final result (skipping some rows) will look like this:
Results
----------
ABCD
ABDC
ACBD
ACDB
ADAC
ADCA
...
I'm trying to export the results of a SQL statement via the SQL Server Import and Export Wizard. I am receiving 2 errors:
- Copying to `Query` (Error)
Messages
Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft S...
I Need to find out what are all the applications that use my sql server.
I'm using Profiler trace to do this (if there's another way to do this I would appreciate it)
On Profiler I'm using a Replay template, and after looking at the trace result I see that there's a column called Application Name, I'm wondering if there's a way to get ...
I have two columns in a table of a SQL server DB that I would like to autoincrement when new fields are added. However, Managment Studio wont allow me to set two columns to IDENTITY. Is there some other way to do this?
...
I'm looking to find out what kind of 'create table' statement I would need to create a given table from scratch. I'm especially interested in primary key constraints, unique constraints, foreign key constraints and column names.
How would I do this in Oracle and/or SQL Server?
Oddly enough, the only connection I have to the database i...
The DB resides in SQL Server 2008 ...
I have a db that resides in a different country, i want the tables DateCreated and DateUpdated to have Date and Time of e.g. Canada/ON/Toronto time zone instead of the
time zone of US where db is located.
DateCreated has a default value GetDate() and DateUpdated has the following trigger:
CREATE T...
I have a db with many tables. Some tables have unit price column, no tax, gst and such columns. What should i do now? Should i create GST table, HST table and PST table separately. In other words, what is the standard schema of designing the tax table?
...
Background:
Enterprise application - very will written for its time in 2004.
Stack:
.NET, Heavy use of Remoting, ASMX style web services, SQL Server
Problem:
The application allows user to go through various wizards for lack of a better term, all of their actions are stored in what we call "wiz state", which is essentially XML that is...