User Profile
Collapse
-
SELECT * FROM DatabaseName..T ableName... -
Try this one...
--To show all the email address with missing @ symbol
SELECT * FROM MEMBERS_
WHERE EmailAddr_ Members NOT LIKE '%@%'
--To delete all the members with missing @ symbol
DELETE FROM MEMBERS_
WHERE EmailAddr_ Members NOT LIKE '%@%'...Leave a comment:
-
Can you give an example with data for TableOne,TableT wo and the Final Result
i.e. what should be the outcome Result by joining TableOne and TableTwo? so that I can help you better....Leave a comment:
-
The query is correct but for what purpose you are using
Where tblemp.balance = 0
This means it will update only records which as 'balance' as '0' in 'tblemp' table....Leave a comment:
-
The reason might be the column length in the table for particula field
will be less than the length of the string data passed....Leave a comment:
-
Try any of these....
SELECT MyTable.STORAGE _FACILITY,
MyTable.STORAGE _RECEIPT_NUMBER ,
MyTable.STORAGE _RECEIPT_SUFFIX ,
(CAST(MyTable.S TORAGE_FACILITY AS VARCHAR(10))
+ CAST(MyTable.ST ORAGE_RECEIPT_ NUMBER AS VARCHAR(10))+
MyTable.STORAGE _RECEIPT_SUFFIX )
AS MyKey,
SELECT MyTable.STORAGE _FACILITY,
MyTable.STORAGE _RECEIPT_NUMBER ,
MyTable.STORAGE _RECEIPT_SUFFIX ,...Leave a comment:
-
I used left join so if there is dept name in Tableone and not in tabletwo then the
permissionDeptN ame in tabletwo will be null.If you are not clear about this please refer the Left Join in the SQL help...Leave a comment:
-
Try this...
SELECT col_deptID AS DEPTID,col_dept Name AS DEPARTMENT,
CASE ISNULL(col_perm issionDeptName, '') WHEN '' THEN 0
ELSE 1 END AS ENABLED
FROM TableOne LEFT JOIN TableTwo
ON col_deptName = col_permissionD eptName...Leave a comment:
-
Try this...
SELECT TOP 1 COLUMNNAME FROM TABLENAME ORDER BY COLUMN NAME DESC...Leave a comment:
-
-
Try this ...
UPDATE TABLE_A
SET A_CODE = B_ID
FROM TABLE_A INNER JOIN TABLE_B
ON A_ID = B_A_ID...Leave a comment:
-
Use the below Stored Procedure as an example
--Stored Procedure to select data from the given table name parameter
CREATE PROCEDURE DYNAMICTABLENAM E
(
@TABLENAME VARCHAR(100)
)
AS
DECLARE @strSQL NVARCHAR(4000)
DECLARE @strTableName VARCHAR(100)
set @strSQL = 'select * from '
set @strSQL = @strSQL + @TABLENAME
print @strSQL
EXEC...Leave a comment:
-
use the below query
UPDATE Master417DocLis t
SET Master417DocLis t.DeaNumber = IMSxportwCATSan dSLNlinked2Mast er.dea#
FROM Master417DocLis t
INNER JOIN IMSxportwCATSan dSLNlinked2Mast er ON
Master417DocLis t.lastname = IMSxportwCATSan dSLNlinked2Mast er.[last name]
and Master417DocLis t.firstname = IMSxportwCATSan dSLNlinked2Mast er.[first name]...Leave a comment:
-
Create the below function and use it as said below.
/*This function is only for thousand separator for numbers with length 5 or 4*/
CREATE FUNCTION DBO.SEPARATETHO USANDNUM
(
@STRVALUE VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @STRRETURNVALUE VARCHAR(8000)
SELECT @STRRETURNVALUE = CASE LEN(@STRVALUE)
WHEN 5 THEN LEFT(@STRVALUE, 2)+ ','+...Leave a comment:
-
SELECT right(Descripti on,len(Descript ion) - charindex(char( 39), Description))
Here Description is the name such as "sridhar's"
char(39) = " ' "
However this will not work if you are looking for the second " ' "Leave a comment:
No activity results to display
Show More
Leave a comment: