Viewing 15 posts - 2,116 through 2,130 (of 2,462 total)
This will get you what you are looking for...
-- (1) Sample data
DECLARE @x_p TABLE (xid int, nbr1 int, cid int);
DECLARE @x_c TABLE (cid int, chr char(1), nbr2 int, nbr3 int,...
-- Itzik Ben-Gan 2001
September 30, 2013 at 10:09 am
Koen Verbeeck (9/26/2013)
erikd (9/26/2013)
Alan.B (9/25/2013)
...
marky.marks;
Made my day. 😀
Didn't even notice it at first 😀
I'm just happy someone noticed 😀
-- Itzik Ben-Gan 2001
September 30, 2013 at 9:26 am
As a DBA I used a number of tools in the DBA bundle and was a big fan.
If you ever get a chance to attend a SQL in the...
-- Itzik Ben-Gan 2001
September 26, 2013 at 11:14 am
Below is a script that will get you information about all the jobs that ran between a two dates. I was not able to figure out how to get you...
-- Itzik Ben-Gan 2001
September 26, 2013 at 11:01 am
rightontarget (9/25/2013)
Here is what I need to run, but the output is truncated:
drop table A;
CREATE TABLE A(
[col_1] [nvarchar](30) NOT NULL,
[col_2] [varchar](256) NULL,
[col_3] [varchar](max) NULL,
[col_4] [varchar](max)...
-- Itzik Ben-Gan 2001
September 25, 2013 at 1:52 pm
In SSMS you can right-click on the job, select "Script Job as" > "Create to" > ("Query Window" or "File"). This will produce the DDL to create each job. I...
-- Itzik Ben-Gan 2001
September 25, 2013 at 1:46 pm
FYI, the sample ddl you provided had an error
I think insert into A (col_1, col_2, col_3)
should really be insert into A (col_1, col_2, col_3, col4)
All that said, No truncation, simple...
-- Itzik Ben-Gan 2001
September 25, 2013 at 1:25 pm
This is the way that I would do it.
--Your Data
WITH your_table AS
(SELECT * FROM
(VALUES
(12402223,171906,'Quality And Reliability Engineering',1,4),
(12402223,171906,'Quality And Reliability Engineering',2,10),
(12402223,171906,'Quality And Reliability Engineering',3,11),
(12402223,171906,'Quality And Reliability Engineering',4,5),
(12402223,171906,'Quality And...
-- Itzik Ben-Gan 2001
September 25, 2013 at 1:13 pm
OPTION 1
The down and dirty way (not recommended) would be to set the column visibility based on an expression like so:
=User!UserID <> "Manager #1" AND User!UserID <> "Manager #2"
OPTION 2
1)...
-- Itzik Ben-Gan 2001
September 19, 2013 at 1:33 pm
Am I going to be reduced to coding up something to list each column, its datatype, FK relationships, etc, then running it against the current and previous DB and eyeballing...
-- Itzik Ben-Gan 2001
September 19, 2013 at 10:40 am
If not for the un-closed <OrderID> tag you would have a well-formed fragment that you could query via XPath. What Scott and Sean included will be better for your requirement....
-- Itzik Ben-Gan 2001
September 18, 2013 at 10:38 am
I would add that it is good that you are on SQL Server Central. Use this site; it's a great resource! Ask questions, read through the forums and the articles....
-- Itzik Ben-Gan 2001
September 17, 2013 at 11:28 am
Well done Magoo; I knew there was a much better way but drew a blank.
Jeff Moden (9/16/2013)
-- Itzik Ben-Gan 2001
September 17, 2013 at 8:56 am
This could still be optimized but will perform a little better than my previous query:
--OUTPUT
SELECT e.MSKEY AS NUMBER,
ISNULL(fn.AVALUE,'') AS FNAME,
ISNULL(mn.AVALUE,'') AS MNAME,
ISNULL(ln.AVALUE,'') AS LNAME,
ISNULL(em.AVALUE,'') AS EMAIL
FROM Entries e
LEFT JOIN Entries...
-- Itzik Ben-Gan 2001
September 16, 2013 at 4:54 pm
Below is some DDL and a solution:
--DDL
USE tempdb
IF OBJECT_ID('tempdb..Entries') IS NOT NULL DROP TABLE Entries;
CREATE TABLE Entries (MSKEY int, ATTRNAME varchar(20), AVALUE varchar(20), primary key (MSKEY, ATTRNAME));
INSERT Entries (MSKEY,...
-- Itzik Ben-Gan 2001
September 16, 2013 at 4:05 pm
Viewing 15 posts - 2,116 through 2,130 (of 2,462 total)