Forum Replies Created

Viewing 6 posts - 16 through 21 (of 21 total)

  • RE: getting results from all tables in database

    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 + ')...

  • RE: getting results from all tables in database

    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,...

  • RE: Update rows

    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...

  • RE: Extarct Words With Specific Format in SQL Column(text)

    Awesome indeed. That's a very cool solution.

  • RE: A Versioning system for SSRS

    I really enjoy the simplicity of this solution. Nice work.

  • RE: SQLServerCentral apologizes and you can win a book

    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...

Viewing 6 posts - 16 through 21 (of 21 total)