Viewing 15 posts - 46 through 60 (of 82 total)
select *
from MyTable
where (@Lang = Lang and Id = @Id)
or (Lang = '-')
July 23, 2003 at 5:06 am
You will need to change the "if" to a "case" (cannot use if in a select):
and b.arrival_date >=
case
when...
July 11, 2003 at 10:25 am
Could try either:
declare @Var1 varchar(50)
set @Var = null
select * from tblNews_Items where division = isnull(@Var1,division)
select * from tblNews_Items where (@Var1 is null or division = @Var1)
May 20, 2003 at 10:13 am
table_pk is the primary key constraint name. In this case they are using the table name plus "_PK" to make up the name. Therefore if your table was called tblEmployee,...
May 15, 2003 at 8:12 am
Enterprise Manager, select Table, right click menu: All Tasks > Manage triggers.
May 14, 2003 at 9:48 am
Well, your explaination of what you're after is not all that clear, but how about adapting:...
declare @TableName varchar(255)
declare @PosWanted int
declare @ColWanted varchar(255)
declare @Columns table
(
Position int identity(1,1),
ColName varchar(255)
)
set @TableName = 'TableName'
set...
May 13, 2003 at 5:54 am
?
update Table1
set Table1.Email = Table2.Email
from Table1
inner join Table2 on Table2.Name = Table1.name
?
April 10, 2003 at 8:49 am
It's certainly possible in TSQL, you just need to loop through the table replacing the duplicate values.
In the following example the values are inserted into another temp table (to set...
March 31, 2003 at 2:12 am
My above comment refers specifically to integers rather than Money values
February 17, 2003 at 8:56 am
The General way that I use is a small user defined function that takes in an int, converts it to a string, before inserting commas in the appropriate places.
This scalar...
February 17, 2003 at 8:54 am
It does, as usertypes are also stored in the systypes table.
There are complications though, as usertypes share the same xtypeId as their parent datatype, so this query returns both.
I'm sure...
February 17, 2003 at 8:20 am
Query the system tables, specifically the columns and the datatype tables
declare @tbl varchar(255)
declare @col varchar(255)
set @tbl = TableName
set @Col = ColumnName
select systypes.Name + '(' + cast(syscolumns.length as varchar(100)) + ')'...
February 17, 2003 at 6:52 am
nickel01: Note the "Forums Powered by Snitz" link at the bottom of the forums pages.
February 11, 2003 at 9:16 am
Could create a function that uses this code, and refer to the function in the table's computed column. At least this keeps the code out of the table ddl code
...
February 11, 2003 at 5:34 am
Viewing 15 posts - 46 through 60 (of 82 total)