I have some SQL Compact queries that create tables inside of transaction. This is mainly because I need to simulate temporary tables, which SQL Compact does not support. I do this by creating a real table, and then dropping it at the end of the transaction.
This mostly works. Sometimes, however, when creating the tables Sql Compact will...
Using SQL Server 2000
My Query.
SELECT
(Format(IIf(CLng(OutTime) > 180000, CDate('18:00:00'), CDate(Format(OutTime, '00:00:00'))) - IIf(CLng(InTime) < 90000, CDate('09:00:00'), CDate(Format(InTime, '00:00:00'))), 'hh:nn:ss')) As WorkTime,
(Format(IIf(CLng(InTime) < 90000, CDate('09:00:00') - CDate(Format(InTime, '00:00:00')), ...
i have class named Group
i tried to test configuration:
var cfg = new Configuration();
cfg.Configure();
cfg.AddAssembly(typeof (Group).Assembly);
new SchemaExport(cfg).Execute(true, true, false);
when i debug this, im getting following sql:
create table Group (
ID INT IDENTITY NOT NULL,
Name NVARCHAR(255) null,
...
I have below trigger
ALTER TRIGGER [dbo].[DeleteUserData]
ON [dbo].[site_users]
AFTER DELETE
AS
BEGIN
SET NOCOUNT ON;
--delete user uploads
update my_gallery set deleted=1 where un=(select un from deleted) and subdomain=(select subdomain from deleted)
--delete user pms
delete from pms where toUn=(select un from deleted) and subdomai...
What datatype should i choose for storing an Ip Address in a SQL Server?
By selecting the right datatype would it be easy enough to filter by IP address then?
...
Hi,
I need to write some code to insert around 3 million rows of data.
At the same time I need to insert the same number of companion rows.
I.e. schema looks like this:
Item
- Id
- Title
Property
- Id
- FK_Item
- Value
My first attempt was something vaguely like this:
BaseDataContext db = new BaseDataContext();
foreach (...
Hiya all,
I've connected to database, using data set .xsr now I wan't to extract all rows in my table. Here is my table structure :
Lastname
Address
zipcode
city
country
email
So here is one example of table row entry :
Danish Morten Olsen 58b 82341 Kobenhavn Denmark [email protected]
Now I'd like for someone to tell me how can I ext...
Hi,
I've done a fair bit of mysql php programming but am pretty new to asp/access etc.
This will either be incredibly easy or impossible!
SUMMARY:
I'm trying to transfer a web application from a corporate network to an external web host for testing and don't know how to connect the pages to the database on the new server.
BACKGROUND...
I am looking for such an algorithm, but one that makes substitutions between words and not between letters. Is there such an algorithm?
I am looking for an implementation with SQL Server, but the name of the algorithm will be good enough.
...
I have this table
CREATE TABLE [dbo].[friend_blocked_list](
[subdomain] [varchar](50) NOT NULL,
[un] [nvarchar](50) NOT NULL,
[friend] [nvarchar](50) NOT NULL,
[is_blocked] [bit] NOT NULL,
[approved] [bit] NOT NULL)
where i select data from it with below query. Select query combines users that added user as friend and users that...
I'm designing a large scale web application with about 30 tables, more than 2/3 of which are related to each other. I'm using ASP.NET MVC, Linq to SQL with SQL Server 2008. These tables are meant to hold thousands of records.
As a programmer, what should I focus on to help optimize the database and the queries to and from Linq?
Do you...
how can calculate
(now) - (date in database)
...
When I select a series of rows from a sql server 2005 table using an "order by" clause and then insert them into a different (and empty) sql server 2005 table can I count on the rows staying in the same order.
The reason I am asking is that I want to manipulate the rows using ADO.net. I want the rows in a specific order to improve th...
In VB6:
I need to allow a user to select an Excel file, and then upload All Worksheets to a SQL table. I'm not sure how to do this. The format of each sheet is exactly the same. And the worksheet format matches the SQL table format.
I'm really banging my head against the wall over here. If anybody could offer a suggestion, or a cod...
SQL Server 2008 has a new try/catch structure. If I encounter an error in a sequence of nested stored procedures, I like to log the call stack in an error table. The problem is that if I have started a transaction (which will be true for operations that update the db), an records written to the error table will be removed when the code...
In SQL Server you can use an XML datatype and map it to relational columns using an AXSD schema.
Mapping between XML and relational
storage By using an annotated schema
(AXSD), the XML is decomposed into
columns in one or more tables. This
preserves fidelity of the data at the
relational level. As a result, the
hierarchi...
As part of the holiday processing some of the jobs are disabled in sql server using script.
They are not disabled manually.
Now when we see the jobs there is a check mark for enable entity.
And when we right click on the job the instead of enable thing being highlighted disable entity is highlighted.
Now we are getting doubt whether job...
Using SQL Server 2000
Table
PersonID Date
001 11-02-2009
002 11-02-2009
003 11-02-2009
001 12-02-2009
004 12-02-2009
005 12-02-2009
003 13-02-2009
005 13-02-2009
So on…,
I want to display all the Personid by Date wise.
Expected Output
PersonID Date
001 11-02-2009
002 11-02-2009
003 11-02-2009
004 11-02-2009
005 11-02-2009
001 ...
I currently have a table structure that looks something like this(some details omitted):
ColumnName || Type
Date_Of_Job DateTime
Reparied_Service Boolean
Disconnect_Service Boolean
Relayed_Service Boolean
Reparied_Stopcock Boolean
Replaced_Stopcock Boolean
TPFNR_Repaired ...
At MSDN I read:
< prefix_term >
Specifies a match of words or phrases beginning with the specified
text. Enclose a prefix term in double
quotation marks ("") and add an
asterisk (*) before the ending
quotation mark, so that all text
starting with the simple term
specified before the asterisk is
matched.
Well, tha...