Viewing 15 posts - 151 through 165 (of 206 total)
I couldn't figure out how to get mine to work with the new data so I modified Lamprey13's.
I think this will work.
CREATE TABLE #test (ptm_id INT, wl_id INT, [date] date,...
July 31, 2009 at 1:55 pm
I think I broke both of them:
CREATE TABLE #test (ptm_id INT, wl_id INT, [date] date, cancellation CHAR(1))
INSERT INTO #test VALUES (1, 203, '01/08/09', 'C')
INSERT INTO #test VALUES (1, 203, '01/20/09',...
July 31, 2009 at 1:37 pm
Well here is what I came up with:
CREATE TABLE #test (ptm_id INT, wl_id INT, [date] date, cancellation CHAR(1))
INSERT INTO #test VALUES (1, 203, '01/08/09', 'C')
INSERT INTO #test VALUES (1, 203,...
July 31, 2009 at 11:42 am
j.grimanis (7/31/2009)
I have the following statement
UPDATE tbl_service_models
set tbl_service_models.Maintenance_Standard_KM=20000
JOIN tbl_family on
tbl_service_models.car_family_id=tbl_family.car_family_id
where tbl_family.brand_code=6 and tbl_service_models.Maintenance_Standard_KM=15000
and I get error:
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'JOIN'....
July 31, 2009 at 8:29 am
Here is what I did. There is probably a better way but this was the first thing that came to mind.
CREATE TABLE #tblResults (participant_id INT, endTime TIME)
INSERT INTO #tblResults...
July 31, 2009 at 7:55 am
Can you change the script below to reflect the table structures you are have.
CREATE TABLE #tblContracts (Contract_ID INT, ControlNumber INT,
ContractStatus CHAR(1), SSN CHAR(11), IT_Code VARCHAR(5))
INSERT INTO #tblContracts VALUES (1,...
July 31, 2009 at 6:45 am
Is something like this what you are looking for:
SELECT NAME, permission_name, class_desc , OBJECT_NAME (major_id) , state_desc
FROM sys.database_permissions dp
INNER JOIN sys.database_principals pri ON dp.grantee_principal_id = pri.principal_id
July 31, 2009 at 6:15 am
It could be that the caffine is still not completely into my system yet but I am not sure what results you are expecting. Do you want multiple rows...
July 31, 2009 at 6:13 am
Here is the script with the dummy data for anyone else who might need it.
CREATE TABLE #period (period_end DATETIME, period_month INT, period_year INT)
INSERT INTO #period VALUES ('07/26/09', 12,...
July 31, 2009 at 6:05 am
It's early but here is a quick shot.
Select @LOSS_TA = sum(CASE WHEN I.IT_CODE = 'TA' THEN 1 ELSE 0 END),
@LOSS_SRIP = SUM(CASE WHEN I.IT_CODE = 'SRIP' THEN...
July 31, 2009 at 5:54 am
SELECT *
FROM sysobjects so
WHERE type = 'P' -- Stored Procedure type
AND PERMISSIONS(so.id) & 32 = 32 -- Execute rights...?
ORDER BY name
You need to specify what object you are checking the...
July 30, 2009 at 1:22 pm
I have a select statement that selects a set of records from tables, as follows:
select attrA from tableA inner join tableB on tableA.attrC = tableB.attrA where attrC =...
July 30, 2009 at 1:06 pm
Good article. Going in the bookmarks. Thanks for that.
July 30, 2009 at 6:32 am
You can use a function to get this working
IF (SELECT OBJECT_ID('tempTable')) IS NOT NULL
DROP TABLE tempTable
GO
CREATE TABLE tempTable (test int, test2 VARCHAR(10))
INSERT INTO tempTable VALUES (1, 'Test')
INSERT INTO tempTable VALUES...
July 30, 2009 at 6:23 am
CREATE TABLE #temp (test INT)
INSERT INTO #temp values (1111)
INSERT INTO #temp values (22222)
INSERT INTO #temp values (333333)
INSERT INTO #temp values (4444444)
INSERT INTO #temp values (55555555)
INSERT INTO #temp values (666)
SELECT REPLICATE('0',8-LEN(test))+CONVERT(VARCHAR,test)...
July 30, 2009 at 6:13 am
Viewing 15 posts - 151 through 165 (of 206 total)