Viewing 15 posts - 10,096 through 10,110 (of 26,489 total)
Evil Kraig F (8/14/2012)
SELECT
s.[databaseid]
,s.[databasename]
,s.[filename]
,s.[filetype]
FROM
#stuff AS s
JOIN
(SELECT DatabaseID FROM #stuff GROUP BY DatabaseID HAVING COUNT(*) > 1) AS drv
ONs.DatabaseID =...
August 14, 2012 at 4:17 pm
L' Eomot Inversé (8/14/2012)
August 14, 2012 at 4:09 pm
Here is another query:
CREATE TABLE #stuff (
[databaseid]TINYINT,
[databasename]VARCHAR(50) NOT NULL,
[filename]VARCHAR(50) NOT NULL UNIQUE,
[filetype]VARCHAR(50) NOT NULL
)
INSERT INTO #stuff VALUES (1, 'games', 'game.mdf', 'data')
INSERT INTO #stuff VALUES (1, 'games', 'game.ldf', 'log')
INSERT INTO #stuff...
August 14, 2012 at 4:04 pm
Here is the updated code:
CREATE TABLE dbo.PatientInfo (
MEMBID CHAR(8),
ADMDATE DATE,
DSCHDATE DATE
);
go
INSERT INTO dbo.PatientInfo
VALUES ('06000248','08/02/2010','08/04/2010'),
('06000248','08/10/2010','08/12/2010'),
('06000248','08/20/2010','08/22/2010'),
('06000348','08/02/2011','08/04/2011'),
('06000348','08/10/2011','08/12/2011'),
...
August 14, 2012 at 3:40 pm
adonetok (8/14/2012)
But, if I inserted more values, the duplicate result will displays.
How to fix it?
INSERT INTO dbo.PatientInfo
VALUES ('06000248','08/02/2010','08/04/2010'),
('06000248','08/10/2010','08/12/2010'),
...
August 14, 2012 at 3:33 pm
Luis Cazares (8/14/2012)
SQL Server doesn't manage arrays, just sets of data (tables or results from queries).
SQL Server won't allow you to...
August 14, 2012 at 1:51 pm
First, start with the following, and be sure to read the comments, the article referenced in the comments, and the discussion that follows the article.
/****** Object: UserDefinedFunction [dbo].[DelimitedSplit8K] ...
August 14, 2012 at 1:39 pm
Not difficult. One thing you need to do is to look carefully at my code below. You notice I am creating the table, populating it with sample data,...
August 14, 2012 at 1:33 pm
Yep, just need an ORDER BY on the select statement.
August 14, 2012 at 1:17 pm
asm1212 (8/14/2012)
invoice_id rank subscriberid create date ...
August 14, 2012 at 12:59 pm
Oracle_91 (8/14/2012)
What is this error ? any idea why do we see such kind of errors?
LogWriter: Operating system error 170(The requested resource is in use.) encountered.
Error: 17053, Severity:...
August 14, 2012 at 12:29 pm
I really, really, REALLY want to ask some of these people if they even know how to think.
August 14, 2012 at 12:19 pm
This?
CREATE TABLE [dbo].[tst_Invoices](
[invoice_id] [int] NULL,
[grouo_id] [int] NULL,
[subscriber_id] [int] NULL,
[createdate] [datetime] NULL,
[duedate] [datetime] NULL
) ON [PRIMARY]
INSERT INTO dbo.tst_Invoices
( invoice_id ,
grouo_id ,
subscriber_id ,
createdate...
August 14, 2012 at 12:18 pm
asm1212 (8/14/2012)
Try this code:
CREATE TABLE [dbo].[tst_Invoices](
[invoice_id] [int] NULL,
[grouo_id] [int] NULL,
[subscriber_id] [int] NULL,
[createdate] [datetime] NULL,
[duedate] [datetime] NULL
) ON [PRIMARY]
INSERT INTO dbo.tst_Invoices
...
August 14, 2012 at 12:14 pm
Viewing 15 posts - 10,096 through 10,110 (of 26,489 total)