Viewing 15 posts - 226 through 240 (of 430 total)
The script is only for inserting the data into @MyTable.
SELECT * FROM @MyTable
Will give you the table with data to test the queries. I wanted to give Random...
August 4, 2005 at 11:33 am
##MyTable in a stored procedure. What will happen if more than one call at a time to the stored procedure?
Another question how did you make thread inside a thread. Or...
August 3, 2005 at 4:51 am
/* Use SCOPE_IDENTITY() to get the identity value inserted in scope */
SET NOCOUNT ON
GO
CREATE TABLE TEST
(
MyID INT IDENTITY,
MyOtherCol VARCHAR(20),
MyDesc VARCHAR(20)
)
GO
CREATE PROCEDURE Test_Insert
(
@pMyDesc VARCHAR(20)
)
AS
SET NOCOUNT ON
INSERT INTO TEST (MyOtherCol, MyDesc) VALUES ('', @pMyDesc)
UPDATE TEST
SET
MyOtherCol =...
August 1, 2005 at 9:40 pm
SET NOCOUNT ON
DECLARE @Countries TABLE
(
CountryCode INT,
CountryName VARCHAR(100)
)
INSERT INTO @Countries VALUES (1, 'Country Name 1')
INSERT INTO @Countries VALUES (5, 'Cote D''Ivoire')
SELECT * FROM @Countries
July 29, 2005 at 8:57 am
select db.[name] [database], l.[name] [owner]
from
master.dbo.sysdatabases db
join
master.dbo.syslogins l
on
db.sid = l.sid
July 29, 2005 at 8:41 am
If you are using ASP.NET use
System.Security.Cryptography class library to encrypt and decrypt the credentialls.
July 29, 2005 at 7:54 am
SELECT @Result = COALESCE(@Result + ', ', '') + CONVERT(VARCHAR, ColA)
FROM
(SELECT TOP 100 PERCENT * FROM @MyTable ORDER BY 1) A
July 27, 2005 at 8:27 am
SET NOCOUNT ON
DECLARE @MyTable TABLE
(
ColA INT,
ColB VARCHAR(10)
)
INSERT INTO @MyTable VALUES (1,'AAAA')
INSERT INTO @MyTable VALUES (2,'BBBB')
INSERT INTO @MyTable VALUES (3,'CCCC')
INSERT INTO @MyTable VALUES (4,'DDDD')
INSERT INTO @MyTable VALUES (5,'EEEE')
/* RESULT */
DECLARE @Result...
July 27, 2005 at 8:09 am
I thougt I used rollup in my reply.
try
SELECT * INTO #Result
'Your Query with Rollup'
Edit/delete and update #Result
SELECT * FROM #Result
Or you can merge the multiple datatables into...
July 25, 2005 at 10:09 am
Workaround
SELECT * INTO #Result
'Your Query with COMPUTE BY'
SELECT * FROM #Result
SELECT * INTO #Result
'Your Query with Rollup'
Edit/delete and update #Result
SELECT * FROM #Result
July 25, 2005 at 9:27 am
My Mistake. Check This.
DECLARE @MyTable TABLE
(
MyVal Varchar(100),
Deleted BIT
)
INSERT INTO @MyTable VALUES ('MyVal1', 0)
INSERT INTO @MyTable VALUES ('MyVal2', 1)
INSERT INTO @MyTable VALUES ('MyVal3', 0)
INSERT INTO @MyTable VALUES ('MyVal4', 1)
INSERT INTO @MyTable...
July 25, 2005 at 8:29 am
SET NOCOUNT ON
DECLARE @Book TABLE
(
bookID INT,
ISBN VARCHAR(100)
)
DECLARE @Contributor TABLE
(
contributorid INT,
FirstName VARCHAR(100),
LastName VARCHAR(100)
)
DECLARE @bookContributor TABLE
(
BookContributorID INT,
bookID INT,
contributorid INT
)
INSERT INTO @Book VALUES (1, '12345')
INSERT INTO @Contributor VALUES (1, 'Tom', 'Clancy')
INSERT INTO @Contributor...
July 25, 2005 at 8:17 am
SELECT *
FROM myTable
WHERE @filter = CASE WHEN Deleted = 0 THEN 'Active'
WHEN Deleted = 1 THEN 'Inactive'
WHEN Deleted IN (0, 1) THEN 'All'
July 25, 2005 at 8:05 am
Viewing 15 posts - 226 through 240 (of 430 total)