Forum Replies Created

Viewing 15 posts - 826 through 840 (of 13,446 total)

  • RE: Parse street

    based on experience, you won't find a one-function-to-rule-them-all address cleanup. break it up into smaller pieces that complement each other.

    there's too many exceptions to the patterns;

    what I've done previously is...

  • RE: Is it possible to create a database alias or synonym?

    SQL-DBA-01 (9/26/2016)


    Hi Experts,

    Wanted to know if there is there any way to have database names aliases in SQL Server?

    For example, there is a database with Name: "database A". Can...

  • RE: Generate a dynamic insert into statement for a table

    there's a neat trick using FOR XML to get a delimited list of columns.

    here's a snippet i wrote that i use in a procedure to generate sample insert/update/merge statements.

    it assumes...

  • RE: List of SQL Servers in a company

    First, use Central Management Servers or Registered Servers; that will be where you add new servers as you discover them.

    That functionality is built into SQL Server Management Studio, so there's...

  • RE: How to use Windows Scheduler to run a Simple SQL Batch File?????

    Besides running the script with an impersonated credential, which solves the SQL problem,i would think you need an explicit path to your sql file:

    sqlcmd -S myserver -E -i "C:\Data\AutomatedScripts\DeleteRecordsTest.sql"

  • RE: Insufficient memory error when executing the script.

    for a large script, you'll want to execute it via sqlcmd instead of trying to open it in SSMS and executing it.

  • RE: Execution plan ignoring a Temp Table being used to filter the results

    did you try selecting from the temp table, and left joining the larger table?

    from your description, it sounds like your first table is the larger table, and you inner join...

  • RE: carriage return in stored proc

    you are doing it correctly, but it depends on what is doing the presenting.

    In Grid mode in Management Studio, CrLf are ignored(converted to spaces) FOR PRESENTATION ONLY, if you copy...

  • RE: Restrict access on single database from admin user

    SQL_Student (8/29/2016)


    Thanks I tried that, but if user has sysadmin role he still has access to the db 🙁

    in general, If someone has sysadmin access, you cannot restrict access to...

  • RE: Views not changing when table changes

    when the view is actually compiled, the wild card is expanded to the list of actual column names in the compiled version of the view;that's to avoid dynamically having to...

  • RE: Job to Back Up DB structures only

    there's a number of powershell scripts that use SMO to script out all objects as well;

    you could easily set something up to call that on a regular basis.

    I'll see if...

  • RE: SQL database files

    tobypaul509 (8/23/2016)


    What is the best tool in terms of efficiency, cost and success rate for repairing and recovering corrupt SQL 2005 database files?

    I need to purchase a tool for my...

  • RE: How to prevent a table from being truncated or dropped

    ChrisM@Work (8/23/2016)


    JasonClark (8/23/2016)


    Try to run the below code to prevent accidental delete:

    CREATE TRIGGER [TR_ProtectCriticalTables]

    ON DATABASE

    FOR

    DROP_TABLE

    AS

    DECLARE @eventData XML,

    @uname NVARCHAR(50),

    ...

  • RE: Extended Event DDL and Filter out Temp tables?

    GilaMonster (8/22/2016)


    Try filtering on database_id, or is the db_id the id of the connection rather than the table?

    doh simple and obvious;

    the database_id =2 , regardless of what database context that...

  • RE: Execution Plan Question

    whenever the difference between estimated rows and actual rows is off by a lot(order of magnitude or more,

    it usually means the statistics are out of date enough to adversely affect...

Viewing 15 posts - 826 through 840 (of 13,446 total)