Viewing 6 posts - 16 through 21 (of 21 total)
I did not convert your select statement into an update. Use this instead:
set @sql =
'update #t set TotalCHAR013 =
(select SUM(CASE WHEN CHARINDEX (CHAR(013), ' + @Columnname + ')...
March 14, 2014 at 1:36 pm
This might be what you are looking for:
DECLARE @dtNow datetime = GETDATE()
select newid() id
,@@SERVERNAME as ServerName
,DB_NAME() as DatabaseName
,sch.name as SchemaName
,Object_Name(c.object_id) as TableName
,c.name as ColumnName
,tp.name 'Data type'
,c.max_length 'Max Length'
,@dtNow as CaptureDateTime
,convert(bit,...
March 14, 2014 at 1:24 pm
If you are asking how to determine the tables that reference tablA you can use this:
select FK.table_name as [Source Table]
,FKU.column_name as [Column]
,FK.constraint_name as [Constraint]
,UK.constraint_name
,UK.table_name as [Referenced Table]
,UKU.column_name as [Column]
from Information_Schema.Table_Constraints...
March 11, 2014 at 8:11 am
Awesome indeed. That's a very cool solution.
January 31, 2014 at 9:18 am
I really enjoy the simplicity of this solution. Nice work.
January 24, 2014 at 9:51 am
There are numerous ways to generate a quick numbers table. I use this one.
--Numbers table 1M rows.
;with seed(col) as
(
select top 1000 1 [x] from sys.objects t1
cross join (select top 1000...
December 5, 2013 at 8:56 am
Viewing 6 posts - 16 through 21 (of 21 total)