Forum Replies Created

Viewing 15 posts - 676 through 690 (of 1,170 total)

  • RE: Total space used per table

    Nice script! Thank you.

    I changed it a bit (for my purposes) to express the sizes in MBs since it's easier for reading when run on big databases.

    SELECT

    ...

    Igor Micev

  • RE: Best way to add constraint?

    Lenny Kramer (2/3/2014)


    Hello this is the message I get.

    ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being...

    Igor Micev

  • RE: Custom Error Message

    What about like this:

    BEGIN TRY

    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TestTable]') AND type in (N'U'))

    raiserror('There is already an object named ''TestTable'' in the database.',5,1)

    ELSE...

    Igor Micev

  • RE: Best way to add constraint?

    Hi,

    This will fail since I already have rows in student table.

    Why should it fail? It seems you have data that could not be referenced, but not because of the fact...

    Igor Micev

  • RE: #Date format, Order By, Group By : query ported from Sql developer to Toad for MSSQL

    Hi,

    In your first query (for Oracle) you're using TO_DATE() function to convert the date data type RECEIVEDATE to DATE. For MSSQL you're not doing the same. Try using a respective...

    Igor Micev

  • RE: SQL Server Job Schedule

    Than it should be simple.

    You can schedule your job on daily basis, and in the code for calling the SP you can use a little code

    if day(getdate()) in (1,5,8,12,18,24,26,30)

    ...

    Igor Micev

  • RE: Find all the inactive Windows Logins

    Than all users must have some privileges.

    You can modify some conditions in the code if you want to find something else.

    Regards,

    IgorMi

    Igor Micev

  • RE: SQL Server Job Schedule

    You can not do it with one schedule.

    A work around for that may depend on what is your job scheduled to execute: t-sql, ssis package, ...?

    Igor Micev

  • RE: Find all the inactive Windows Logins

    Subrata Bauri (1/30/2014)


    Dear All,

    How to query in SQL to retrieve all the disabled Windows Users which are available as records(only) in the SQL Server ?

    Thank you.

    Hi, try with the following...

    Igor Micev

  • RE: Compression

    patricklambin (1/30/2014)


    Hello John Mitchell ,

    Thanks for your reply which is confirming what I was thinking especially about LOB and maybe FILESTREAM ( and what about the FileTables ? )

    Maybe the...

    Igor Micev

  • RE: Autogrowth, shrink and database performance

    Jeff Moden (1/24/2014)


    IgorMi (1/22/2014)


    1) Yes, you can autogrow for 300 MB, however it's better to go with smaller sizes, let's say 50-70 MBs.

    2) No, you should not shrink. They are...

    Igor Micev

  • RE: ACID Properties Question

    L' Eomot Inversé (1/24/2014)


    IgorMi (1/22/2014)


    bandarimohan 57273 (1/21/2014)


    ACID property can be allowed for TempDB ?

    I don't know where is that property, but D-Durability cannot be guarantied for tempdb.

    Regards,

    IgorMi

    I don't see why...

    Igor Micev

  • RE: Optimize Update Statement

    Grant Fritchey (1/24/2014)


    ChrisM@Work (1/24/2014)


    IgorMi, you can use http://extras.sqlservercentral.com/prettifier/prettifier.aspx.

    I tend not to. If I'm about to spend a few minutes reading and understanding a chunk of code, reformatting it easily becomes...

    Igor Micev

  • RE: storedprocedure

    If you pass multiple TrainerID-s delimited, than you can parse them in the stored procedure and execute this insert

    insert into dbo.tbl_Workshop

    values(@Title,@Topic,@Date,@Duration,@CreatedDate,@UpdatedDate)

    as many times as the trainer ids there are...

    Igor Micev

  • RE: Optimize Update Statement

    ChrisM@Work (1/24/2014)


    Formatted for readability:

    -- Formatted

    DECLARE @tempS AS nvarchar(150)

    DECLARE @tempW AS nvarchar(50)

    DECLARE @tempQ As nvarchar(5)

    UPDATE dbo.EXPORTMAIN SET

    @tempS = SKU1,

    @tempW = WHSELOC1,

    @tempQ = QTY1,

    SKU1 = Case...

    Igor Micev

Viewing 15 posts - 676 through 690 (of 1,170 total)