Forum Replies Created

Viewing 15 posts - 4,021 through 4,035 (of 13,460 total)

  • RE: Re-Order Numbers in Table

    supplying the missing DDL and DML setup that is preventing analysis:

    drop table container_attribute_type

    CREATE TABLE container_attribute_type(container_attribute_type_id int,priority_sequence int,branch_id int,updated datetime,updatedby varchar(30))

    INSERT INTO container_attribute_type(container_attribute_type_id,priority_sequence,branch_id)

    SELECT 4,1,3 UNION ALL

    SELECT 11,2,3 UNION...

    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 an empty copy of database

    another way is to backup and restore the database, then delete everything in foreign key hierarchy order in the new copy.

    also, i know you said no data, but from experience...

    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: Want one values with similar ids

    a coded example of what Seans' first thought: clearly item 2 you wanted, at 40,000, does not give the desired results.

    you'll need to clarify either the biz logic or the...

    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: Schemabinding View

    saxena200 (2/11/2013)


    Created a view with schemabinding, and then created index on it...

    Question - before data loading is it necessary to drop the view or if i drop the index...

    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 jpg files into SQL server

    99% of the time, you do this kind of image inserts/updates in a programming language.

    TSQL does not have a native, built in way to do image to disk operations....

    but it's...

    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: Check sql server express 2005 or 2008 is installed

    what if they have 2008R2 or 2012 installed? 2005 is already eight years old...wow. keep in mind that official support from MS (end of life?) for that product is probably...

    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: assertions

    Mike Seattle (2/8/2013)


    OMG! I've worked with SQL Server for over 10 years and I've never heard of assertions. Really. This is the first time I hear there is something like...

    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 can I loop sp_help through for all tables or objects?

    Richard Warr (2/8/2013)


    Create a table with the same structure as the output from sp_help (e.g. tblHelp) and modify your code to insert to it, e.g.

    Select @sql = @sql +...

    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: SSRS Report Builder 3.0, SQL 2008 R2 Cannot get CASE statement to show up in dataset fields!

    you created teh case in the CTE, but you never use it in your final query, i think.

    see my reformatted post of your code, with this comment:

    e.TermWeek,--<<--don't you 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: how to find which user has dropped the table in sql server 2008 r2

    Like Anthony mentioned, the default trace has the information you are looking for, if not to much time has passed.

    SSMS has a handy report which queries the trace for you:

    Additionally,...

    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: Deny impersonate on all logins and users.

    maybe use the metadata to generate the scripts for you?

    this seems to be doing it right?

    EXEC sp_msForEachDb 'USE [?];SELECT ''?'' As DbName,''DENY IMPERSONATE ON LOGIN::MyAuditor TO '' + quotename(name) +...

    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: Deny impersonate on all logins and users.

    Howard i think this has an example of what you want, but i have not done this myself

    http://msdn.microsoft.com/en-us/library/ms186710.aspx

    A. Denying IMPERSONATE permission on a login

    The following example denies IMPERSONATE permission on...

    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 Database Mail Template

    Andrew From experience, doing it all in TSQL can get very wordy and long. the headers require a lot of customization to match the shape / number of columns in...

    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: heap with a lot of unused Space keep growing!

    a heap table never releases the space that were used by rows that existed, and then were deleted (unless a full table schema lock was applied, like when deleting ALL...

    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 update trigger

    also, you want to bulletproof the comparison if the value for the Start_Date is changing from null to not null: that's not necessary if the field is not-nullable to begin...

    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 - 4,021 through 4,035 (of 13,460 total)