Forum Replies Created

Viewing 15 posts - 9,211 through 9,225 (of 13,460 total)

  • RE: Email from DDL trigger

    smitty your syntax was close; i tested this with my profile, and it works fine:

    ALTER TRIGGER [ddl_trig_database]

    ON ALL SERVER

    FOR CREATE_DATABASE

    AS

    declare @results varchar(max)

    SELECT EVENTDATA().value('(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]','nvarchar(max)')

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'Default Notifications',

    @recipients = 'lowell@mydomain.com',

    @body =...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to Merge 3 database to 1 database

    there's not a simple script that does it; everything depends on the specifics of the data in question...foreign keys, primary key definitions, and more. you'll need to analyze the data...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Two Server have different times on processing ETL.

    well, the existing load on the production server would certainly affect the speed, as it has to share/complete for resources with regular users;

    the devleopment server probably has a near-no load...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Easy SQL

    the trick is to join the table against itself, so you can exclude one group:

    something like this:

    SELECT *

    FROM SOMETABLE t1

    WHERE t1.contact_type = 'Requestor'

    AND t1.user_id NOT IN

    (SELECT user_id ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to use sqlcmd to run my create database/tables/sp's script

    the are .NET references, and have nothing to do with having SQL installed or not.

    you should be able to go to the project references and add them.

    ==edit whoops my bad...you...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: DiskSpace```

    well there's a couple of ways to do it, but they are just different flavors of the same idea....the command must be run on each server.

    One way is to...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to use sqlcmd to run my create database/tables/sp's script

    niteshrajgopal (6/17/2010)


    Thank you Lowell. I will try that now. You are a lifesaver:-D

    I would really really appreciate it if you could do a sample of that form for me as...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. , but it works on the server

    when you create a linked server, you have one of 4 security options to use as far as which credentials.

    I suspect that the first option shown in the screenshot below...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: link server having two different database and also different login

    from the GUI, it's not obvious how to alias an existing SQL Server:

    --#################################################################################################

    --Linked server Syntax for SQL Server With Alias

    --#################################################################################################

    EXEC master.dbo.sp_addlinkedserver @server = N'MyLinkedServer',@srvproduct = N'', @datasrc = N'DBSQL2K5', @provider...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: link server having two different database and also different login

    biren (6/17/2010)


    yes I can link more than one server but what if like in my case I have linked the server having database AA with its login details now when...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Create Identical Triggers for all Tables in One Database

    goodguy (6/17/2010)


    Thank you, all for your valuable inputs.

    @Lowell: most tables have the PK as the first column, yes, but some tables have composite PKs, made of two/three columns. Will it...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Create Identical Triggers for all Tables in One Database

    here is something very similar to what Wayne posted, the only difference is my script makes an assumption that the FIRST column in a table is the Primary Key because...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: DateDiff In SSRS Problem

    are you trying to get a boolean value?

    DateDiff returns an integer, your example seems to be doing this:

    FORMAT (DateDiff("DAY", Fields!ReAdmitDate.Value, Fields!AdmitDate.Value) >= 30)

    'would be the same as this witht he...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Corrupt Master Database?

    if you can log in to SQL Server, master is not corrupt; could it be the logins were deleted?

    If you open Object Explorer in SSMS, and expand the Security>>Logins...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL 2005 find all users in a DB role

    i have this saved in part of my snippets; it's scripting all the users for every role ; you could parameterize it to limit it to one role if desired:

    --example...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 9,211 through 9,225 (of 13,460 total)