Forum Replies Created

Viewing 15 posts - 106 through 120 (of 138 total)

  • RE: sys.tables.type

    Thanks dwain eventually find out what was needed.

  • RE: user_seeks Vs user_scan

    I found out that user_seek means number of times when the user issues the command like select fname from emp

    and user_scan means the number of time the user issue...

  • RE: Taking Backup Of table

    anthony.green (9/18/2012)


    back the data you want up into another table

    something like this

    select * into tablename_backup from tablename where somecol = 1000

    Hi since i am newbie in SQL Server, This solution...

  • RE: Datatype Of A Column

    Thanks bala for the information

  • RE: Datatype Of A Column

    rhythmk (9/14/2012)


    Hi Shadab,

    Try this.

    SELECT t.name AS tablename, c.name AS columnname,d.name AS datatype

    FROM sys.tables t inner join sys.columns c ON t.object_id=c.object_id

    inner join sys.types d ON d.system_type_id = c.system_type_id

    To have a clear...

  • RE: Datatype Of A Column

    subbareddy542 (9/13/2012)


    PLS TRY BELOW CODE..

    SELECT TABLE_NAME,COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH,NUMERIC_PRECISION,NUMERIC_SCALE FROM INFORMATION_SCHEMA.COLUMNS

    WHERE TABLE_NAME

    IN(SELECT name FROM sys.tables)

    ORDER BY TABLE_NAME

    Thanks Subbareddy for the solution. But i am trying to learn SQL Server. So like to...

  • RE: Practical used of database id

    Thank You

  • RE: Deleting duplicate record

    Thanks to all for suggesting the solution

  • RE: How to find a Query in all stored procedure

    Eugene Elutin (9/5/2012)


    Again, I would advise to simply search for objects interested and then do manual review of code.

    Hi,

    I think that would be next to impossible 🙂 .

  • RE: How to find a Query in all stored procedure

    XMLSQLNinja (9/5/2012)


    This should do the trick (building on Robert's query and Luis's suggestion) :

    -- pass the query text as search string variable

    DECLARE @query varchar(1000)

    SET @query =' INSERT ...

  • RE: How to find a Query in all stored procedure

    Robert klimes (9/5/2012)


    you could replace all spaces with wildcards

    SELECT o.name

    FROM sys.sql_modules m

    JOIN sys.objects o ON m.object_id = o.object_id

    where definition like replace('%select * from table1 where id=5%',' ','%')

    Thaks for the solution...

  • RE: How to find a Query in all stored procedure

    Luis Cazares (9/5/2012)


    Have you tried to use a method to eliminate duplicate spaces?

    Here's one way to do it http://www.sqlservercentral.com/Forums/FindPost821209.aspx

    You might need to replace char(9), char(10) and char(13) as...

  • RE: How to find a Query in all stored procedure

    Mark-101232 (9/5/2012)


    Shadab Shah (9/5/2012)


    Mark-101232 (9/5/2012)


    SELECT name

    FROM sys.objects

    WHERE type='P' AND OBJECT_DEFINITION(object_id) LIKE '%myquery here%'

    Your solution works only when every thing exact is pasted in myquery area in the above query. By...

  • RE: How to find a Query in all stored procedure

    Robert klimes (9/5/2012)


    you can also use the sys.sql_modules view.

    With sql_modules i found this query but it also as the same problem as specified aboveSELECT o.name

    FROM sys.sql_modules m

    JOIN sys.objects o ON...

  • RE: How to find a Query in all stored procedure

    Mark-101232 (9/5/2012)


    SELECT name

    FROM sys.objects

    WHERE type='P' AND OBJECT_DEFINITION(object_id) LIKE '%myquery here%'

    Your solution works only when every thing exact is pasted in myquery area in the above query. By the word exact...

Viewing 15 posts - 106 through 120 (of 138 total)