Viewing 15 posts - 106 through 120 (of 268 total)
Elaborating...
USE Northwind
select LastName + FirstName + convert(varchar(36),newid()) from Employees -- Very Unique
select binary_checksum(LastName,FirstName) from Employees-- Case sensitive
select checksum(LastName,FirstName) from Employees-- Case insensitive
/rockmoose
July 15, 2004 at 3:14 pm
Nice mwelcome!
So now I have to go back and check execution plans etc to find which of these approaches is the most efficient....
/rockmoose
July 15, 2004 at 2:52 pm
SELECT * FROM mytable WHERE Id IN (1,3,2,4)
ORDER BY CASE Id WHEN 1 THEN 1 WHEN 3 THEN 2 WHEN 2 THEN 3 WHEN 4 THEN 4 ELSE 0X7FFFFFFF END
..by...
July 15, 2004 at 2:45 pm
This was a challenge...
Couldn't find many ways to do it better :-).
But this is shorter ;-), and will round the float value correctly:
declare @projectcost float
set @projectcost = 6842332198.523549
-- shorter version...
July 15, 2004 at 2:26 pm
Good day,
I would suggest using a computed column IOF trigger ... 🙂
Like so (copying noelds sample ):
The CAST is just to get the bit datatype for the computed column.
CREATE TABLE...
July 15, 2004 at 1:24 pm
Good J..P..
Sometimes I have implemented something like this:
SELECT ServerName, Environment, ServerRole FROM V_ServerDetail
WHERE ServerName = ISNULL( @ServerName, ServerName )
ORDER BY ServerName
But your solution is better since it works for NULL...
July 15, 2004 at 4:47 am
/************* Run DTS Package **************/
declare @package_name varchar(128)
declare @cmd varchar(255)
set @package_name = 'MyNiceDtsPackage'
set @cmd = 'dtsrun /S SERVERNAME /E /N ' + @package_name
execute master..xp_cmdshell @cmd --, no_output
/******************************************/
Lookup xp_cmdshell and dtsrun in BOL...
July 13, 2004 at 5:13 am
What are the other Unique Indexes / Primary Key on the table ?
Use that to retrieve the last newid() in the table.
Using ONLY a Uniqueidentifier as Key in the table...
July 13, 2004 at 4:58 am
Yup, If you come across a better solution please notify me Profiler is a great help... |
July 11, 2004 at 3:47 pm
Hi,
You could use: DBCC INPUTBUFFER(pid),
Ok, will only get first 255 chars of the statement...
/rockmoose
July 9, 2004 at 4:06 am
Recently there was a discussion on a similar / related problem here:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=122554#bm124279
/rockmoose
July 8, 2004 at 8:30 am
July 8, 2004 at 5:02 am
Maybe it is something simpler that is needed:
SELECT NON EMPTY
{[Call Date].[20031102]:[Call Date].[20031104]} ON COLUMNS,
CROSSJOIN({[Region Customers].[Region].Members},{[User IDs].Members}) ON ROWS
FROM [Billed Call Detail]
Is this what You are trying to accomplish ?:
SELECT NON...
July 8, 2004 at 4:40 am
For Exporting data, Do I need special tools? (If so name me some) - I need to transfer the data from one application to another
One springs to mind: bcp (...
July 8, 2004 at 4:28 am
Maybe You could split the problem somehow.
DECLARE @ToBeDeleted TABLE( Id int not null primary key clustered 
INSERT @ToBeDeleted( Id )
SELECT ... Query to Resolve the...
July 8, 2004 at 4:19 am
Viewing 15 posts - 106 through 120 (of 268 total)