Forum Replies Created

Viewing 15 posts - 1 through 15 (of 58 total)

  • Reply To: Collation errors...what is best way to deal with it?

    This query will tell you everything you need to know about all columns in all tables, including collations:

    SELECT
    C.TABLE_CATALOG AS SourceDB, C.TABLE_SCHEMA, C.TABLE_NAME,COLUMN_NAME
    , ORDINAL_POSITION,COLUMN_DEFAULT, IS_NULLABLE
    , DATA_TYPE , CHARACTER_MAXIMUM_LENGTH,...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Truncate tables where Referential Integrity exists

    The idea is good. However, order of executing generated scripts is important. When you DROP constraint, the its definition is lost, there will be no way to generate ADD CONSTRAINT.

    For...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Learn to Code

    It seems main goal of current new technologies is to convince people who do not know something that they are experts in that very field. Of course, they have to...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Does SSRS Report with Stored Procedure execute SQL string?

    Imagine if somebody passes this parameter:

    SET @Where = '1=1; DELETE TAble1, DELETE TAblee2...'

    I assume the parameter comes from a front end app. SELECT part will execute, but...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Error loading multiple CSV files in SSIS

    There are other ways of importing text files. You can try MS Access and import CSV into a new table, then examine the data. It is much simpler than directly...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Error sub query return more than one value

    The first subquery likely returns more than one row, and it should return one row only. Check it.

    insert into NewKms8081..members
    SELECT
    (select...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Are We Dinosaurs?

    I do not check SQL central every day, so I missed the article when it first appeared. I am in my 7th decade too, and potential dinosaur. Somehow, most of...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Idempotent

    If constraints are added, as many as possible, the data will be safer then without constraints. If there is error handling, either in external code or in SQL procedures,  error...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Data cleansing and Data filtering

    Need to cleanse data comes from acceptance of dirty data to begin with. It happens and there is apparently nothing we can do about it.

    There are two cases of data...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: nested subqueries vs separate queries performance difference

    Collation for #Temp table is the same as default collation for the server.  Table definition

    CREATE TABLE #NearTermData(
    [UNDERLYING_SYMBOL] [nvarchar](10) NOT NULL,
    [QUOTE_DATE] [date] NOT NULL,
    [EXPIRATION] [date] NOT NULL,
    [ROOT_SYMBOL] [nvarchar](10)...

    • This reply was modified 2 years, 2 months ago by Zidar.

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Will AI end with SQL, Is this the end of SQL?

    So far, AI seems to be capable of complex procedural tasks. It is like solving equations manually versus using MATLAB. Now everybody can solve linear equations, by means of MATLAB...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: How to get Active counts between dates. Please

    Or maybe create and keep a table, Calendar, that contains a record for each date in given interval. If your calendar table contains all dates from say, 1950-01-01 to 2150-12-31...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Inventory Query Help for linking Purchase order to transactions

    I apologize for the delay, was out of town for a few days.

    Thank you for refreshing the script and the explanation.

    I noticed that when listed in proper order, a picture...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Inventory Query Help for linking Purchase order to transactions

    Is there a primary key on Inventory table? It would help understanding what is going on.

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Ensuring a Single Row Table

    My solution is similar to what Eric M.  as Russell proposed, except for me not using identity. The version of CheckColumn would be

    CheckColumn  int UNIQUE CHECK (CheckColumn IN (1,2,3)) NOT...

    Zidar's Theorem: The best code is no code at all...

Viewing 15 posts - 1 through 15 (of 58 total)