Forum Replies Created

Viewing 15 posts - 181 through 195 (of 254 total)

  • RE: newbie - how to get newline in varchar(MAX)?

    Try to use char(13) + char(10), here is example:

    create table test

    (data varchar(max))

    insert into test

    values ('hello ' + char(13) + char(10) + 'world ! ')

    select * from test

    Is this what...

  • RE: What do your developers use ?

    First, it depends on what your developers develop. If they are doing just front-end apps without creating the stored procedures, they obviously don't need to have a SSMS installed.

    However,...

  • RE: Frozen SSMS

    In order to answer to a question of what size is error log file is I need to know in what folder it stores error log files - I tried...

  • RE: varchar(2000) or varchar(200)

    Yelena:

    I don't quite understand your point. So you are saying that if I insert a string with length of for example 35000 characters into varchar(max) data type column it will...

  • RE: SP_EXECUTE executing... what?

    You can also try this in 2005:

    select

    session_id,

    text

    from sys.dm_exec_requests s1

    cross apply

    sys.dm_exec_sql_text(sql_handle) as s2

    where session_id = <SPID NUMBER>

     

  • RE: varchar(2000) or varchar(200)

    In such cases when I am not sure about future growth of records length, I use varchar(max). It may have performance issues since SQL Server has to create another allocation...

  • RE: Long running queries?

    There are number of methods to identify a database call and its script. First that comes to my mind is to setup Profiler, then filter only application or user name that you...

  • RE: retrieving value from an xml field in the db

    Have you tried OpenXML function ?

  • RE: How to copy a table definition and data from one db to another?

    You can check database compatibily level by running this query:

    select

    name,

    compatibility_level

    from master.sys.databases

    where name in ('FirstDb', 'SecondDb')

    If any of them will have compatibility level 80 (which is 2000) I recommend...

  • RE: How to copy a table definition and data from one db to another?

    Do both databases have compatibility level 90 ? You can find it in database properties/ options.

  • RE: Insert numeric ID with interval

    select

    areacode,

    areaname ,

    unique_id = areacode * 100 + rank() over(order by areacode, areaname)

    from table1

  • RE: How to get this Out put ?

    create table empl(total decimal(5,2))

    go

    insert into empl

    select 263.07 union

    select 458.02 union

    select 45.58

    go

    select

    stuff

    (

    select ','+ cast(total as varchar(6)) from empl t1

    for xml path('')

    )

    ,1,1,''

    )

    go

  • RE: Unique index allows duplicate values

    Is this index enabled ?

    You can check this:

    select

    object_name(object_id),

    name, 

    is_unique,

    is_disabled

    from sys.indexes

    where name = <your_index_name>

     

  • RE: Comparing all columns in two tables

    The first part is easy, to compare missing rows run this:

    select

    t1.*

    from

    table1 t1 left join table2 t2

    on t1.col1 = t2.col1

    where t2.col1 is null

    For the second part, where you need to compare...

  • RE: Help requested on getdate

    Try this:

     

    select

    convert(smalldatetime,convert(varchar(10),getdate(),101))

     

Viewing 15 posts - 181 through 195 (of 254 total)