Need Correction...
May 4, 2004
I want to display a list of member after filtering two condition...
1) Select MID from TableMember where AID value EQUAL to Dropdownlist.value
2) Select MID from TableStatus where AID NOT EQUAL to Label.Text
I try something like this... is not working... Can anyone correct the statement for me....
"Select * from VIEW1 where MID in (Select MID from TableMember where Aid='" & Ddl1.SelectedItem.Value & "') and MID not in(select Mid from TableStatus where Aid <>'" & Label.Text & "')"
Thank you...
View 3 Replies
Aug 23, 2004
Hi, I have this following procedure and I am sure on how to convert a part of the procedure. Can anyone pls help....
The function is created successfully. I have problem in calling that function n the procedure..Some syntax error...
I think, the problem is here...
UPDATE signoff SET user_name_assigned = getUserGroupName_upg(signoff_assigned_rec.user_ass igned) WHERE id = signoff_assigned_rec.id
-----------------
CREATE FUNCTION getUserGroupName_upg
(
@userId INT
)
RETURNS varchar
AS
BEGIN
DECLARE @temp varchar(520)
DECLARE @tmp_first_name varchar(520)
DECLARE @tmp_last_name varchar(520)
DECLARE @cnt INT
SELECT @cnt = COUNT(*) FROM agileuser WHERE id = @userId
IF ( @cnt = 1 )
BEGIN
SELECT
@tmp_first_name = first_name,
@tmp_last_name = last_name
FROM agileuser WHERE id = @userId
SELECT @tmp_first_name = RTRIM(@tmp_first_name)
SELECT @tmp_last_name = RTRIM(@tmp_last_name)
SELECT @temp = @tmp_first_name
IF ( @temp is not null )
BEGIN
SELECT @temp = @temp
END
SELECT @temp = @temp + @tmp_last_name
END
IF ( @cnt = 0 )
BEGIN
SELECT @cnt = COUNT(*) FROM user_group WHERE id = @userId
IF ( @cnt = 1 )
BEGIN
SELECT @temp = name FROM user_group WHERE id = @userId
END
END
return @temp
END
GO
-- Processing user assigned field of signoff table
DECLARE @signoff_assigned_rec VARCHAR(200)
DECLARE signoff_assigned_csr CURSOR FOR
SELECT id, user_assigned FROM signoff WHERE user_assigned is not null
OPEN signoff_assigned_csr
WHILE (0 = 0)
BEGIN --(
fetch NEXT FROM signoff_assigned_csr INTO @signoff_assigned_rec
IF (@@FETCH_STATUS = -1)
BREAK
UPDATE signoff SET user_name_assigned = getUserGroupName_upg(signoff_assigned_rec.user_ass igned) WHERE id = signoff_assigned_rec.id
END --)
close signoff_assigned_csr
DEALLOCATE signoff_assigned_csr
GO
View 2 Replies
View Related
May 25, 2008
Hi All,
First of all its very very urgent. Secondly I am not an expert.
Now here is my problem.
I want to loop through my html files and want to save the data in my table column. here is the Code which need correction.
CODE:
USE [AdventureWorks]
DECLARE @cmd varchar(1000);
DECLARE @FileName varchar(100);
DECLARE @FilePath varchar(100);
SET @FileName = 'C: est'+@FilePath+'html';
SET @cmd = 'INSERT INTO myTable(FileName, FileType, Document)' +
'SELECT ' + @FilePath + ', FileType,
* FROM OPENROWSET(BULK @FileName, SINGLE_CLOB) AS Document'
EXEC (@cmd);
Select * from myTable
Just for practice I am using Adventureworks db. I am using SQL Express 2005.
My html files are named something like this:
AC0234.html
DB9803.html
CG4571.html
I cannot change my file names.
Thanks in advance.
Regards;
View 2 Replies
View Related
May 25, 2008
Hi All,First of all its very very urgent. Secondly I am not an expert. Now here is my problem.I want to loop through my html files and want to save the data in my table column. here is the Code which need correction.CODE:USE [AdventureWorks]DECLARE @cmd varchar(1000);DECLARE @FileName varchar(100);DECLARE @FilePath varchar(100);SET @FileName = 'C: est'+@FilePath+'html';SET @cmd = 'INSERT INTO myTable(FileName, FileType, Document)' + 'SELECT ' + @FilePath + ', FileType, * FROM OPENROWSET(BULK @FileName, SINGLE_CLOB) AS Document'EXEC (@cmd);Select * from myTableJust for practice I am using Adventureworks db. I am using SQL Express 2005.My html files are named something like this:AC0234.htmlDB9803.htmlCG4571.htmlI cannot change my file names.Thanks in advance.Regards;
View 1 Replies
View Related
Mar 18, 2008
Hi Gnite everyone, i once again need help with a T-SQL syntax for Auto Correction for insert and update when client enters the wrong format, i;e, creating a SSN Data type and a User Defined Procedure that auto corrects input format i;e,
user inserts into table authors of the pubs DB 525-477845 column au_id that executes auto correction so user doesn't have to put in dashes for SSN format. Please help me with this syntax .
View 1 Replies
View Related