Viewing 15 posts - 1,531 through 1,545 (of 2,645 total)
If you haven't already created an index on your temporary table it might speed processing up if you add one before doing this update:
CREATE INDEX IX_#party_id_1 ON...
June 24, 2019 at 3:16 pm
Jonathan/Thom, You both are right actually. We have many scripts with dates in dd/mm/yyyy and yyyy-mm-dd format. Plus we have to change few staff members login to English login...
June 24, 2019 at 3:10 pm
As you discovered, you can't index a View that has a UNION
in it. In truth, if you need this type of design it does indicate a design flaw;...
June 24, 2019 at 2:07 pm
Languages are there for a reason, and they do have impacts on "simple" things such as the date here. The important part is that you code appropriately and therefore...
June 24, 2019 at 1:58 pm
I have run your script and this is the result I got, so, not sure how you got that error. 2019-01-31 00:00:00.007
Try this:
set language french;
use tempdb;
declare...
June 24, 2019 at 1:46 pm
I would just change the language of the login to from British to English to fix it though.
Is that really the solution? Applications, and code, should be...
June 24, 2019 at 1:39 pm
Jonathan, Is this a change in SQL2016? Because the format yyyy-mm-dd behaves perfectly fine in SQL 2008 R2. I ran your set of correct/incorrect ones and the output changes...
June 24, 2019 at 1:16 pm
Just use a custom function as a constraint:
CREATE FUNCTION dbo.chkTestSplitOwnership (@Item int, @Owner char(1))
RETURNS int
AS
BEGIN
DECLARE @retval int=0
SELECT @retval =1
WHERE...
June 24, 2019 at 1:11 pm
Use '20180801' instead of '2018-08-01'
If the columns on your table were datetime2 then it would also correctly convert the format you are using.
set language british
/* CORRECT CONVERSION...
June 24, 2019 at 12:19 pm
I've done this but not the way you want. It's super simple, though. Create another database, move your large table to that, and create a synonym in the original...
June 14, 2019 at 9:56 am
Just replace TestTable with your table name.
DECLARE @TABLE_NAME sysname
SET @TABLE_NAME = 'TestTable'
SELECT @TABLE_NAME,
STUFF((SELECT ', ' + COLUMN_NAME
...
June 13, 2019 at 4:19 pm
I got duplicates, so I was trying to create CTE's
There weren't any duplicates in the results of the code I supplied.
June 13, 2019 at 9:48 am
Thank you but it didnt work !
Do you want to be more specific, maybe say what didn't work?
June 13, 2019 at 12:34 am
You really should read this before you post a question How to post data/code on a forum to get the best help
Here is a script that will set up...
June 11, 2019 at 7:22 pm
Another way to do it (it's just a modified version of ScottPlecher's good method):
;WITH CTE AS
(
SELECT *
...
June 11, 2019 at 4:40 pm
Viewing 15 posts - 1,531 through 1,545 (of 2,645 total)