Viewing 15 posts - 2,701 through 2,715 (of 8,731 total)
ChrisM@Work (6/13/2016)
Y.B. (6/13/2016)
IF EXISTS (SELECT 1 FROM SomeTable WHERE ID = @id)
UPDATE SomeTable SET SomeText = @SomeText
ELSE
INSERT INTO SomeTable VALUES (@ID, @SomeText)
EDIT: Although...
June 13, 2016 at 8:05 am
This is a scary idea. I'm not sure that letting people modify the schema.
That being said, it could be done by using a trigger and dynamic SQL.
As I'm against this...
June 13, 2016 at 7:36 am
It seems like you're looking for the syntax from this example.
CREATE TABLE TableA( id int identity, value varchar(100), somedate datetime DEFAULT GETDATE());
INSERT INTO TableA(value) SELECT 'One Value';
CREATE TABLE TableB( id...
June 13, 2016 at 7:13 am
Use the conditional.
TOKEN( @[User::AgeBucket],"-",1) == @[User::AgeBucket] ? TOKEN( @[User::AgeBucket],"+",1) : TOKEN( @[User::AgeBucket],"-",1)
June 10, 2016 at 12:42 pm
Ray K (6/10/2016)
Ed Wagner (6/10/2016)
HappyGeek (6/10/2016)
Revenant (6/10/2016)
djj (6/10/2016)
ThomasRushton (6/10/2016)
Ed Wagner (6/10/2016)
djj (6/10/2016)
Grumpy DBA (6/10/2016)
Ed Wagner (6/10/2016)
HappyGeek (6/10/2016)
ThomasRushton (6/10/2016)
Stuart Davies (6/10/2016)
Ray K (6/9/2016)
Hugo Kornelis (6/9/2016)
PokeOwwww!
Pain
Neck
Polo
Horse
Glue
Gun
Gatling
Nerf
Soft
Ware
Goods
Sporting
Kansas City
Chiefs
June 10, 2016 at 12:39 pm
Are you aware of the TRUNCATE TABLE statement? It might be a better option if you're deleting all the rows in a table.
June 10, 2016 at 12:39 pm
You could also use a derived column to insert a default value to those columns.
June 10, 2016 at 12:12 pm
kevin 26531 (6/10/2016)
Had thought about...
June 10, 2016 at 8:43 am
Brandie Tarvin (6/10/2016)
ThomasRushton (6/10/2016)
Am I being unreasonable in now thinking "perhaps you're not the one who should be doing this"?
I'm going to say Yes only because DB Mail is incredibly...
June 10, 2016 at 7:07 am
The title was a big hint. I just had to make sure it wasn't misleading. 😀
June 10, 2016 at 6:59 am
June 9, 2016 at 10:48 pm
I'll just leave this here. Be sure to understand the solutions or you'll have lots of trouble maintaining them.
You might want to read the following articles:
http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/
http://www.sqlservercentral.com/articles/T-SQL/63681/
http://www.sqlservercentral.com/articles/Crosstab/65048/
DECLARE @sales TABLE(
...
June 9, 2016 at 3:20 pm
patrickmcginnis59 10839 (6/9/2016)
June 9, 2016 at 3:15 pm
SQLUSERMAN (6/9/2016)
Below is the query I've used, please...
June 9, 2016 at 2:04 pm
Viewing 15 posts - 2,701 through 2,715 (of 8,731 total)