Viewing 15 posts - 106 through 120 (of 394 total)
Try this...
--== TEST DATA ==--
SET DATEFORMAT DMY -- Assumes 09 = day, 01 = month
DECLARE @testing AS TABLE (
TargetStartDate DateTime,
TemporaryAssignmentEndDate nvarchar(255)
)
INSERT INTO @testing VALUES ('01 Aug...
August 13, 2013 at 12:08 pm
Try this:
DECLARE @testing AS TABLE (
AgentID INT,
ExcepCodeDetailName VARCHAR(10),
Detail_Start_Time DATETIME,
Detail_End_Time DATETIME
)
INSERT INTO @testing (AgentID, ExcepCodeDetailName, Detail_Start_Time, Detail_End_Time) VALUES (12345, 'Break', '2013-08-06 09:00:00', '2013-08-06 09:10:00')
August 13, 2013 at 11:55 am
You can use Jeff Moden's 8K splitter (from this site) to create a table object containing the comma-separated values & then inner join this to the query to filter the...
August 13, 2013 at 11:06 am
If it's an import process, are you inserting rows on a table with a trigger that divides something?
August 5, 2013 at 12:19 pm
Try this:
SELECT
HST_Currents.Timestamp_ID, Devices.name, Topics.short_name, Topics.name AS Expr1, Topics.short_units, Topics.description,
HST_Currents.Original_Value,
convert(varchar, DATEADD(s,(HST_Currents.Timestamp_id - 624511296000000000) / 10000000,'19800101'), 126) AS TimeStampDateTime
FROM Devices INNER JOIN
HST_Currents ON Devices.local_Device_ID = HST_Currents.Device_ID INNER JOIN
LoggedItems ON Devices.local_Device_ID =...
August 2, 2013 at 1:14 pm
Syntax should be like this:
insert into [e_onenew].[dbo].[Users]
(
[User_Id],
[Customer_Id],
[User_Name],
[Preferred_Name],
[Email],
[Mobile_Phone_1],
[Mobile_Phone_2],
[Mobile_Phone_3],
[Phone_1_Status],
[Phone_2_Status],
[Phone_3_Status],
[Password],
[REMINDER_QUESTION],
[REMINDER_ANSWER],
[Registration_Date],
[Registered_By],
[Approval_date],
[Approved_by],
[Last_UpdateD],
[Last_Updated_By],
[Last_Sign_On_Tel],
[Last_Sign_On_SMS],
[Last_Sign_On_IB],
[Status],
[approved],
[block],
[TryCount],
[user_flg],
[ex_flg]
)
SELECT [User_Id],
[Customer_Id],
[User_Name],
[Preferred_Name],
[Email],
[Mobile_Phone_1],
[Mobile_Phone_2],
[Mobile_Phone_3],
[Phone_1_Status],
[Phone_2_Status],
[Phone_3_Status],
[Password],
[REMINDER_QUESTION],
[REMINDER_ANSWER],
[Registration_Date],
[Registered_By],
[Approval_date],
[Approved_by],
[Last_UpdateD],
[Last_Updated_By],
[Last_Sign_On_Tel],
[Last_Sign_On_SMS],
[Last_Sign_On_IB],
[Status],
[approved],
[block],
[TryCount],
[user_flg],
[ex_flg]
from [e_one].[dbo].[Users]
August 1, 2013 at 5:37 am
I've never seen any convention on this. It's best to give a DB a short meaningful name with no spaces. Sometimes DB names may be for example suffixed...
July 31, 2013 at 3:13 pm
SELECT DISTINCT will only drop rows where all column values in the select statement are the same as another row. None of your sample rows matches any other, so...
July 31, 2013 at 3:00 pm
ChrisM@Work (7/30/2013)
JAZZ Master (7/30/2013)
Revenant (7/30/2013)
L' Eomot Inversé (7/29/2013)
crookj (7/29/2013)
sing4you (7/29/2013)
L' Eomot Inversé (7/29/2013)
The Dixie Flatline (7/29/2013)
JAZZ Master (7/29/2013)
Daniel Bowlin (7/29/2013)
achepain
gain
loss
profit
Seer
Sear
Sears
Craftsman
Crofter
Bonxie
July 30, 2013 at 11:38 am
Yopu can user ROW_NUMBER() to do this - something like this:
select *
from
(
select
row_number() over (partition by item order by version desc) as xrow,
version,
...
July 13, 2013 at 2:36 pm
Is your real query more complicated than this?
If so, the table alias you're using could be out of scope.
If you post the query we can take a look at it.
July 10, 2013 at 7:53 am
If you use DISTINCT it will remove rows from the result set where all selected columns are equal. In this case, the Stack Id is the same but the...
July 10, 2013 at 7:37 am
Have you tried dynamic SQL?
Something like this:
declare @sql nvarchar(max),
@Startdate nvarchar(10),
@Enddate nvarchar(10);
set @sql = 'select * from #table1';
set @Startdate = '01/01/1900';
set @Enddate = '01/01/1900';
if @Startdate is not...
July 10, 2013 at 6:51 am
It's so full of spelling errors it's difficult to say
e.g. 'priamrykey' in users table definition won't compile.
Can you correct the typos & give a bit more detail about the error?
July 10, 2013 at 4:09 am
Duplicate thread I think...
http://www.sqlservercentral.com/Forums/Topic1470907-391-1.aspx
July 8, 2013 at 4:48 am
Viewing 15 posts - 106 through 120 (of 394 total)