Viewing 15 posts - 946 through 960 (of 3,482 total)
This might help:
https://stackoverflow.com/questions/3560173/store-arabic-in-sql-database
You have to change the collation for the various columns and use NVARCHAR() and NCHAR() because you need Unicode support.
May 21, 2019 at 8:22 pm
If you have a table for the times
CREATE TABLE HoursList (
HourNumber TINYINT PRIMARY KEY
, TimeSpan VARCHAR(10) NOT NULL
);
Then you insert values for each
INSERT INTO HoursList(0, '12 AM-1 AM'),(1,'1 AM -...
May 21, 2019 at 3:44 pm
SELECT y.EventDate
, y.EventHour
, COUNT(*) AS Freq
FROM
(SELECT x.EventDate,
DATEPART(hour,x.EventTime) AS EventHour
FROM
(SELECT '05/17/2019' AS EventDate, '00:51:39.0000' AS EventTime, 1 AS CallCount
UNION ALL
SELECT '05/17/2019', '06:54:34.0000', ...
May 20, 2019 at 6:27 pm
DATEDIFF with a CASE statement should do it.
May 14, 2019 at 4:46 pm
Why not just create a stored procedure to accept two parameters and then do two inserts? Sounds to me like you're making this waaaay more complicated than it should be.
May 9, 2019 at 10:56 pm
Any reason you couldn't take this and turn it into an INSERT statement into a table somewhere?
SELECT TOP 10
GETDATE() AS EventDate,
qs.total_worker_time/(qs.execution_count*60000000) as [Minutes Avg CPU Time], ...
May 9, 2019 at 9:29 pm
Can't help but wonder if the Top 5 change during the day/week. If so, it would make sense to include the execution date/time with the query name in the table....
May 9, 2019 at 8:47 pm
Maybe this? You don't need FILTER() if you are comparing a column value to a constant. You would need it if you were comparing a column to an aggregate.
May 6, 2019 at 8:25 pm
Something like (make a backup of the table or wrap the update in a transaction so you can roll it back...)
UPDATE EmployeeTable
SET EMailAddress = otherTable.EMail
WHERE EmployeeTable.FieldX = OtherTable.FieldY
Basically, you do...
May 3, 2019 at 7:25 pm
If you have only one value per month, then you can use LAG([Inventory],1) OVER (ORDER BY DateArchived) AS PrevValue
and then compare. Maybe easier to do it in T-SQL.
May 1, 2019 at 4:53 pm
Use a Calendar table maybe?
April 30, 2019 at 11:12 pm
Maybe this will help?
You could use multiple REPLACE functions
use tempdb;
go
CREATE TABLE TheReplacements(
Search_Value VARCHAR(15) PRIMARY KEY
, Replace_Value VARCHAR(15) NOT NULL
);
GO
INSERT INTO TheReplacements (Search_Value, Replace_Value)
VALUES ('Timothy','Tim'),('Kathleen','Kathy'),('Joseph','Joe'),('Michael','Mike');
CREATE TABLE People (
PersonID...
April 29, 2019 at 9:40 pm
Oh! I knew it had to be easier than I was making it!
April 29, 2019 at 4:52 pm
For grins, I wrote this in VB.NET (well, sort of)
Public Function FormattedDate (ByVal dtInputDate As Date, ByVal blnShort As Boolean) As String
Dim m As Byte
Dim...
April 27, 2019 at 6:40 am
From what I've read, Language is a report-wide setting. So the only way I could think of doing it is to use either SWITCH or a lookup.
I sort of got...
April 27, 2019 at 4:53 am
Viewing 15 posts - 946 through 960 (of 3,482 total)