Viewing 15 posts - 151 through 165 (of 515 total)
yes VARCHAR(MAX) is not allowed, but you can use VARCHAR(8000).
Try executing the code below:
declare @STR varchar(8000)
select @STR = 'create table #test
(ind int primary key not...
January 29, 2013 at 10:41 pm
Just as a thumb rule (that I follow), use CHAR only when you are sure of the character length. For example - SSN number is always of fixed length. For...
January 29, 2013 at 10:18 pm
bitbucket-25253 (1/29/2013)
Nice question on basics ....
+1
Also, as pointed out by Hugo yesterday, the link is also correct - latest version of BOL 🙂
January 29, 2013 at 9:49 pm
In order to change connections dynamically, you need to program them using script task in SSIS.
January 29, 2013 at 5:12 am
anthony.green (1/29/2013)
That was my original way of doing it, but then had a mental block of linking the CTE to the table.
This sometimes happens to me as well 🙂
January 29, 2013 at 5:11 am
Using merge (as pointed out by demonfox) you can easily user INSERTED.* and DELETED.* (as mentionded by Dwain) after MERGE in order to capture, columns and values which are being...
January 29, 2013 at 5:10 am
As rightly pointed about Anthony, this is bit tricky as there is no identifier on the rows. Here is another way of deleting duplicate records using CTE:
WITH DelDup
...
January 29, 2013 at 5:06 am
Easy question for the day!
I agree with the explanation by "demonfox", here is the BOL link for BIT datatype:
http://msdn.microsoft.com/en-us/library/ms177603.aspx
It clearly says "any non-zero value will be converted to 1". I...
January 28, 2013 at 10:18 pm
sainatth.wagh (1/28/2013)
Thanks people, with the similar piece of code it has solved my probelm....:-):-):-)
Wonderful! Glad to know that.
All glories to Jason as well for optimizing my code 🙂
January 28, 2013 at 3:53 am
Jason-299789 (1/28/2013)
No problem, let me know how it turns out.
Cool! This works well. Here is the modified (few compilation issues rectified) and tested version.
;WITH Cte_Src AS (
SELECT
Db_name(database_id) databasename
,Max(x.Last_Date) Last_Access_time
,Getdate() curr_time
FROM
sys.dm_db_index_usage_stats
CROSS...
January 28, 2013 at 2:26 am
Hey Jason, thanks for your valuable inputs. I shall have these incorporated and tested soon.
Thanks 🙂
January 28, 2013 at 1:57 am
OP here is how I have set-up custom auditing on the Server. The script given here will create an Audit Table and try to record DB access information. I use...
January 28, 2013 at 12:21 am
demonfox (1/28/2013)
:hehe: yes , it is ..
when I hear the word audit , I think of security 😛
and with CDC , Change data Capture , I think of it as...
January 28, 2013 at 12:10 am
demonfox (1/27/2013)
CDC is more like versioning than audit ; what does it mean by audit trail on daioy transactions ?
does it more related to logging of transaction by a login...
January 27, 2013 at 11:22 pm
Viewing 15 posts - 151 through 165 (of 515 total)