Viewing 15 posts - 1,336 through 1,350 (of 1,464 total)
The way to add a calculated fields is like this
CREATE TABLE dbo.Table1 (
Col1 ...
, Col2 ...
, .....
, SearchCol AS ISNULL(Col50,...
November 16, 2016 at 11:10 am
Have you tried creating a non-clustered index on Col50.
November 16, 2016 at 10:43 am
This trigger should give you the desired results.
CREATE TRIGGER [dbo].[Update_ServiceNum]
ON [dbo].[Test]
AFTER INSERT
AS
BEGIN
WITH cteMaxServiceNum AS (
SELECT s.ProjectID, MaxServiceNum =...
November 16, 2016 at 4:47 am
This is a script that I use when I need to know how much space each table is using
SET NOCOUNT ON;
CREATE TABLE #temp (
...
November 10, 2016 at 11:37 pm
You need to wrap your serial/servicedate in another set of brackets
WHERE (
(t1.Serial = '00000000001' AND t1.Servicedate BETWEEN...
November 10, 2016 at 10:53 pm
Eirikur Eiriksson (11/3/2016)
DesNorton (11/3/2016)
November 3, 2016 at 3:18 am
Shredding xml is not exactly the best perfprming operation in SQL. Rather get the UI to shred the XML and pass you a TVP (table valued parameter).
If you need...
November 3, 2016 at 2:32 am
shorton2 (11/1/2016)
November 1, 2016 at 1:55 pm
shorton2 (11/1/2016)
November 1, 2016 at 1:34 pm
I tend to steer clear of the MERGE statement.
Below is a sample of doing it as separate INSERT/UPDATE statements.
--DROP TABLE #UDFTemp;
CREATE TABLE #UDFTemp (
JobNumber INT...
November 1, 2016 at 11:54 am
Without sample data, we can only guess at the outcome.
Try this for your OT calculation
CASE WHEN ( [friday] = 1 and [day] = 'Friday' )
...
November 1, 2016 at 5:30 am
Since this is SQL 2012, you could also use TRY_PARSE
SELECT
TRY_PARSE('13.2' AS DECIMAL(18,2) USING 'en-US')
, TRY_PARSE('13,2' AS DECIMAL(18,2) USING 'de-DE')
November 1, 2016 at 3:27 am
Are you able to get the source data as quoted values
SELECT ID, txt, REPLACE(val, ',', '.') AS val
FROM (
VALUES (1, '1 Value', '18,2'),
...
November 1, 2016 at 2:12 am
Eirikur's solution groups by PaymentComfirmDate.
In order to group by Year/Month, you will need to use something like this, which groups by the 1st of every month.
-- ...
MonthYear = DATEADD(mm, DATEDIFF(mm,...
October 31, 2016 at 2:06 am
Viewing 15 posts - 1,336 through 1,350 (of 1,464 total)