Forum Replies Created

Viewing 15 posts - 10,621 through 10,635 (of 13,460 total)

  • RE: Business Rule Database Design Question

    your example was interesting!

    I see how that fails, when I'd obviously think that was jsut fine...That's what you mean about having to test the business condition in the trigger instead,...

    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: SSC Points

    I saw mine jump up; thanks!

    I got promoted as a result and I'm in the "Hall of Fame" now. only 17,000 more posts and I can be like

    Steve Jones...

    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: Business Rule Database Design Question

    here's a simple example I whipped up to show the table constraint preventing more than three items checked out per student id:

    Create Table tblStudent (

    StudentID int identity(1,1)...

    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: Business Rule Database Design Question

    David Portas (8/14/2009)[hr

    SQL Server unfortunately has quite poor support for referential integrity and other declarative constraints in the database. Such rules often have to be implemented in procedural code either...

    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: Recursive AFTER INSERT trigger: is it possible ?

    recursive triggers is a per-database option; it is usually rare that you really need to call a trigger recursively, so it's disabled by default.

    right click...properties for the database in quesiton...Options...

    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: SLOW Queries... ready to pull my hair out.

    another thing you can try to change is this:

    WHERE searchstring like '%@search1%' AND searchstring like '%@search2%' searchstring like '%@search3%'...

    if you search for LIKE '%something%' , then it requires a...

    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: T-SQL to Copy a Table From One DB to Another WITH All Triggers, Keys, Constraints

    ok i know i have SQL Express with Advanced Options instealled...i certainly have the options i was describing: some i've turned off, some are turned on...you can decide which 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: T-SQL to Copy a Table From One DB to Another WITH All Triggers, Keys, Constraints

    thanks!

    i think the script is pretty kewl, but there's so many ways to skin a cat...you can do the same in SMO and stuff, so not too many people want...

    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: T-SQL to Copy a Table From One DB to Another WITH All Triggers, Keys, Constraints

    pretty sure the SSMS can do this for you; it's just some check marks int he scripting options to include triggers, constriants, etc.(TOOLS>>Options>>Scripting>> section for TABLE...check/uncheck various scripting options)

    i contributed...

    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: 'Add' to a character.

    you cannot reuse the numbers if there are gaps...at least not easily.

    assuming you want a 10 digit number, ie 1 with 9 preceeeding zeros:

    '0000000001'

    Alter Table MyTable Add MyCalculatedColumn As RIGHT('0000000000'...

    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 Server 2005 Scripting

    Sarab is right, it's already a built in option:

    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: TSQL Bulk insert

    here's how I doing: bulk insert with dynamic SQL:

    note the forum strips out the slash -n, so i put a placeholder {slash-n}

    --bulk insert won't take a variable name, so make...

    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: checking for data exists in a multiple tables in single query

    something like this: testing if any child data exists?

    IF NOT EXISTS

    ( SELECT 1 FROM CHILDTABLE1 WHERE PK IN (SELECT...

    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 get last 15min of data from online table

    doh thanks Matt; I did flub that up to get more than 15 instead of less than 15.

    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 get last 15min of data from online table

    you'll want to compare that column against the current datetime, which you get from the built in GETDATE() function.

    you also want to use the DATEDIFF function to return minutes():

    ie:

    SELECT *...

    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 - 10,621 through 10,635 (of 13,460 total)