Viewing 15 posts - 2,281 through 2,295 (of 2,462 total)
This should get you started...
IF OBJECT_ID('tempdb..#table1') IS NOT NULL
DROP TABLE #table1;
IF OBJECT_ID('tempdb..#table2') IS NOT NULL
DROP TABLE #table2;
CREATE TABLE #table1 (sno int unique NOT NULL, [sid] int NULL, sname varchar(2) unique...
-- Itzik Ben-Gan 2001
March 12, 2013 at 3:06 pm
dsrapid (3/11/2013)
I have below table:
ID URL
I am trying to create a procedure where I take the input...
-- Itzik Ben-Gan 2001
March 12, 2013 at 2:33 pm
Its worth noting that, if you do not assign a value to @EndUserDel it will return NULL value. See my comments in the code below
IF OBJECT_ID('tempdb..#service') IS NOT NULL
DROP TABLE...
-- Itzik Ben-Gan 2001
March 11, 2013 at 2:03 pm
rummings (3/11/2013)
Alan,Thank you for the code.... it worked great!
Charlie
Any time.
-- Itzik Ben-Gan 2001
March 11, 2013 at 9:04 am
Cursors, loops and dSQL fall under the last choice column but this is one of those cases...
For tables you would do this:
EXEC sp_MSforeachtable'SELECT TOP 1 * FROM ?'
For...
-- Itzik Ben-Gan 2001
March 7, 2013 at 3:23 pm
I know I am a little late here but, Great article Gus.
FYI - the to Celko's article (http://www.intelligententerprise.com/001020/celko.jhtml.) is broke 😉
-- Itzik Ben-Gan 2001
March 6, 2013 at 3:59 pm
Lynn, Jeff, Kevin, ChrisM: thank you very much. This has been a particularly informative and excellent thread. It's given me a lot of new things to chew on.
Inline Table...
-- Itzik Ben-Gan 2001
March 5, 2013 at 1:47 pm
This is something I need to play around with more. I took what Jeff said to imply that, in the code below, the iTVF function (nsq_iTVF) would be faster than...
-- Itzik Ben-Gan 2001
March 1, 2013 at 1:46 pm
syedathariqbal (3/1/2013)
Managed to get the list using below query.
SELECT TABLE_NAME FROM [DB1].information_schema.TABLES
Where TABLE_TYPE='BASE TABLE'
EXCEPT
SELECT TABLE_NAME FROM [DB2].information_schema.TABLES
Where TABLE_TYPE='BASE TABLE'
In case there are other schemas:
SELECT TABLE_SCHEMA, TABLE_NAME...
-- Itzik Ben-Gan 2001
March 1, 2013 at 11:46 am
Google sp_send_dbmail.
-- Itzik Ben-Gan 2001
February 28, 2013 at 7:10 pm
No problem Amy.
That's actually a newer technique for me too and has been very helpful. You can do deletes in the same way...
;WITH X AS (SELECT * FROM dbo.emp...
-- Itzik Ben-Gan 2001
February 28, 2013 at 8:21 am
Jeff Moden (2/25/2013)
Alan.B (2/25/2013)
If i am understand right. Function can return only one value. am i right?
Scalar functions return one value, table valued functions return a table variable.
Inline Table...
-- Itzik Ben-Gan 2001
February 28, 2013 at 8:08 am
If i am understand right. Function can return only one value. am i right?
Scalar functions return one value, table valued functions return a table variable.
-- Itzik Ben-Gan 2001
February 25, 2013 at 6:05 pm
Amy.G (2/25/2013)
...Now, I know if I just want a result set, I can use the query...
If you can produce the result set then all you can can produce an update...
-- Itzik Ben-Gan 2001
February 25, 2013 at 4:49 pm
SQLWannabe (2/25/2013)
Thanks for the resposne. I should have been more clear. What I should've said was:
"I need to change the collation in my query".
The COLLATE function/keyword is definitely...
-- Itzik Ben-Gan 2001
February 25, 2013 at 3:58 pm
Viewing 15 posts - 2,281 through 2,295 (of 2,462 total)