Forum Replies Created

Viewing 15 posts - 6,916 through 6,930 (of 13,460 total)

  • RE: drop and recreate foreign keys

    sqlfriends (8/19/2011)


    So in the result of the above script, does it mean the tables in truncate statement mean they don't have forign key constraint, and the tables in delete statement...

    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: Read multiple flat files with different formats and output to SQL Server

    unless you can make specific assumptions, there's no easy way to do this.

    if the first x number of columns are the same across all csv files, that might be 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: drop and recreate foreign keys

    here's a snippet based on Seans example, that gets all the tables in FK hierarchy order and generates the Truncates/delete commands for you, so you don't have to drop and...

    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: i want out of sp_helplogin sp into table

    sp_helplogins returns two different result sets.

    here's a table of the first result set i got from running this and scripting the table:

    /*

    SELECT *

    INTO #sp_helpLogins

    FROM OPENROWSET('SQLOLEDB','Server=DEV223;Trusted_Connection=Yes;Database=Master',

    ...

    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: newby wants to create a sequencial Alpha numeric value

    you can do it, but you still need an identity() column in your table.

    here's an example, see how because of the assumed format with a max length of 5, 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: get date of first monday of the given year?

    R.P.Rozema (8/19/2011)


    Are you, by any chance, working on getting the iso week number? Because if you are, have a look at this article[/url] (remember to follow the discussions link, there...

    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: Stored Procedure (with parameters) into Temp Table without creating table fields

    just one more thing...you can do it kind of, but the stored proc must return unique column names

    SELECT *

    INTO #temp

    FROM OPENROWSET('SQLOLEDB',

    'Server=DEV223;

    Trusted_Connection=Yes;

    Database=Master',

    'Set FmtOnly OFF;

    EXEC dbo.sp_Who')

    the above works.

    if...

    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: Stored Procedure (with parameters) into Temp Table without creating table fields

    Sorry Rob; i thought it was a low hanging fruit question....

    I assumed somethign i should not have.

    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: Stored Procedure (with parameters) into Temp Table without creating table fields

    oops i misread the question...no i do not know of a way to get the results of a procedure call into a dynamic table, oither than what you already asked...openrowset...

    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: query help

    i think something like this would be better than sp_msForEachDB:

    I prever to generate possible statements, review and prune,a nd then run them when I'm ready

    /*

    USE SandBox; create master key encryption...

    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: Loading Web Page Source from T-SQL

    ok 3 years ago i posted this forum answer on the same subject, along with vb6 source code and sample stuff to download a web page:

    http://www.sqlservercentral.com/Forums/Topic453789-5-1.aspx

    read the article and see...

    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: Loading Web Page Source from T-SQL

    built in it's not possible...anything outside of a sql database requires something special.

    you can do it with sp_OACreate, and get the data back in 4000 byte chunks untiol you have...

    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 question

    i think this does what you wanted;

    i grabbed a subquery of the items that would be marked as closed....everything else would still be open, right?

    SELECT

    #TestTable.ParentId,

    #TestTable.ChildId,

    #TestTable.RecordType,

    CASE

    WHEN MyCloseItems.ParentId...

    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: INSERT Chinese characters in SQL 2008

    @Name varchar(5000),

    all your variables must be nvarchar, including the procs definition and the final resulting column;

    otherwise you get an implicit converison, which changes it to quesiton marks...

    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 change new schema name from existing schema - Table

    that error says the table already exists in the hwdata schema.

    do a quick

    select * from hwdata.DesktopSoft_Master

    select * from dbo.DesktopSoft_Master

    decide which one to keep (say dbo was the "good one"

    then...

    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 - 6,916 through 6,930 (of 13,460 total)