Viewing 15 posts - 1,036 through 1,050 (of 6,036 total)
declare @Year varchar(10) = '16'.
select *
FROM test1 t1
INNER JOIN test t2 WHERE t2.col LIKE '%-' + @Year
WHERE t1.Col LIKE @Year + '-%'
December 7, 2016 at 7:07 pm
You must have the derived table joined to something else.
It may cause all sorts of issues which I don't see the reason to list.
If you post the whole query and...
December 7, 2016 at 7:01 pm
Index name is not a really good indicator of index existence.
You may have many identical indexes, all with different names.
To check if an index with the same structure as you...
December 7, 2016 at 6:51 pm
Is it what you're after?
IF OBJECT_ID('Proc2') is null
exec ('CREATE PROC Proc2 as SELECT 1 as One')
GO
ALTER PROC Proc2
AS
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL
SELECT * FROM #TempTable
GO
IF OBJECT_ID('Proc1')...
December 4, 2016 at 8:03 pm
The code defines only the metadata.
Apart from metadata there is user data in any table.
What happens to it when you execute "create or alter"?
What if the code does not contain...
November 30, 2016 at 10:49 pm
ZZartin (11/29/2016)
This depends on source and target and how the information is being used. I would consider a surrogate key anything that is generated in the target system as...
November 29, 2016 at 2:24 pm
dalland (11/28/2016)
Sergiy (11/28/2016)
Would you agree with such definition of the surrogate key?No I would not a agree, as I already explained.
You mean this?
The essential feature of a "natural" key is...
November 28, 2016 at 10:15 pm
dalland (11/28/2016)
November 28, 2016 at 6:09 pm
dalland (11/28/2016)
All data in a database consists of "artificial" symbols assigned by machines or human beings. There are no exceptions. In that very broad sense keys are always surrogates for...
November 28, 2016 at 3:29 pm
dalland (11/28/2016)
Some very familiar examples of potential business keys are: login names, invoice numbers, order numbers, flight numbers, vehicle registrations.
1. Not sure what login identifies, apart from login itself....
November 28, 2016 at 6:18 am
If you think of it, those SSN, NIN, tax registration numbers, etc., are not natural keys, they all are artificial numbers, auto-generated by some kind of computing system.
They are the...
November 28, 2016 at 5:56 am
RonKyle (11/27/2016)
In most cases there isn't one.
I really have trouble understanding why you would say that.
Ok, I'll change it to "in many cases." My point was that it seems...
November 28, 2016 at 3:02 am
One of the biggest questions here is - how do you query the table?
Can you post one of the typical queries which use a filter on that datetimeoffset column?
November 27, 2016 at 2:47 pm
RonKyle (11/23/2016)
What is you natural key for "person" records?
In most cases there isn't one. I would certainly never use an SSN for this. But that doesn't mean that...
November 25, 2016 at 1:36 am
"10 tables, 3000 rows" is not the scale which could possibly justify choice of such an expensive (in all meanings) tool as SQL Server.
It's not even enough for Access.
An Excel...
November 24, 2016 at 7:49 pm
Viewing 15 posts - 1,036 through 1,050 (of 6,036 total)