Viewing 15 posts - 196 through 210 (of 596 total)
I understand where Joe is coming from. I even own a few of his books. However, the reality is that there is a full range of experience levels that visit...
May 25, 2006 at 5:11 pm
Here's an example:
CREATE TABLE #test
(
id int IDENTITY(1,1)
, data varchar(30)
)
DECLARE @ascii tinyint
DECLARE @CR char(1) -- 13
, @LF char(1) -- 10
, @TAB char(1) -- 9
, @VT char(1) ...
May 25, 2006 at 6:14 am
Stuff is one of my favorite string functions. Also consider using it to remove substrings, as in this example:
DECLARE @s-2 varchar(100)
SET @s-2 = 'I do not love SQL Server Central.'
SET @s-2...
May 24, 2006 at 7:47 am
You can get the value of the TMP environment variable (on the server) using something like this:
CREATE TABLE #path
(
tmpPath varchar(200)
)
DECLARE @path varchar(200)
INSERT #path...
May 24, 2006 at 7:24 am
The IS_MEMBER() function may be of use to you as well.
May 24, 2006 at 6:55 am
Cast the result of the Round() function to DECIMAL(x,1), like this:
SELECT Cast(Round(Avg(Cast(MatchAssessment.Mark as decimal(18,3))),1) AS Decimal(10,1)) AS MarkAvg
FROM Match
...rest of query...
May 24, 2006 at 6:43 am
Here's a simple example that uses a cursor (sorry! ).
IF EXISTS(SELECT name FROM sysobjects WHERE name = N'movies' AND type = 'U')
...
May 23, 2006 at 10:24 am
The sa account is the System Administrator account. Since anyone who logs in with that user id can do anything they want in any database, you should use a secure...
May 23, 2006 at 8:34 am
Do you mean multiple result sets, or just a blank line or two between the groups when you run the query in QA?
May 23, 2006 at 7:51 am
Use bigint: bigID bigint IDENTITY(1,1) PRIMARY KEY
Here is an example where the seed value starts at 1,000,000,000
to show it works for large numbers:
CREATE TABLE bigtable
(
bigID bigint IDENTITY(1000000000,1) PRIMARY KEY
,...
May 19, 2006 at 5:44 am
--DROP TABLE original
GO
CREATE TABLE original
(
rid int
, math int
, bio int
, chem int
, eng int
)
GO
SET NOCOUNT ON
INSERT original VALUES (1, 8, 8, 8, 8)
INSERT original VALUES (2, 7, 7, 7,...
May 18, 2006 at 8:37 am
Although you can declare store procedures with text and ntext parameters, they cannot be accessed or used with T-SQL.
Your only choice is to convert the ntext to nvarchar(4000), or place...
May 17, 2006 at 6:35 am
Tim,
I ran Sergiy's example, and it seems work:
--DROP TABLE Orders
GO
CREATE TABLE Orders
(
id int IDENTITY(1,1) PRIMARY KEY
, type int
, netsales decimal(12,4)
, invoiceDate datetime
)
GO
SET NOCOUNT ON
INSERT Orders ( type, netsales, invoicedate)...
May 17, 2006 at 6:21 am
Hmmmm. Without being able to look at the workstation hands-on, it's tough to debug unusual problems. Maybe something else is going on. Did you change any other settings other than...
May 16, 2006 at 11:08 am
Scott is correct, it is always a good idea to upgrade the client tools with the same service pack as the server. Not doing so can cause problems, particularly if...
May 16, 2006 at 8:48 am
Viewing 15 posts - 196 through 210 (of 596 total)